Notification API
After completing pay or refund, the Trusty payment system will send the refund result to the Merchant.
Notes:
1. The same notification may be sent to the merchant system for multiple times. The merchant system must be able to process repeated notifications properly. It is recommended that when a notification is received and processed, check the status of the corresponding business data first, and then analyze whether it is processed. If not, then process it; if yes, return the processed result. Before the status check and process of business data, perform concurrent control of these data with data locks to avoid data corruption caused by reentrant functions.
2. If the Trusty pay callback is not received after all notification frequencies (5 minute), the merchant need to call the 【Query Order API】to confirm the order status.
Note: The merchant system must perform signature verification for the payment or refund result notification, and verify whether the returned refund amount is consistent with that on the merchant side to prevent any possible capital loss caused by "false notifications" due to data leakage.
Request URL: The URL is set by the parameter notify_url submitted in 【Unified Order】and the https protocol is required. If the URL cannot be accessed, the merchant will not receive any Trusty notifications. The URL must be directly accessible without any parameters. For example: notify_url: http://openapi.merchart.com/trusty/callback
After the payment or refund status changes, Trusty will send the refund results to the merchant.
When notifying the interaction to the backend, if the response received by Trusty is unsuccessful or timeout,Trusty will no longer be notified. the merchant need to call the 【Query Order API】to confirm the order status.
For payment or refund result notifications, access the notification URL set up by the merchant with the `POST` method, and the notification data is transmitted through the request body (BODY) in the `JSON` format. The notification data contains the details of the encrypted payment or refund result.
The procedure of how to decrypt the notification data is described as follows:
- Obtain the merchant's notification key from the merchant platform, and record it as `key`.
- Obtain the corresponding parameters `sign_type` for the algorithm described in `sign_type` ( `MD5` or `HMACSHA256`).
- Encrypt the received request parameters sort non-empty values not included[app_id,mchnt_id,nonce_str,sign,sign_type]. Please refer to the 【API Rule】 for the encryption method.
- Compare the sign in the return parameter
Backend Callback API(Provide by merchant)
API Description: Call back API(Provide by merchant)
Request URL:Call back URL
Request Method:POST
consumes:["application/json"]
Request Sample:
xxxxxxxxxx
{
"app_id": "121775250444445490",
"sign": "xxxxxx",
"sign_type": "MD5",
"nonce_str": "121775250444445490",
"mchnt_id": "1000",
"actualAmt": 888,
"openId": "P0000232000",
"attach": "",
"body": "xxxx",
"channel": "mpupay",
"currency": "MMK",
"detail": "",
"deviceInfo": "",
"payMsg": "",
"payStartDate": "",
"payStatus": "PAY_SUCCESS",
"refundDate": "",
"refundNo": "",
"refundType": "",
"spbillCreateIp": "",
"timeExpire": "",
"orderAmt": 888,
"tradeNo": "",
"tradeType": ""
}
Request Parameter:
Field Name | Description | Type | Length |
---|---|---|---|
applyNo | Payment authorization request number | string | 32 |
openId | Unique user ID under the merchant | string | 32 |
actualAmt | Actual amount ,For example: 1 MMK Format:100 | string | 11 |
attach | attach data: merchants can define the data by self. | string | 256 |
body | Product name or payment brief description | string | 128 |
channel | Payment Channel | string | 8 |
currency | Currency ,MMK | string | 8 |
detail | Detail information of the product | string | |
deviceInfo | Device No. | string | 32 |
payEndDate | Payment End Time yyyy/MM/dd HH:mm:ss | string | |
payMsg | Payment Return Message | string | 128 |
payStartDate | Payment Start Time : yyyy/MM/dd HH:mm:ss | string | |
payStatus |
Payment status [Reference to the appendix - payment status] |
string | 128 |
refundDate | Refund time : yyyy/MM/dd HH:mm:ss | string | |
createDate | Create Date : yyyy/MM/dd HH:mm:ss | string | |
modifyDate | modify Date: yyyy/MM/dd HH:mm:ss | string | |
refundNo | Refund No. | string | 32 |
timeExpire | timeExpire | string | 5 |
orderAmt | Order amount , For example: 1 MMK Format:100 |
string | 20 |
tradeNo | Trade number. | string | 32 |
tradeType | [Reference to the appendix - Trade Type] | string | 12 |
errCode | If payStatus is PAY_FAIL ,[Reference to the appendix - ErrCode] |
string | 12 |
Response Status:
Status Code | Description | schema |
---|---|---|
200 | OK |
Appendix
Payment Status:
Status | Description |
---|---|
PAY_APPLY | Payment apply |
PAY_PROCESSING | Payment processing |
PAY_SUCCESS | Payment succeeded |
PAY_FAIL | Payment failed |
REVERSE_PROCESSING | Reverse processing |
REVERSE_SUCCESS | Reverse succeeded |
REVERSE_FAIL | Reverse failed |
REFUND_PROCESSING | Refund processing |
REFUND_SUCCESS | Refund succeeded |
REFUND_FAIL | Refund failed |
Currency :
Currency | Description |
---|---|
MMK | Myanmar currency Code |
Trade Type
Trade Type | Description |
---|---|
NATIVE | NATIVE |
APP | APP |
Settlement Status
Status | Description |
---|---|
S01 | pending settlement |
S02 | settlement processing |
S03 | settlement finish |
ErrCode
Code | Description |
---|---|
AAPDPE0022 | Transaction amount can not exceed available balance. |
AABXME3000 | System error occured. |
CAPPDE0006 | Over Trusty Daily Point Using Limit Amount. |
AAPARE0099 | This account is blocked for request service. |
AAPARE0215 | The password is locked |
AAPARE0573 | The transaction password is invalid. |
AAPCME0006 | please check Input value. |
CAPDPE0033 | Fixed Account are not in business Time |
CAPDPE0042 | Order information does not exist |