API REFERENCE
Paiements natifs
Paramètres
| Parameter | Type | Description | Obligatoire |
|---|---|---|---|
| data.order_id | string | 商户的订单ID | ✓ |
| data.url_type | string | 默认01, 01:返回的url直接跳转到YabandPay托管页面 ;02:微信原生的二维码URL | — |
| data.amount | string | 金额数字。例如 € 24.99 应该写成24.99,CNY金额>=1,欧元金额>=0.1 | ✓ |
| data.currency | string | 货币代码,ISO 4217,例如EUR,CHF | ✓ |
| data.description | string | 订单描述 | ✓ |
| data.demo | string | 自定义字段 | — |
| data.timeout | string | 过期时间单位分钟(0-1440) | ✓ |
| data.notify_url | string | 支付完成后异步通知地址 | ✓ |
| data.redirect_url | string | 支付完成后跳转地址 | — |
| Paramètre | Type | Description | Obligatoire |
|---|---|---|---|
| user | String | Compte marchand UID | Obligatoire |
| sign | String | Signature | Obligatoire |
| method | String | v3.CreateWechatNativePay | Obligatoire |
| time | Long | Timestamp | Obligatoire |
- Parameters | Paramètre | Type | Description | Obligatoire | |:--- |:--- |:--- |:--- | | order_id | String | ID de commande du marchand | Obligatoire | | url_type | String | Valeur par défaut : 01. 01 : l’URL renvoyée redirige directement vers la page hébergée par YabandPay ; 02 : URL du code QR WeChat natif | Facultatif | | amount | String | Montant au format chaîne numérique. Par exemple, saisissez 24.99 for € 24.99. montant en CNY ≥1; montant en EUR ≥0.1. | Obligatoire | | currency | String | code devise ISO 4217, par exemple EUR ou CHF | Obligatoire | | description | String | Description de la commande | Obligatoire | | demo | String | Champ personnalisé | Facultatif | | timeout | String | Durée d’expiration en minutes (0-1440) | Obligatoire | | notify_url | String | URL de notification asynchrone après le paiement | Obligatoire | | redirect_url | String | URL de redirection après le paiement | Facultatif |
Exemple de signature:
Paramètres triés et concaténés sous forme de chaîne de requête au format URL
"amount=1¤cy=EUR&description=yaband test&method=v3.CreateWechatNativePay¬ify_url=https://www.yabandpay.com/notify&order_id=2024821984761654842&redirect_url=https://www.yabandpay.com&time=1568553105&timeout=0&user=h5@yaband.com"
Signez la chaîne A à l’aide de secret_key
La signature obtenue est :
"YOUR_SIGNATURE"
Exemple de requête:
{
"user": "YOUR_CASHIER_UID",
"sign": "YOUR_SIGNATURE",
"method": "v3.CreateWechatNativePay",
"time": 1568553105,
"data": {
"url_type": "01",
"order_id": "YOUR_ORDER_ID",
"amount": "1",
"currency": "EUR",
"timeout": "0",
"description": "yaband test",
"redirect_url": "https://www.yabandpay.com",
"notify_url": "https://www.yabandpay.com/notify"
}
}
Exemple de réponse:
{
"status": true,
"code": "200",
"data": {
"order_id": "YOUR_ORDER_ID",
"trade_id": "289c6441-056e-676e-80e6-672651911070",
"amount": "1.00",
"currency": "EUR",
"url": "https://pay.yabandpay.com/payments/wechat_native_callback/order/Mjg5YzY0NDEtMDU2ZS02NzZlLTgwZTYtNjcyNjUxOTExMDcw",
"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 Consulter la commande and Asynchronous Notifications afin de maintenir les statuts de paiement exacts et à jour.
Codes de réponse:
| 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 |
