Cancel
Cancel
When you need to cancel a transaction, you can use the POST Cancel interface to initiate the cancel.
Note
The following transaction types support cancel:
Payment, Pre-Authorization and Capture
The main process is as follows:
- When initiating a payment cancel or pre-authorization cancel, you need to use the
merchantTransInfo.merchantTransIDthat you provided when calling thePOST Paymentinterface. You should include this parameter in the POST Cancel request URL so that EVO Payment can locate the original pre-authorization transaction and initiate the cancel.
CAUTION
If you need to cancel a capture, you should use the merchantTransInfo.merchantTransID from the POST Capture interface in the POST Cancel request URL.
Example
js
curl 'https://hkg-online-uat.everonet.com/g2/v0/payment/acq/10130014/evo.offline.cancel/T20240306135818963' \
-H 'Authorization: 6323ebe1e60fe42edd39d8d0425e8876fd6c9981536ced4cb9a3b4ef8a178f9b' \
-H 'DateTime: 20240306140712+0800' \
-H 'SignType: SHA256' \
-H 'Content-Type: application/json' \
-H 'MsgID: M20240306140712147' \
-d '{
"merchantTransInfo": {
"merchantTransID": "T20240306140712147",
"merchantTransTime": "2024-03-06T14:07:12+08:00"
},
"paymentMethod": {
"type": "card",
"card": {
"posEntryMode": "magnetic",
"pinFlag":false,
"termReadability":"6",
"icCardCondCode":"0",
"noSecretNoSignFlag":"0",
"cardInfo": {
"cardNumber": "4761340000000043",
"expiryDate": "4912",
"track2": "6250940500000006=49121219668000356771"
}
}
}
}'- Check the
cancel.statusfield in the EVO Payment response. If the value of this field isSuccess, it means the cancel was successful. Otherwise, you need to review theresult.codeandresult.messageto determine the reason for the transaction failure. - If you do not receive a response from EVO Payment, you should call
GET Cancelto query the transaction result. When you receive the query response, you should also check thecancel.statusfield to determine the transaction result, using the same method as in step 2. If the transaction failed, review thecancel.failureCodeandcancel.failureReasonto determine the cause of the failure. - If you included a
webhookin thePOST Cancelrequest, you can also receive the transaction result through asynchronous notification. Similarly, you should use thecancel.statusfield to determine the transaction result, following the same method as in step 2.

