Order Payment
Interface Gateway
URL address:
https://pay.xxx.io/pay/unifiedorder
Tips
This interface is a test interface, please ask the sales person for it
Request Parameter
Parameter Name | Variable Name | Type | Required | Example | Comment |
---|---|---|---|---|---|
Merchant UID | mchid | string | TRUE | 100000 | Merchant UID |
Merchant User ID | userid | string | TRUE | U123456789 | Merchant User ID |
Merchant Trade No | out_trade_no | string | TRUE | 1.00966E+18 | Merchant Trade No |
Product Description | subject | string | TRUE | Demo | Product Description |
Product Info | body | string | TRUE | Demo | Product Info |
Pay Amount | amount | float | TRUE | 1000 | Total pay amount, two digits precision |
Pay Code | channel | string | TRUE | inpay_payout | (1) Payment: inpay_bankupi/vnpay_napas_vietqr (2) Payout: inpay_payout/vnpay_payout |
Extra Data | extparam | string | TRUE | If it is a payment request (channel is inpay_payout/vnpay_payout), then extparam needs to add userid bankname bankcode bankaccount accountname parameter, the parameter format is json | |
Currency Code | currency | string | TRUE | INR | Payment Currency: CNY, INR, VND |
Client IP | client_ip | string | TRUE | 127.0.0.1 | Client IP |
Callback URL | notify_url | string | FALSE | Asynchronous callback address: If it is empty or not passed, there will be no callback. | |
Return URL | return_url | string | FALSE | Synchronous redirect address: If it is empty or not passed, there will be no redirect. |
Example:
{
"amount": 15000,
"mchid": 100000,
"out_trade_no": "23092024181832904",
"subject": "pay_test",
"channel": "vnpay_napas_vietqr",
"return_url": "http://localhost:8001/demo.html",
"currency": "VND",
"client_ip": "127.0.0.1",
"body": "pay_test",
"notify_url": "http://localhost:8001/cashier/demonotify",
"userid": "U123456789"
}
Tips
extparam additional parameter description
- cashier_type: Not required. This parameter can specify the cashier payment method, 0 is not specified, 1 is quick click payment, 2 is QR code scanning payment, 3 is bank transfer payment
{
"cashier_type": 2,
}
Response Result
Result Name | Variable Name | Type | Required | Example | Comment |
---|---|---|---|---|---|
Result Code | result_code | string | TRUE | OK | Result Code. OK: Success, Other: Failure |
Return Message | result_msg | string | TRUE | SUCCESS | Prompt Information. SUCCESS: success |
Payload | charge | object | TRUE | Return the payment payload object (please see the specific data below) |
Success Example:
{
"result_code": "OK",
"result_msg": "SUCCESS",
"charge": {
"channel": "vnpay_napas_vietqr",
"out_trade_no": "23092024181832904",
"client_ip": "127.0.0.1",
"amount": "15000",
"currency": "VND",
"subject": "pay_test",
"body": "pay_test",
"extparam": [],
"credential": {
"order_amount": "15000",
"pay_amount": "15000",
"out_trade_no": "03e1afadd4dee63f69e111804b09d400",
"merch_name": "demo",
"pay_channel": "vnpay_napas_vietqr",
"viet_qr": "00020101021238540010A00000072701240006970422011042196868680208QRIBFTTA53037045405150005802VN62210817Transfer 03e1afad63042170",
"bank_name": "Ngân hàng TMCP Quân đội",
"bank_code": 970422,
"bank_account": "4219686868",
"account_name": "CTY TNHH MTV TM TOAN HUNG PHAT",
"cashier_url": "http://gopay.local/cashier/napas_vietqr/data/MTA3NjAwMg==",
"time": 1727087015,
"merchant_wallet": {
"uid": 100000,
"total_limit_credits": "-1000000000.00",
"total_security_deposit_credits": "0.00",
"total_unsettled_credits": "101356.33",
"total_hold_credits": "0.00",
"total_commission_credits": "229.47",
"total_available_credits": "-22728.13"
}
}
}
}
Error Example:
{
"error_msg": "Invalid Request.[ Request header [authentication] Failure.]",
"error_code": 400000
}
Tips
[success] This is the successful return information, only when result_code=OK and result_msg= SUCCESS in the returned JSON data can charge
- status is order business status:
- 0-closed
- 1-waiting
- 2-success
- 3-failure
- 4-paying
- 5-settled
- 6-refunded
- 7-dispute
[error] This is the error return information only have error_code and error_msg in the returned JSON data