API REFERENCE
Snelle betaling
Parameters
| Parameter | Type | Beschrijving | Verplicht |
|---|---|---|---|
| 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 | 支付完成后异步通知地址 | — |
Voor betalingen in winkels, met ondersteuning voor WeChat Pay en Alipay+
| Veld | Type | Beschrijving | Verplicht |
|---|---|---|---|
| user | String | Kassiersaccount UID | Verplicht |
| sign | String | Signature | Verplicht |
| method | String | v3.BarcodePayment | Verplicht |
| time | Long | Timestamp | Verplicht |
- Parameters
| Veld | Type | Beschrijving | Verplicht |
|---|---|---|---|
| pay_method | String | offline | Verplicht |
| sub_pay_method | String | WeChat Pay, Alipay, UnionPay QRcode. Haal dit op via Get sub pay method. Als u dit veld leeg laat (aanbevolen), bepaalt YabandPay de betaalmethode. | Optioneel |
| order_id | String | Bestel-ID van de handelaar | Verplicht |
| amount | String | Bedrag als numerieke tekenreeks. Voer bijvoorbeeld 24.99 in voor € 24.99. Het CNY-bedrag moet >=1 zijn; het EUR-bedrag >=0.1. | Verplicht |
| tip_amount | String | Fooi inbegrepen in het totaalbedrag, als numerieke tekenreeks; bijvoorbeeld 1.02 | Optioneel |
| currency | String | ISO 4217 currency code, for example EUR or CHF | Verplicht |
| demo | String | Custom field | Optioneel |
| auth_code | String | Authorization code from the WeChat Pay or Alipay+ wallet | Verplicht |
| description | String | Order description | Verplicht |
| notify_url | String | Asynchronous notification URL after payment | Optioneel |
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
- Als de klant geen wachtwoord hoeft in te voeren, wordt het betalingsresultaat synchroon geretourneerd.
- Als de klant na het scannen van de code een wachtwoord moet invoeren, is het betalingsresultaat state: processing. De handelaar moet Query Order elke 5 seconden opvragen om het werkelijke betalingsresultaat vast te stellen.
- Als de klant annuleert of niet binnen 30 seconden heeft betaald, raden we aan de opvraaglus te beëindigen en Cancel Payment aan te roepen om de betaling ongedaan te maken. Als de klant al heeft betaald, voert het systeem automatisch een terugbetaling uit.
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 |
