Skip to content

Pre-authorization

Pre-authorization

You can initiate a pre-authorization transaction by setting the value of autoCapture to false in the POST Payment request. Subsequently, you can complete the pre-authorization based on the actual transaction amount from the consumer by making a POST Capture request. Please note that EVO Cloud only supports completing the pre-authorization for amounts less than or equal to the pre-authorization amount.

  1. When calling the Payment interface, you need to include, but are not limited to, the following parameters. For field details, refer to the API documentation:
    • autoCapture: Fixed value false, indicating pre-authorization.
    • paymentMethod.type: Indicates the payment method; use card for card transactions.
    • paymentMethod.card: A structure containing consumer card information and terminal details, required when paymentMethod.type is card.
    • transAmount: A structure containing the transaction amount and currency.
    • merchantTransInfo: A structure containing the merchant order number.
    • pspInfo: A structure containing card organization qualification information.
Pre-Authorization Sample
js
curl 'https://hkg-online-uat.everonet.com/g2/v0/payment/acq/10130014/evo.offline.payment' \
-H 'Authorization: ce7bfb5b8e015954ea2f64f99e4973520ddb40d098ce3c76c946338663b95906' \
-H 'DateTime: 20240306115720+0800' \
-H 'SignType: SHA256' \
-H 'Content-Type: application/json' \
-H 'MsgID: M20240306115720557' \
-d '{
    "merchantTransInfo": {
        "merchantTransID": "T20240306115720557",
        "merchantTransTime": "2024-03-06T11:57:20+08:00"
    },
    "paymentMethod": {
        "type": "card",
        "card": {
            "posEntryMode":"manual",
            "pinFlag":false,
            "termReadability":"5",
            "cardInfo": {
                "cardNumber": "4761340000000043"
            }
        }
    },
    "transAmount": {
        "currency":"HKD",
        "value":"1.00"
    },
    "autoCapture": false,
    "pspInfo": {
        "mcc": "5499",
        "sponsorCode": "441378",
        "merchantID": "202106305812001",
        "terminalID":"00000001",
        "merchantName": "Test",
        "storeID": "202106305812001",
        "storeName": "Test Store",
        "street": "Test street",
        "city": "MYS",
        "postCode": "202000",
        "nation": "MYS"
    }
}'
  1. Check the payment.status field in the EVO Cloud response. If the value is Authorised, the transaction was successful; otherwise, check result.code and result.message for the reason for the transaction failure.

  2. If you do not receive a response message from EVO Cloud, you need to call GET Payment to query the transaction result. Upon receiving the query response, evaluate the transaction result using the payment.status field as in step 2. If the transaction failed, refer to payment.failureCode and payment.failureReason for details on the failure.

  3. If you included a webhook in your POST Payment request, you can also obtain the transaction result through asynchronous notification. Again, assess the transaction result using the payment.status field as in step 2.

  4. Present the payment result to the consumer.