API REFERENCE
Pago rápido
Parámetros
| Parameter | Type | Descripción | Obligatorio |
|---|---|---|---|
| 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 | 商户订单号 | ✓ |
| data.amount | string | 金额数字。例如 € 24.99 应该写成24.99,CNY金额>=1,欧元金额>=0.1 | ✓ |
| data.tip_amount | string | 总金额中包含的小费,金额数字。例如 1.02 | — |
| data.currency | string | 货币代码,ISO 4217,例如EUR,CHF | ✓ |
| data.demo | string | 自定义字段 | — |
| data.auth_code | string | 微信支付或者支付宝+钱包的授权码 | ✓ |
| data.description | string | 订单描述 | ✓ |
| data.notify_url | string | 支付完成后异步通知地址 | — |
Para pagos en tienda, compatible con WeChat Pay y Alipay+.
| Campo | Tipo | Descripción | Obligatorio |
|---|---|---|---|
| user | String | Cashier account UID | Obligatorio |
| sign | String | Signature | Obligatorio |
| method | String | v3.BarcodePayment | Obligatorio |
| time | Long | Timestamp | Obligatorio |
- Parameters
| Campo | Tipo | Descripción | Obligatorio |
|---|---|---|---|
| pay_method | String | offline | Obligatorio |
| sub_pay_method | String | WeChat Pay,Alipay,UnionPay QRcode. Obtain it through Obtener el submétodo de pago. If left empty (recommended), YabandPay identifies the payment method. | Opcional |
| order_id | String | Merchant order ID | Obligatorio |
| amount | String | Amount as a numeric string. For example, enter 24.99 for € 24.99. CNY amount >=1; EUR amount >=0.1. | Obligatorio |
| tip_amount | String | Tip included in the total amount, as a numeric string; for example 1.02 | Opcional |
| currency | String | ISO 4217 currency code, for example EUR or CHF | Obligatorio |
| demo | String | Custom field | Opcional |
| auth_code | String | Authorization code from the WeChat Pay or Alipay+ wallet | Obligatorio |
| description | String | Order description | Obligatorio |
| notify_url | String | Asynchronous notification URL after payment | Opcional |
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:
Consejo
- 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 |
