API REFERENCE
Paiement par carte
S’applique aux autorisations de carte et aux achats directs
Cette API s’adresse aux clients qui saisissent leurs coordonnées de carte sur la page du marchand, plutôt que sur une page hébergée par YabandPay. Remarque :
-
Les marchands certifiés PCI DSS et capables de traiter en toute sécurité les données des titulaires peuvent créer leur propre formulaire de carte et transmettre les données via cardinfo.
-
If the merchant collects card details using YabandPay’s frontend plugin (contact YabandPay for integration instructions), the plugin returns a one-time encrypted payment_token_object for the subsequent payment request.
Conseil
Authorizations are valid for 30 days. Authorization orders expire automatically after 30 days.
| Paramètre | Type | Description | Obligatoire |
|---|---|---|---|
| user | String | Cashier account UID | Obligatoire |
| sign | String | Signature | Obligatoire |
| method | String | v3.CreateCardPayments | Obligatoire |
| time | Long | Timestamp | Obligatoire |
- Parameters
| Paramètre | Type | Description | Obligatoire |
|---|---|---|---|
| pay_method | String | online | Obligatoire |
| sub_pay_method | String | Card | Obligatoire |
| operation | String | 1.Sales 2.Authorisation; | Obligatoire |
| order_id | String | Merchant order ID | Obligatoire |
| 3ds_initiate | String | 01. Enable 3DS verification; 02. Disable 3DS (requires activation approval); 03. SCA exemption (requires activation approval). | Obligatoire |
| sca_exemption | String | LowValue | Required when 3ds_initiate=03 |
| payment_token_object | String | String obtained from the YabandPay payment plugin | Provide either cardinfo or payment_token_object |
| cardinfo | String | Card information | Provide either cardinfo or payment_token_object. Treat cardinfo as a string (do not include the fields inside cardinfo in the parameter sorting). |
| cardinfo.card_holder | string | Cardholder name | Obligatoire |
| cardinfo.card_number | string | Card number | Obligatoire |
| cardinfo.expiration_month | string | Card expiration month, MM | Obligatoire |
| cardinfo.expiration_year | string | Card expiration year, YYYY | Obligatoire |
| cardinfo.cvc | string | CVC (storing the CVC in any form violates PCI DSS requirements) | 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 |
| demo | String | Custom field | Facultatif |
| string | Cardholder email | Obligatoire | |
| 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 |
| 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
”3ds_initiate=01&amount=0.1&cardinfo={"card_holder":"John Smith","card_number":"4356789012345670","expiration_month":"01","expiration_year":"2023","cvc":"123"}¤cy=EUR&description=test&email=JohnSmith@gmail.com&method=v3.CreateCardPayments¬ify_url=https://www.yabandpay.com/notify&operation=1&order_id=1756878556&pay_method=online&redirect_url=https://www.yabandpay.com/redirect_url&request_id=a7z1lox4l6z6mdx1udgn5gtezasze1x0&sca_exemption=LowValue&sub_pay_method=Card&time=1756878556&timeout=0&user=YOUR_CASHIER_UID“
Exemple de requête using cardinfo:
{
"user": "YOUR_CASHIER_UID",
"sign": "YOUR_SIGNATURE",
"method": "v3.CreateCardPayments",
"time": 1756878556,
"data": {
"description": "test",
"3ds_initiate": "01",
"timeout": "0",
"pay_method": "online",
"sub_pay_method": "Card",
"operation": "1",
"order_id": 1756878556,
"cardinfo": "{\"card_holder\":\"John Smith\",\"card_number\":\"4356789012345670\",\"expiration_month\":\"01\",\"expiration_year\":\"2023\",\"cvc\":\"123\"}",
"sca_exemption": "LowValue",
"email": "JohnSmith@gmail.com",
"amount": "0.1",
"currency": "EUR",
"redirect_url": "https://www.yabandpay.com/redirect_url",
"notify_url": "https://www.yabandpay.com/notify",
"request_id": "a7z1lox4l6z6mdx1udgn5gtezasze1x0"
}
}
Exemple de requête using payment_token_object:
{
"user": "YOUR_CASHIER_UID",
"sign": "YOUR_SIGNATURE",
"method": "v3.CreateCardPayments",
"time": 1720680417,
"data": {
"payment_token_object": "4564sf65as4f5awe4ft65awe4gt65ewaa4t65ew4t65ew4t65rew4t",
"description": "test",
"3ds_initiate": "01",
"timeout": "0",
"pay_method": "online",
"sub_pay_method": "Card",
"operation": "1",
"order_id": "YOUR_ORDER_ID",
"amount": "1",
"currency": "EUR",
"redirect_url": "https://www.yabandpay.com/redirect_url",
"notify_url": "https://www.yabandpay.com/notify",
"request_id": "tscqf7ki76o7aem4z1yl1xs72f89fptl"
}
}
Exemple de réponse:
{
"status": true,
"code": "200",
"data": {
"order_id": "YOUR_ORDER_ID",
"trade_id": "160899f3-f6d9-a8d8-ab5b-82eacdab9c5b",
"amount": "1.00",
"currency": "EUR",
"url": "https://pay.yabandpay.com/payments/callback/order/MTYwODk5ZjMtZjZkOS1hOGQ4LWFiNWItODJlYWNkYWI5YzVi",
"state": "processing"
},
"message": "",
"response_id": "202407111544200649155078"
}
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.
Redirect the customer to the returned url. After completing 3DS there, the customer is redirected to redirect_url. Nous recommandons vivement d’utiliser à la fois Query Order and Asynchronous Notifications afin de maintenir les statuts de paiement exacts et à jour. a) An order state of paid indicates a successful payment. b) An order state of authorized indicates a successful authorization. To capture an authorized payment, call the Capture Authorization API.
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 |
