Sends key withholding event notifications to your server from the Huawei Pay server after PIN-free payment is complete.
To ensure the reliability of callback requests, the system implements a retry mechanism. Therefore, the same notification may be resent.
The order status is determined by the orderStatus field.
After a withholding order is successfully completed, Huawei Pay server calls the callback API (callbackUrl) transferred by you in the API for applying for PIN-free withholding to send the detailed information about the order to you.
Protocol: HTTPS POST
Direction: Payment Kit server -> Your server
URL: callbackUrl transferred when you request the API for applying for PIN-free withholding.
Data format:
Request: Content-Type: application/json; charset=UTF-8
Response: Content-Type: application/json; charset=UTF-8
Request Body
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| callbackId | Yes | String | Unique ID of a callback notification. |
| callbackTime | Yes | String | Time when a callback notification is sent. The format is yyyy-MM-dd HH:mm:ss. |
| dataType | Yes | String | Data encryption type. - encrypt: encrypted - plain: plaintext |
| sign | Yes | String | Signature of the callback notification result. All fields except the sign field are involved in signing. You can perform signature verification on the callback packet by referring to Signature Verification Rules. |
| signType | Yes | String | Signature type. Algorithm used to generate the signature string. Currently, the SM2 algorithm is used. |
| certNo | No | String | Certificate number used for signing. |
| mercNo | Yes | String | Merchant number. |
| appId | Yes | String | App ID. |
| sysTransOrderNo | Yes | String | Transaction order number in the Huawei Pay system. |
| mercOrderNo | Yes | String | Merchant order number, which is generated by the merchant and must be unique. The value contains a maximum of 46 characters. |
| orderStatus | Yes | String | Order status. - TRX_SUCCESS: The transaction is successful. - TRX_FAILED: The transaction failed. |
| payload | No | String | Reserved information. If this parameter is passed in a merchant request, it will be returned as-is. |
| currency | Yes | String | Transaction currency. The value contains a maximum of 3 characters. The default value is CNY. Currently, only this currency is supported. |
| totalAmount | Yes | Long | Total order amount, in cents. |
| payerAmount | Yes | Long | Actual amount paid by the buyer, in cents. |
| promotionAmount | Yes | Long | Promotion amount, in cents. |
| finishTime | No | String | Payment completion time, in UTC format (yyyy-MM-dd'T'HH:mm:ss.SSSZ). |
| paymentTools | No | String | Payment tools. - WECHAT_MICROPAY: WeChat Pay connected through Huawei Pay - AGMT: payment using a debit or credit card based on an agreement - ACCT: account balance - HUAWEIPAY: Huawei Pay |
| promotionDetail | No | List<PromotionItem> | Promotion information. Note: This parameter value is returned only when a user participates in promotion activities during payment. |
| payer | No | PayerOut | Payer information shown on the client during payment. |
POST /hw/pay/callback HTTP/1.1
Content-Type: application/json;charset=UTF-8
{
"callbackId": "124070308575300049145189***",
"callbackTime": "2023-03-29 09:29:14",
"currency": "CNY",
"dataType": "plain",
"finishTime": "2023-02-23T10:02:04.000+0800",
"mercOrderNo": "czl00120240705***",
"appId": "5765880207853***",
"mercNo": "10132120***",
"orderStatus": "TRX_SUCCESS",
"payerAmount": 10000,
"payload": "example-payload",
"paymentTools": "AGMT",
"promotionAmount": 0,
"sign": "MEYCIQDXutp78*******************VlWyjA6p210xOqI2InX9w2SIYRx",
"signType": "SM2",
"certNo": "120291744647139***",
"sysTransOrderNo": "12407030857530004914518***",
"totalAmount": 10000
} Response Header
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| Content-Type | Yes | String | The value is application/json; charset=UTF-8. |
Response Body
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| resultCode | Yes | String | Result code. Huawei Pay parses the response of the application/json type. The value 000000 indicates success. If the return value format is invalid or the return value is not 000000, the callback fails. |
| resultDesc | Yes | String | Result description. |