API REFERENCE
Obtenir un Token
Paramètres
| Parameter | Type | Description | Obligatoire |
|---|---|---|---|
| data.pay_method | string | online | ✓ |
| data.sub_pay_method | string | Cards HPP | ✓ |
| data.operation | string | 10.Create Token only; 11.Token for sales; 12.Token for authorisation | ✓ |
| data.order_id | integer | 商户的订单ID | ✓ |
| data.cardinfo | string | 卡信息 | — |
| data.amount | string | 金额数字。例如 € 24.99 应该写成24.99。如果operation为10,请设置amount=0 | ✓ |
| data.currency | string | 货币代码,ISO 4217,例如EUR,CHF | ✓ |
| data.description | string | 订单描述 | ✓ |
| data.form_type | string | 返回的url类型,默认01。 01.completed, 02.iframe | — |
| data.demo | string | 自定义字段 | — |
| data.email | string | 持卡人email | ✓ |
| data.timeout | string | 过期时间单位分钟(0-1440) | ✓ |
| data.redirect_url | string | 支付完成后跳转地址 | — |
| data.notify_url | string | 支付完成后异步通知地址 | ✓ |
| data.request_id | string | 请求id需保持唯一,建议24以上位数字+字母 | ✓ |
| data.3ds_initiate | string | 3ds设置。 01. 必须开启3ds验证; | ✓ |
S’applique à l’obtention d’un Token via la page de paiement hébergée de YabandPay
La page de paiement hébergée (HPP) de YabandPay est une page prête à l’emploi, entièrement gérée par YabandPay. Les marchands peuvent accepter des paiements en toute sécurité en hébergeant les données PCI sensibles dans le système YabandPay. Le formulaire peut être intégré au parcours de paiement du marchand sous forme d’iframe ou de page de redirection.
Une fois que le payeur a effectué une transaction standard par carte de crédit sur la page de paiement hébergée de YabandPay et donné son consentement, YabandPay convertit les données sensibles du titulaire en une chaîne aléatoire (un Token) afin de supprimer les informations permettant de l’identifier. Le Token peut être utilisé pour les paiements suivants :
- Les utilisateurs peuvent payer en un clic sur la page de paiement, sans saisir les coordonnées de leur carte.
- Les marchands peuvent utiliser ce Token pour les paiements récurrents, les abonnements et des usages similaires.
[!TIP|style:flat] Workflow
- Activez les paiements par Token. Contactez votre chargé de compte pour activer cette fonctionnalité.
- Obtenez le consentement de l’utilisateur. Lors de l’activation des paiements express (paiements par Token), vous devez informer clairement les consommateurs et obtenir leur consentement afin d’éviter tout litige.
- Obtenez un Token. Commencez par initier une transaction standard par carte de crédit. YabandPay renvoie a payment url. After the user completes payment through that url and gives consent, YabandPay renvoie the Token in an asynchronous notification using the payment_token_object parameter.
- Initiez un paiement par Token. Incluez le Token dans la payment_token_object variable. Si la validation du Token réussit, YabandPay traite le paiement. Dans le cas contraire, YabandPay renvoie une erreur. Dans ce cas, nous recommandons d’initier une nouvelle transaction standard par carte de crédit pour obtenir un Token, puis de relancer le paiement.
| 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 | Cards HPP | Obligatoire |
| operation | String | 10.Create Token only; 11.Token for sales; 12.Token for authorisation | Obligatoire |
| order_id | String | Merchant order ID | Obligatoire |
| 3ds_initiate | String | 3ds settings. 01. 3ds verification must be enabled; | Obligatoire |
| cardinfo | String | Card information | Treat the value of cardinfo as a string (fields within cardinfo do not need to be included in 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 | Numeric amount. For example, € 24.99 must be written as 24.99. If operation is 10, set amount=0 | Obligatoire |
| currency | String | ISO 4217 currency code, for example EUR or CHF | Obligatoire |
| description | String | Order description | Obligatoire |
| form_type | String | Type of the returned url. Default: 01. 01.completed, 02.iframe | Facultatif |
| 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¤cy=EUR&description=test&email=JohnSmith@gmail.com&form_type=01&method=v3.CreateCardPayments¬ify_url=https://www.yabandpay.com/notify&operation=11&order_id=1725875388&pay_method=online&request_id=dxktqiedfpkswnripi631ppg6fl2uoym&sub_pay_method=Cards HPP&time=1725875388&timeout=30&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.CreateCardPayments",
"time": 1725875388,
"data": {
"3ds_initiate": "01",
"description": "test",
"timeout": "30",
"pay_method": "online",
"sub_pay_method": "Cards HPP",
"operation": "11",
"form_type": "01",
"order_id": 1725875388,
"amount": "0.1",
"currency": "EUR",
"email": "JohnSmith@gmail.com",
"notify_url": "https://www.yabandpay.com/notify",
"request_id": "dxktqiedfpkswnripi631ppg6fl2uoym"
}
}
Exemple de réponse:
{
"status": true,
"code": "200",
"data": {
"order_id": "YOUR_ORDER_ID",
"trade_id": "2b2aa1af-6e97-4c01-8c52-86200bf66c82",
"amount": "0.1",
"currency": "EUR",
"url": "https://pay.yabandpay.com/pay_method/Y3JlZGl0Y2FyZA==/MmIyYWExYWYtNmU5Ny00YzAxLThjNTItODYyMDBiZjY2Yzgy",
"state": "processing"
},
"message": "",
"response_id": "202409091749500451314672"
}
Informations complémentaires:
MIT & CIT :
MIT = Merchant Initiated subsequent transactions. Token payments initiated by the merchant.
CIT = Cardholder Initiated Subsequent transactions. Token payments involving the customer. When activating payments, specify whether you need MIT or CIT so the appropriate mode can be configured.
Résultat du paiement:
-
Une requête réussie renvoie "status": true.
-
Une requête échouée renvoie "status": false.
Redirect the customer to the returned url. After entering card details and completing payment at this url, 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.
Token renvoyé:
-
After the customer grants authorization and the payment succeeds, YabandPay renvoie payment_token_object through an asynchronous notification.
-
If the customer does not grant authorization or does not complete payment, the asynchronous notification does not return payment_token_object.
3DS low-value exemption:
Les transactions respectant les limites suivantes peuvent être considérées comme des transactions de faible montant. Si le montant de la commande est inférieur ou égal au plafond applicable ci-dessous, le code de transaction 02 (low-value exemption) peut être utilisé sous réserve d’approbation.
| # | Currency | Amount |
|---|---|---|
| 1 | EUR | 30 |
| 2 | DKK | 225 |
| 3 | GBP | 27 |
| 4 | SEK | 310 |
| 5 | ISK | 5000 |
| 6 | NOK | 325 |
| 7 | CHF | 32 |
| 8 | PLN | 135 |
| 9 | USD | 36 |
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 | -4120 | No operational permissions |
