In order to allow payments from elixir, pay, samport, etc to be added to the payment service, even if the initial payment request wasn't made through the payment api, we need an additional method + end-point.
My suggestion is that we add POST /payments/{operation}, which similar to POST /payments/{id}/{operation}, would add an operation to a payment.
The difference is that we don't know when we add e.g. the acquisition operation if the parent payment object exist or not. The end-point would try to match the operation to an existing payment, and if it exist, would add it to that payment. If it does not exist, it would create a new parent object and add the operation to that object.
In order to allow payments from elixir, pay, samport, etc to be added to the payment service, even if the initial payment request wasn't made through the payment api, we need an additional method + end-point.
My suggestion is that we add POST /payments/{operation}, which similar to POST /payments/{id}/{operation}, would add an operation to a payment.
The difference is that we don't know when we add e.g. the acquisition operation if the parent payment object exist or not. The end-point would try to match the operation to an existing payment, and if it exist, would add it to that payment. If it does not exist, it would create a new parent object and add the operation to that object.