API REFERENCE
Capture d’autorisation
Paramètres
| Parameter | Type | Description | Obligatoire |
|---|---|---|---|
| data.trade_id | string | 对应预授权的trade_id | ✓ |
| data.amount | string | 金额数字。例如 € 24.99 应该写成24.99 | ✓ |
| data.currency | string | 货币代码,ISO 4217,例如EUR,CHF | ✓ |
| data.description | string | 订单描述 | ✓ |
| data.notify_url | string | 支付完成后异步通知地址 | ✓ |
| data.request_id | string | 请求id需保持唯一,建议24以上位数字+字母 | ✓ |
S’applique à la capture après autorisation
Capturez la commande après l’autorisation réussie. La capture doit avoir lieu dans un délai de 30 jours après la fin de l’autorisation ; passé ce délai, l’autorisation expire automatiquement.
La devise de capture doit correspondre à celle de l’autorisation, et le montant ne doit pas dépasser le montant initialement autorisé.
Une seule capture est acceptée par transaction autorisée. Les captures multiples ne sont pas prises en charge.
| Paramètre | Type | Description | Obligatoire |
|---|---|---|---|
| user | String | Cashier account UID | Obligatoire |
| sign | String | Signature | Obligatoire |
| method | String | v3.Capture | Obligatoire |
| time | Long | Timestamp | Obligatoire |
- Parameters
| Paramètre | Type | Description | Obligatoire |
|---|---|---|---|
| trade_id | String | trade_id of the authorization | Obligatoire |
| amount | String | Amount as a numeric string. For example, enter 24.99 for € 24.99. | Obligatoire |
| currency | String | ISO 4217 currency code, for example EUR or CHF | Obligatoire |
| description | String | Order description | Obligatoire |
| notify_url | String | Asynchronous notification URL after payment | Obligatoire |
| request_id | String | Unique request ID; a combination of digits and letters at least 24 characters is recommended | Obligatoire |
Signature example:
Sorted parameters concatenated into a URL-style query string
"amount=1¤cy=EUR&description=test&method=v3.Capture¬ify_url=https://www.yabandpay.com/notify&request_id=ca51f2fas3i0f8uiw7efj6oe4i2w1ghj&time=1720684254&trade_id=160899f3-f6d9-a8d8-ab5b-82eacdab9c5b&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.Capture",
"time": 1720684254,
"data": {
"description": "test",
"trade_id": "160899f3-f6d9-a8d8-ab5b-82eacdab9c5b",
"amount": "1",
"currency": "EUR",
"notify_url": "https://www.yabandpay.com/notify",
"request_id": "ca51f2fas3i0f8uiw7efj6oe4i2w1ghj"
}
}
Exemple de réponse:
{
"status": true,
"code": "200",
"data": {
"order_id": "YOUR_ORDER_ID",
"trade_id": "160899f3-f6d9-a8d8-ab5b-82eacdab9c5b",
"amount": "1",
"currency": "EUR",
"state": "paid"},
"message": "",
"response_id": "202407111550570060848432"
}
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 | |
| false | -1000 | Internal error |
| false | -403 | The signature Error |
| false | -2001 | The user not exist |
| false | -3001 | Required field is missing |
| false | -4118 | Incorrect request ID |
| false | -4089 | Exceed capture window |
| false | -4084 | The captured amount exceeds the original authorized amount |
| false | -4085 | The captured currency is different from the original authorization currency |
| false | -4024 | The original trade ID is incorrect |
