API REFERENCE
Paiement par code QR
Paramètres
| Parameter | Type | Description | Obligatoire |
|---|---|---|---|
| data.pay_method | string | offline | ✓ |
| data.sub_pay_method | string | QRcode | ✓ |
| data.order_id | string | 商户的订单ID | ✓ |
| 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.description | string | 订单描述 | ✓ |
| data.demo | string | 自定义字段 | — |
| data.timeout | string | 过期时间单位分钟(0-1440) | ✓ |
| data.redirect_url | string | 支付完成后跳转地址 | — |
| data.notify_url | string | 支付完成后异步通知地址 | ✓ |
S’applique aux paiements en magasin
Conseil
Display the returned url (or a QR code generated from the url) and the icons of the available payment methods to the customer.
| Paramètre | Type | Description | Obligatoire |
|---|---|---|---|
| user | String | Cashier account UID | Obligatoire |
| sign | String | Signature | Obligatoire |
| method | String | v3.QRcodePayment | Obligatoire |
| time | Long | Timestamp | Obligatoire |
- Parameters
| Paramètre | Type | Description | Obligatoire |
|---|---|---|---|
| pay_method | String | offline | Obligatoire |
| sub_pay_method | String | QRcode | Obligatoire |
| order_id | String | Merchant order ID | Obligatoire |
| amount | String | Amount as a numeric string. For example, enter 24.99 for € 24.99. CNY amount >=1; EUR amount >=0.1. | Obligatoire |
| tip_amount | String | Tip included in the total amount, as a numeric string; for example 1.02 | Facultatif |
| currency | String | ISO 4217 currency code, for example EUR or CHF | Obligatoire |
| description | String | Order description | Obligatoire |
| demo | String | Custom field | Facultatif |
| timeout | String | Expiration time in minutes (0-1440) | Obligatoire |
| redirect_url | String | Redirect URL after payment | Facultatif |
| notify_url | String | Asynchronous notification URL after payment | Obligatoire |
Signature example:
Sorted parameters concatenated into a URL-style query string
"amount=12.1¤cy=EUR&demo=test&description=YabandPay test&method=v3.QRcodePayment¬ify_url=https://www.yabandpay.com/notify&order_id=202486556498441613&pay_method=offline&redirect_url=https://www.yabandpay.com&sub_pay_method=QRcode&time=1555498137&timeout=0&tip_amount=0.5&user=YOUR_CASHIER_UID"
Sign stringA using secret_key
Le champ resulting signature is:
"YOUR_SIGNATURE"
Exemple de requête:
{
"user": "YOUR_CASHIER_UID",
"sign": "YOUR_SIGNATURE",
"method": "v3.QRcodePayment",
"time": 1555498137,
"data": {
"amount": "12.1",
"currency": "EUR",
"tip_amount": "0.5",
"demo": "test",
"description": "YabandPay test",
"notify_url": "https://www.yabandpay.com/notify",
"order_id": "YOUR_ORDER_ID",
"pay_method": "offline",
"redirect_url": "https://www.yabandpay.com",
"sub_pay_method": "QRcode",
"timeout": "0"
}
}
Exemple de réponse:
{
"status": true,
"code": "200",
"data": {
"order_id": "YOUR_ORDER_ID",
"trade_id": "4552eeea-1ae8-1e40-3b4b-802dc2f5686a",
"amount": "12",
"currency": "EUR",
"tip_amount": "0.5",
"url": "https://pay.yabandpay.com/payments/selectpay/order/ODlmYmYyMzQtN2U1Yy00ZDI5LTM5NWMtNGI4NzljYjI4MDlj",
"available_payment_methods": "Alipay+, Wechat Pay, iDEAL, UnionPay, QuickPass, Bancontact, Visa, Mastercard, ApplePay, GooglePay",
"state": "processing"
},
"message": ""}
Informations complémentaires:
Résultat de la réponse:
-
Une requête réussie renvoie "status": true.
-
Une requête échouée renvoie "status": false.
Nous recommandons vivement d’utiliser à la fois Query Order and Asynchronous Notifications afin de maintenir les statuts de paiement exacts et à jour.
Response codes:
| Status | Code | Message |
|---|---|---|
| true | 200 | Success |
| false | -1000 | Internal error |
| false | -3001 | Required field is missing |
| false | -403 | The signature Error |
| false | -4011 | Not support the payment method |
