API REFERENCE
Quick Payment
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| data.pay_method | string | offline | ✓ |
| data.sub_pay_method | string | WeChat Pay,Alipay,UnionPay QRcode,通过接口[获取sub pay method](/yabandpay/docs/v3-cn/payments/simplepay/subpaymethod) 获取。**如果为空(推荐),将由YabandPay来做支付方式判断。** | — |
| data.order_id | string | Merchant order ID | ✓ |
| data.amount | string | Amount as a numeric string. For example, enter 24.99 for € 24.99. CNY amount >=1; EUR amount >=0.1. | ✓ |
| data.tip_amount | string | Tip included in the total amount, as a numeric string; for example 1.02 | — |
| data.currency | string | ISO 4217 currency code, for example EUR or CHF | ✓ |
| data.demo | string | Custom field | — |
| data.auth_code | string | Authorization code from the WeChat Pay or Alipay+ wallet | ✓ |
| data.description | string | Order description | ✓ |
| data.notify_url | string | Asynchronous notification URL after payment | — |
For in-store payments, supporting WeChat Pay and Alipay+.
| Field | Type | Description | Required |
|---|---|---|---|
| user | String | Cashier account UID | Required |
| sign | String | Signature | Required |
| method | String | v3.BarcodePayment | Required |
| time | Long | Timestamp | Required |
- Parameters
| Field | Type | Description | Required |
|---|---|---|---|
| pay_method | String | offline | Required |
| sub_pay_method | String | WeChat Pay,Alipay,UnionPay QRcode. Obtain it through Get sub pay method. If left empty (recommended), YabandPay identifies the payment method. | Optional |
| order_id | String | Merchant order ID | Required |
| amount | String | Amount as a numeric string. For example, enter 24.99 for € 24.99. CNY amount >=1; EUR amount >=0.1. | Required |
| tip_amount | String | Tip included in the total amount, as a numeric string; for example 1.02 | Optional |
| currency | String | ISO 4217 currency code, for example EUR or CHF | Required |
| demo | String | Custom field | Optional |
| auth_code | String | Authorization code from the WeChat Pay or Alipay+ wallet | Required |
| description | String | Order description | Required |
| notify_url | String | Asynchronous notification URL after payment | Optional |
Signature example:
Sorted parameters concatenated into a URL-style query string
"amount=2.1&auth_code=134443133735495918¤cy=EUR&demo=test&description=YabandPay test&method=v3.BarcodePayment¬ify_url=https://www.yabandpay.com/notify&order_id=202488465489451317&pay_method=offline&sub_pay_method=WeChat Pay&time=1555499083&tip_amount=0.5&user=YOUR_CASHIER_UID"
Sign stringA using secret_key
The resulting signature is:
"YOUR_SIGNATURE"
Request example:
{
"user": "YOUR_CASHIER_UID",
"sign": "YOUR_SIGNATURE",
"method": "v3.BarcodePayment",
"time": 1555499083,
"data": {
"amount": "2.1",
"tip_amount": "0.5",
"auth_code": "YOUR_AUTH_CODE",
"currency": "EUR",
"demo": "test",
"description": "YabandPay test",
"notify_url": "https://www.yabandpay.com/notify",
"order_id": "YOUR_ORDER_ID",
"pay_method": "offline",
"sub_pay_method": "WeChat Pay"
}
}
Response example:
{
"status": true,
"code": "200",
"data": {
"order_id": "YOUR_ORDER_ID",
"trade_id": "511444d0-2d91-5396-9e34-f2900e80d715",
"amount": "2.1",
"tip_amount": "0.5",
"sub_pay_method": "WeChat Pay",
"state": "paid"
},
"message": ""}
Additional information:
Response result:
Tip
- If the customer does not need to enter a password, the payment result is returned synchronously.
- If the customer needs to enter a password after the code is scanned, the payment result is state: processing. The merchant must poll Query Order every 5 seconds to determine the actual payment result.
- If the customer cancels or has not paid within 30 seconds, we recommend exiting the query loop and calling Cancel Payment to reverse the payment transaction. If the customer has already paid, the system automatically issues a refund.
Response codes:
| Status | Code | Message |
|---|---|---|
| true | 200 | Success |
| false | -1000 | Internal error |
| false | -1007 | Identity code is invalid |
| false | -4011 | Not support the payment method |
| false | -4015 | This order has been closed |
| false | -4028 | WeChat Pay is not available |
| false | -4029 | Alipay is not available |
| false | -4086 | Unknow identity code |
