Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.
HarmonyOS
Sends key refund event notifications to your server from the Payment Kit server upon successful completion of a user refund.
To ensure the reliability of callback requests, the system implements a retry mechanism. Therefore, the same notification may be resent.
To ensure information validity, you need to perform SM2-based signature verification on the returned payment information. Pay attention to the following during signature verification:
The refund status is determined by the refundOrderStatus field.
After a refund is successful, the Payment Kit server calls the callback API (specified by callbackUrl) passed by your app or atomic service in the refund request API to send the refund order details to you.
Protocol: HTTPS POST
Direction: Payment Kit server -> Your server
URL: Callback URL passed in the refund request API.
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: encryption - 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. |
| mercRefundNo | Yes | String | Merchant refund order number. |
| sysRefundNo | Yes | String | Refund order number in the Huawei Pay system. |
| refundAmount | Yes | Long | Total refund amount. Refund amount for an order, in cents. The value cannot be greater than the order amount. Note: If promotion coupons are used in a forward transaction, the refund amount includes the coupon amount. Huawei Pay determines the refund proportions of the coupon amount and the amount paid by the buyer based on the business rules. Refund is made according to the proportion by default. If this parameter is left empty, the full amount is refunded by default. |
| payerRefundAmount | Yes | Long | Amount refunded to the payer, in cents. |
| promotionRefundAmount | Yes | Long | Marketing refund amount, in cents. |
| currency | Yes | String | Transaction currency. The value can contain a maximum of 3 characters. The default value is CNY. Currently, only this currency is supported. |
| mercNo | No | String | Merchant number. |
| finishTime | No | String | Refund completion time, in UTC format (yyyy-MM-dd'T'HH:mm:ss.SSSZ). |
| refundOrderStatus | Yes | String | Refund status. - REFUND_CHL_PROC: processing - REFUND_SUCCESS: successful - REFUND_FAILED: failed |
| payload | No | String | Reserved information. If this parameter is passed in a merchant request, it will be returned as-is. |
- POST /hw/pay/callback HTTP/1.1
- Content-Type: application/json;charset=UTF-8
- {
- "callbackId": "124070308575300049145189***",
- "callbackTime": "2023-03-29 09:52:37",
- "currency": "CNY",
- "dataType": "plain",
- "finishTime": "2023-02-23T10:05:17.000+0800",
- "mercNo": "10132120***",
- "mercRefundNo": "czl00120240705***",
- "payerRefundAmount": 100,
- "payload": "example-payload",
- "promotionRefundAmount": 10,
- "refundAmount": 100,
- "refundOrderStatus": "REFUND_SUCCESS",
- "sign": "MEYCIQD8RlHJ9tGmc2*******************GYpU7nDIJCYHcZpBY1ffr21wgjQ2l",
- "signType": "SM2",
- "certNo": "120291744647139***",
- "sysRefundNo": "1230223100511858780002***"
- }
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, and other values indicate failure. If the return value format is invalid or the return value is not 000000, the callback fails. |
| resultDesc | Yes | String | Result description. |
- HTTP/1.1 200 OK
- Content-Type: application/json; charset=UTF-8
- {
- "resultCode": "000000",
- "resultDesc": "Success."
- }
Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
Quick start
Helps you find desired resources with ease.