API REFERENCE
Vale
Parámetros
| Parameter | Type | Descripción | Obligatorio |
|---|---|---|---|
| data.pay_method | string | online | ✓ |
| data.sub_pay_method | string | Voucher | ✓ |
| data.order_id | string | 商户的订单ID | ✓ |
| data.amount | string | 金额数字。例如 € 24.99 应该写成24.99,欧元金额>=1 | ✓ |
| data.currency | string | EUR | ✓ |
| data.description | string | 订单描述 | ✓ |
| data.demo | string | 自定义字段 | — |
| data.timeout | string | 过期时间单位分钟(0-1440) | ✓ |
| data.redirect_url | string | 如果使用托管页面,支付完成后跳转地址 | — |
| data.notify_url | string | 支付完成后异步通知地址 | ✓ |
| data.cardnumber | string | 礼品卡卡号(如使用页面跳转托管方式非必填) | — |
| data.pincode | string | 礼品卡密码(如传cardnumber该字段必填) | — |
Se aplica a: tarjetas regalo
Este método de pago utiliza el saldo de una tarjeta regalo para pagar un pedido. Las tarjetas regalo deben activarse en el punto de venta.
| Parámetro | Tipo | Descripción | Obligatorio |
|---|---|---|---|
| user | String | Cuenta de cajero UID | Obligatorio |
| sign | String | Signature | Obligatorio |
| method | String | v3.CreatePaymentsVoucher | Obligatorio |
| time | Long | Timestamp | Obligatorio |
- Parámetros
| Parámetro | Tipo | Descripción | Obligatorio |
|---|---|---|---|
| pay_method | String | online | Obligatorio |
| sub_pay_method | String | Voucher | Obligatorio |
| order_id | String | ID de pedido del comercio | Obligatorio |
| amount | String | Importe numérico. Por ejemplo, € 24.99 debe indicarse como 24.99; importe en euros >=1 | Obligatorio |
| currency | String | EUR | Obligatorio |
| description | String | Descripción del pedido | Obligatorio |
| demo | String | Campo personalizado | Opcional |
| timeout | String | Tiempo de expiración en minutos (0-1440) | Obligatorio |
| redirect_url | String | URL de redirección tras el pago cuando se utiliza la página alojada | Opcional |
| notify_url | String | URL de notificación asíncrona tras el pago | Obligatorio |
| cardnumber | String | Gift card number (not required when redirecting to the hosted page) | Opcional |
| pincode | String | Gift card PIN (required if cardnumber is provided) | Opcional |
Ejemplo de firma:
Parámetros ordenados y concatenados en una cadena de consulta con formato de URL
"amount=0.01&cardnumber=6064364245787814896¤cy=EUR&demo=test&description=YabandPay test VVV&method=v3.CreatePaymentsVoucher¬ify_url=https://www.yabandpay.com/notify&order_id=202405110140188881&pay_method=online&pincode=568971&redirect_url=https://www.yabandpay.com&sub_pay_method=Voucher&time=1546588959&timeout=0&user=YOUR_CASHIER_UID"
Firme la cadena A con secret_key
La firma resultante es:
"YOUR_SIGNATURE"
Ejemplo de solicitud:
{
"user": "YOUR_CASHIER_UID",
"sign": "YOUR_SIGNATURE",
"method": "v3.CreatePaymentsVoucher",
"time": 1546588959,
"data": {
"description": "YabandPay test VVV",
"timeout": "0",
"pay_method": "online",
"sub_pay_method": "Voucher",
"order_id": "YOUR_ORDER_ID",
"amount": "0.01",
"currency": "EUR",
"redirect_url": "https://www.yabandpay.com",
"notify_url": "https://www.yabandpay.com/notify",
"demo": "test",
"cardnumber": "6064364245787814896",
"pincode": "568971"
}
}
Ejemplo de respuesta:
{
"status": true,
"code": "200",
"data": {
"order_id": "YOUR_ORDER_ID",
"trade_id": "535ea4a1-917a-bc14-58e2-d1565720af90",
"amount": "0.01",
"currency": "EUR",
"settlement_amount": "0.01",
"settlement_currency": "EUR",
"exchange_rate": "1",
"url": "",
"state": "processing"
},
"message": ""
}
Hosted page integration:
Use this method to verify the gift card number and PIN on the YabandPay hosted page. In this case, do not pass cardnumber or pincode. After the API call, redirect to the returned url to continue the payment flow.
Ejemplo de solicitud:
{
"user": "YOUR_CASHIER_UID",
"sign": "YOUR_SIGNATURE",
"method": "v3.CreatePaymentsVoucher",
"time": 1546588959,
"data": {
"description": "YabandPay test VVV",
"timeout": "0",
"pay_method": "online",
"sub_pay_method": "Voucher",
"order_id": "YOUR_ORDER_ID",
"amount": "0.01",
"currency": "EUR",
"redirect_url": "https://www.yabandpay.com",
"notify_url": "https://www.yabandpay.com/notify",
"demo": "test"
}
}
Ejemplo de respuesta:
{
"status": true,
"code": "200",
"data": {
"order_id": "YOUR_ORDER_ID",
"trade_id": "c0d9c0bb-0b40-1cb6-7373-fd1a97c7124e",
"amount": "0.01",
"currency": "EUR",
"url": "https://pay.yabandpay.com/payments/callback/order/YzBkOWMwYmItMGI0MC0xY2I2LTczNzMtZmQxYTk3YzcxMjRl",
"state": "processing"
},
"message": ""
}
Información adicional:
Resultado de la respuesta:
-
Una solicitud correcta devuelve "status": true.
-
Una solicitud fallida devuelve "status": false.
Recomendamos encarecidamente utilizar tanto Consulta de pedido and Notificaciones asíncronas para mantener los estados de pago precisos y actualizados.
Códigos de respuesta:
| Status | Code | Message |
|---|---|---|
| true | 200 | |
| false | -1000 | Internal error |
| false | -104000 | You have entered an invalid amount |
| false | -104221 | The voucher has insufficient funds |
| false | -104222 | Invaild PinCode |
| false | -104223 | This is an invalid giftcard, we are unable to find the giftcard brand |
