Unified Order
Merchant’s backend calls this API to create an advance transaction in the Trusty payment service backend, and initiates the payment process via payment by appUrl.
1. Place an order:
Submit a pre-order request for payment by scanning code through this interface. If payments made on websites, physical stores, media advertising, or other scenarios. obtain the appUrl corresponding to the QR code. The merchant's background system will generate the QR code image based on the appUrl value, and the user will initiate payment after scanning the code with Trusty App. If in Merchant’s App, Open appUrl directly. Customer will be redirected to the Trusty App for payment.
2. Query:
The merchant is required to take the initiative to check the order status after placing an order for a certain period of time. If the notifyUrl notification address is configured, the payment result will be notified to the merchant backend interface through the HTTP protocol after the customer makes a successful payment.Then modify the order status. If you do not have a notification API or have not received the payment result, you can use the query API to query the payment result.
Notes:
-
If not set a timeout period, the order will be canceled after 30 minutes by default, and if you set a notification address, you will be notified that the order has been canceled
API Description: Unified Order API
Request URL:/openapi/v1/trusty/unifiedorder
Request Method:POST
consumes:["application/json"]
produces:["*/*"]
Request Parameter:
Field Name | Description | Required | Type | Length |
---|---|---|---|---|
app_id | Public Parameter | true | string | 64 |
mchnt_id | Public Parameter | true | string | 32 |
nonce_str | Public Parameter | true | string | 64 |
sign | Public Parameter | true | string | 128 |
sign_type | Public Parameter | true | string | 12 |
tradeNo |
The unique No. of the payment transaction which is provided by merchant. |
true | string | 32 |
attach | attach data: merchants can define the data by self. | false | string | 500 |
body | Product name or payment brief description | true | string | 128 |
detail | Detail information of products | false | string | 128 |
deviceInfo |
Device No.[Define by the merchant, example: the store NO.] |
false | string | 128 |
notifyUrl | The callback address to receive Trusty Pay result notifications asynchronously. The notification URL must be accessible by external networks, and is not allowed to carry any parameters. Use the HTTPS protocol URL. Example: https://www.trusty-pay.com/trustypay/pay. | false | string | 128 |
frontendUrl | Specifies the callback address for receiving Trusty payment notifications.Format:your_app_scheme://your_app_host Example: merchant-app://trustypay/payresult. Create Deep Links to App Content: https://developer.android.com/training/app-links/deep-linking?hl=en |
false | string | 128 |
spbillCreateIp | IP address of terminal | false | string | 64 |
timeExpire | Set the timeout period to set the number of minutes after which the order will be automatically cancelled. Default: 30 minutes | false | string | 5 |
totalAmount | amount,For example: 1 MMK Format:100 | true | String | 20 |
tradeType |
[ [Reference to the appendix] Trade type] Set to NATIVE, or APP |
false | string | 12 |
trnCcy | Currency [Reference to the appendix] | true | string | 12 |
version | Fixed value: 1.0 Example:1.0 | false | string | 12 |
Request Sample:
{
"app_id": "121775250444445490",
"mchnt_id": "1000",
"nonce_str": "121775250444445490",
"sign": "xxxxxx",
"sign_type": "MD5",
"attach": "attach data: merchants can define the data by self.,XXX",
"body": "Ipadmini16G white",
"detail": "",
"deviceInfo": "013467007045764",
"notifyUrl": "http://www.google.com/",
"frontendUrl":"your_app_scheme://your_app_host",
"tradeNo": "P8888888888",
"spbillCreateIp": "127.0.0.1",
"timeExpire": "30",
"totalAmount": "10000",
"tradeType": "NATIVE",
"trnCcy": "MMK",
"version": "1.0"
}
Response Parameter:
Field Name | Description | Required | Type | Length |
---|---|---|---|---|
app_id | Public Parameter | true | string | 64 |
mchnt_id | Public Parameter | true | string | 32 |
nonce_str | Public Parameter | true | string | 64 |
sign | Public Parameter | true | string | 128 |
sign_type | Public Parameter | true | string | 12 |
return_code | Public Parameter | true | string | 32 |
return_msg | Public Parameter | true | string | 128 |
tradeNo |
The unique No. of the payment transaction which is provided by merchant. |
true | string | 32 |
applyNo |
Specifies the advance transaction ID created by Trusty. It is used to call the Trusty Payment API later. Example: ty2021102720093950. |
true | string | 32 |
tradeType |
The transaction type submitted. The value could be NATIVE, or APP. Example: APP |
true | string | 12 |
appUrl | The URL of opening the Trusty APP. | true | string | 128 |
Response Sample:
xxxxxxxxxx
{
"mchnt_id": "1003",
"app_id": "vth8f3uvb5d8devq",
"nonce_str": "ZvKdOf4civQ6NHZhI3cZyoCGUuOUjdyb",
"sign": "A18EB41E3E92B361A12241D1F16B0966",
"return_code": "SUCCESS",
"return_msg": "",
"body": "Ipadmini256G",
"applyNo": "9c622f92364d48f484de2fc215a4b5d3",
"tradeNo": "P888888888888121221",
"appUrl": "jl-app://customer/TrustyPayUAT?ordId=9c622f92364d48f484de2fc215a4b5d3",
"tradeType": "NATIVE"
}
Return Code
code | Description |
---|---|
SUCCESS | Processed successfully |
PARAM_ERROR | Parameter error. |
MERCHANT_NOT_EXIST | Merchant does not exist. |
SIGN_ERROR | Incorrect signature result. |
ORDER_ALREADY_EXIST | Order already exists. |
SYSTEM_ERROR | System error. |
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 |