Cancel or Refund
Cancel or Refund
If you are not sure whether the original authorization transaction has been completed, you can call the POST CancelOrRefund interface to refund the funds to the consumer.
Sync Flow:
Async Flow:
The main process is as follows:
When you initiate the CancelOrRefund, you will use the
merchantTransInfo.merchantTransIDthat you sent when calling thePOST Paymentinterface. You need to add this parameter to the URL of thePOST CancelOrRefundrequest so that EVO Payment can locate the original pre-authorization transaction and initiate the cancellation.Check the value of the
cancelOrRefundfield in the EVO Payment response:- If
cancelOrRefundisCancel, you need to check thecancel.statusfield. If the value of this field isSuccess, it indicates that the cancel was successful; otherwise, checkresult.codeandresult.messageto find out the reason for the transaction failure. - If
cancelOrRefundisRefund, you need to check therefund.statusfield. If the value of this field isSuccess, it indicates that the refund was successful; otherwise, checkresult.codeandresult.messageto find out the reason for the transaction failure.
- If
If you do not receive a response from EVO Payment, you need to call
GET CancelOrRefundto query the transaction result. When you receive the query response, you should first determine the value of thecancelOrRefundfield, and then check the correspondingxxx.statusto determine the transaction result, using the same judgment method as in step 2.If you included a
webhookin thePOST CancelOrRefundrequest and the transaction'sxxx.statusisSuccess, you can also obtain the transaction result through asynchronous notification. Again, you should check thexxx.statusfield to determine the transaction result, using the same judgment method as in step 2.
TIP
The eventCode for asynchronous notifications from the CancelOrRefund interface is either Cancel or Refund, depending on whether the original authorization transaction was completed.

