Can you please suggest which API is right match to perform cancel payment? Have analyzed TMF676- Payment Management API, Here I am getting payment and refund operation. So should we use refund operation to perform cancel payment or any other? Please suggest.
This is a great question, and it needs to be analyzed thoroughly. Perhaps you could explain what exactly you mean by canceling a payment. We can posit that a payment goes through a number of conceptual life-cycle phases. So for example a credit card payment would have (blue-sky flow, and I may have missed something):
So, until when in this process is it possible to cancel the payment? It might depend on the capabilities of the payment gateway.
And what would be the business for triggering a payment cancelation?
From TMF Open API perspective, canceling a payment would be like canceling an order - we would have a dedicated task resource CancelPayment, which would embed reference to the payment being canceled and would have status such as in progress, succeeded, failed. The implementation of the POST operation for CancelPayment would work against the participating systems (primarily the payment gateway I imagine).
Hope it helps
Just another thought on cancellation of payment in registered customer scenario. Cancellation of payment some time fall under credit note i.e. give additional credit on account which may convert into refund. So in finance system , there is rare chance of having cancellation concept after payment but refund and can be linked with BillingAccount under TMF 666.