API REFERENCE
Pagos con token
Parámetros
| Parameter | Type | Descripción | Obligatorio |
|---|---|---|---|
| data.pay_method | string | online | ✓ |
| data.sub_pay_method | string | Token | ✓ |
| data.operation | string | 11.Token for sales 12.Token for authorisation; | ✓ |
| data.order_id | integer | 商户的订单ID | ✓ |
| data.sca_exemption | string | LowValue | ✓ |
| data.amount | string | 金额数字。例如 € 24.99 应该写成24.99 | ✓ |
| data.currency | string | 货币代码,ISO 4217,例如EUR,CHF | ✓ |
| data.payment_token_object | string | 支付Token | ✓ |
| data.description | string | 订单描述 | ✓ |
| data.demo | string | 自定义字段 | — |
| data.timeout | string | 过期时间单位分钟(0-1440) | ✓ |
| data.notify_url | string | 支付完成后异步通知地址 | ✓ |
| data.request_id | string | 请求id需保持唯一,建议24以上位数字+字母 | ✓ |
| data.3ds_initiate | string | 01. 开启3ds验证; 02.不开启3DS(需申请开通);03. SCA豁免(需申请开通); | ✓ |
Se aplica a: iniciar pagos con token mediante tarjetas de crédito
Después de que el pagador complete una transacción estándar con tarjeta de crédito en la página de pago alojada por YabandPay y dé su consentimiento, YabandPay convierte los datos confidenciales del titular en una cadena numérica aleatoria (un token) para eliminar la información identificativa. El token puede utilizarse para los siguientes pagos:
- Los usuarios pueden pagar con un solo clic en la página de pago sin introducir los datos de la tarjeta de crédito.
- Los comercios pueden utilizar este token para pagos recurrentes, cargos de suscripción y otros fines similares.
[!TIP|style:flat] Workflow
- Active los pagos con token. Póngase en contacto con su gestor de cuenta para habilitar esta función.
- Obtenga el consentimiento del usuario. Al habilitar pagos exprés (pagos con token) para consumidores, debe informarles claramente y obtener su consentimiento para evitar posibles disputas.
- Obtener un token. Primero, inicie una transacción estándar con tarjeta de crédito. YabandPay devuelve una URL de pago. Cuando el usuario complete el pago mediante esa URL y dé su consentimiento, YabandPay devolverá el token en una notificación asíncrona utilizando el parámetro payment_token_object parameter.
- Inicie un pago con token. Incluya el token en la payment_token_object variable. Si la validación del token es correcta, YabandPay procesa el pago con token. Si falla, YabandPay devuelve un error. En ese caso, recomendamos iniciar otra transacción estándar con tarjeta para obtener un token y volver a iniciar el pago.
| Parámetro | Tipo | Descripción | Obligatorio |
|---|---|---|---|
| user | String | Cashier account UID | Obligatorio |
| sign | String | Signature | Obligatorio |
| method | String | v3.CreateCardPayments | Obligatorio |
| time | Long | Timestamp | Obligatorio |
- Parameters
| Parámetro | Tipo | Descripción | Obligatorio |
|---|---|---|---|
| pay_method | String | online | Obligatorio |
| sub_pay_method | String | Token | Obligatorio |
| operation | String | 11.Token for sales 12.Token for authorisation; | Obligatorio |
| order_id | String | Merchant order ID | Obligatorio |
| 3ds_initiate | String | 01. Enable 3DS verification; 02. Disable 3DS (requires activation approval); 03. SCA exemption (requires activation approval). | Obligatorio |
| sca_exemption | String | LowValue | 3ds_initiate=03 Required |
| amount | String | Amount as a numeric string. For example, enter 24.99 for € 24.99. | Obligatorio |
| currency | String | ISO 4217 currency code, for example EUR or CHF | Obligatorio |
| payment_token_object | String | Payment Token | Obligatorio |
| description | String | Order description | Obligatorio |
| demo | String | Custom field | Opcional |
| timeout | String | Expiration time in minutes (0-1440) | Obligatorio |
| notify_url | String | Asynchronous notification URL after payment | Obligatorio |
| request_id | String | Unique request ID; a combination of digits and letters at least 24 characters is recommended | Obligatorio |
Signature example:
Sorted parameters concatenated into a URL-style query string
"3ds_initiate=01&amount=1¤cy=EUR&description=test&method=v3.CreateCardPayments¬ify_url=https://www.yabandpay.com/notify&operation=11&order_id=1725875543&pay_method=online&payment_token_object=VnXaRabcsedfsSlPFZXavcsdfasdEFDd&request_id=hjf5lv32i40lh7oh86j6az98tnscwv37&sub_pay_method=Token&time=1725875543&timeout=0&user=YOUR_CASHIER_UID"
Sign stringA using secret_key
The resulting signature is:
"YOUR_SIGNATURE"
Request example:
{
"user": "YOUR_CASHIER_UID",
"sign": "YOUR_SIGNATURE",
"method": "v3.CreateCardPayments",
"time": 1725875543,
"data": {
"3ds_initiate": "01",
"description": "test",
"timeout": "0",
"pay_method": "online",
"sub_pay_method": "Token",
"operation": "11",
"order_id": 1725875543,
"amount": "1",
"currency": "EUR",
"payment_token_object": "VnXaRabcsedfsSlPFZXavcsdfasdEFDd",
"notify_url": "https://www.yabandpay.com/notify",
"request_id": "hjf5lv32i40lh7oh86j6az98tnscwv37"
}
}
Response example:
{
"status": true,
"code": "200",
"data": {
"order_id": "YOUR_ORDER_ID",
"trade_id": "109bb0e9-e1fb-49cb-c537-ec944f33c388",
"amount": "1.00",
"currency": "EUR",
"state": "paid"
},
"message": "",
"response_id": "202409091752241912726578"
}
Additional information:
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.
Response result:
-
A successful request returns "status": true.
-
If the call fails, "status": false is returned. If you receive Invalid Token, we recommend calling HPP Token again to obtain a new Token.
The API returns the payment status synchronously. We strongly recommend using both Order Query como Notificaciones asíncronas to synchronize and update the payment status and keep payment information accurate in real time. a) If the order status state is paid, payment succeeded; b) if the order status state is authorized, authorization succeeded. To capture funds after successful authorization, call the authorization capture API.
3DS low-value exemption:
Transactions within the following limits may qualify as low-value transactions. If the order amount is less than or equal to the applicable amount below, transaction code 02 (low-value exemption) may be used with approval.
| # | 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 | -4119 | Invalid Token |
| false | -4120 | No operational permissions |
