Skip to content

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:

  1. When initiating a payment cancel or pre-authorization cancel, you need to use the merchantTransInfo.merchantTransID that you provided when calling the POST Payment interface. You should include this parameter in the POST Cancel request URL so that EVO Cloud 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"
            }
        }
    }
}'
  1. Check the cancel.status field in the EVO Cloud response. If the value of this field is Success, it means the cancel was successful. Otherwise, you need to review the result.code and result.message to determine the reason for the transaction failure.
  2. If you do not receive a response from EVO Cloud, you should call GET Cancel to query the transaction result. When you receive the query response, you should also check the cancel.status field to determine the transaction result, using the same method as in step 2. If the transaction failed, review the cancel.failureCode and cancel.failureReason to determine the cause of the failure.
  3. If you included a webhook in the POST Cancel request, you can also receive the transaction result through asynchronous notification. Similarly, you should use the cancel.status field to determine the transaction result, following the same method as in step 2.