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.merchantTransID
that you sent when calling thePOST Payment
interface. You need to add this parameter to the URL of thePOST CancelOrRefund
request so that EVO Cloud can locate the original pre-authorization transaction and initiate the cancellation.Check the value of the
cancelOrRefund
field in the EVO Cloud response:- If
cancelOrRefund
isCancel
, you need to check thecancel.status
field. If the value of this field isSuccess
, it indicates that the cancel was successful; otherwise, checkresult.code
andresult.message
to find out the reason for the transaction failure. - If
cancelOrRefund
isRefund
, you need to check therefund.status
field. If the value of this field isSuccess
, it indicates that the refund was successful; otherwise, checkresult.code
andresult.message
to find out the reason for the transaction failure.
- If
If you do not receive a response from EVO Cloud, you need to call
GET CancelOrRefund
to query the transaction result. When you receive the query response, you should first determine the value of thecancelOrRefund
field, and then check the correspondingxxx.status
to determine the transaction result, using the same judgment method as in step 2.If you included a
webhook
in thePOST CancelOrRefund
request and the transaction'sxxx.status
isSuccess
, you can also obtain the transaction result through asynchronous notification. Again, you should check thexxx.status
field 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.