API REFERENCE
Iniciar pago o autorización
Parámetros
| Parameter | Type | Descripción | Obligatorio |
|---|---|---|---|
| data.pay_method | string | offline | ✓ |
| data.sub_pay_method | string | point_of_sales | ✓ |
| data.operation | string | 1.Sales 2.Authorisation; | ✓ |
| data.tid | string | 设备的TID | ✓ |
| data.order_id | string | 订单号全部数字构成,并小于20个字符 | ✓ |
| data.amount | string | 金额数字。例如 € 24.99 应该写成24.99,CNY金额>=1,欧元金额>=0.1 | ✓ |
| data.tip_amount | string | 总金额中包含的小费,金额数字。例如 1.02 | — |
| data.currency | string | 货币代码,ISO 4217,例如EUR,CHF | ✓ |
| data.description | string | 订单描述64字符内 | ✓ |
| data.demo | string | 自定义字段 | — |
| data.notify_url | string | 支付完成后异步通知地址 | ✓ |
| data.request_id | string | 请求id需保持唯一,建议24以上位数字+字母 | ✓ |
Se aplica a pagos presenciales con POS
Esta API envía instrucciones de pago o autorización a un dispositivo POS a través de la nube.
Antes de llamar a esta API, asegúrese de que el dispositivo POS esté conectado y disponible para que las instrucciones puedan entregarse y procesarse correctamente.
API URL (production): https://mapi.yabandpay.com/Payments
API URL (test): https://acc-mapi.yabandpay.com/Payments
| Parámetro | Tipo | Descripción | Obligatorio |
|---|---|---|---|
| user | String | TID del dispositivo | Obligatorio |
| sign | String | Signature | Obligatorio |
| method | String | v3.POS | Obligatorio |
| time | Long | Timestamp | Obligatorio |
- Parámetros
| Parámetro | Tipo | Descripción | Obligatorio |
|---|---|---|---|
| pay_method | String | offline | Obligatorio |
| sub_pay_method | String | point_of_sales | Obligatorio |
| operation | String | 1.Sales 2.Authorisation; | Obligatorio |
| tid | string | TID del dispositivo | Obligatorio |
| order_id | string | Número de pedido compuesto únicamente por dígitos y con menos de 20 characters | Obligatorio |
| amount | String | Importe como cadena numérica. Por ejemplo, introduzca 24.99 for € 24.99. importe en CNY >=1; importe en EUR >=0.1. | Obligatorio |
| tip_amount | String | Propina incluida en el importe total, expresada como cadena numérica; por ejemplo 1.02 | Opcional |
| currency | String | ISO 4217 código de moneda, por ejemplo EUR or CHF | Obligatorio |
| description | String | Descripción del pedido, con un máximo de 64 characters | Obligatorio |
| demo | String | Campo personalizado | Opcional |
| notify_url | String | URL de notificación asíncrona tras el pago | Obligatorio |
| request_id | String | ID de solicitud único; se recomienda una combinación de letras y números de al menos 24 caracteres | Obligatorio |
Ejemplo de firma:
Parámetros ordenados y concatenados en una cadena de consulta con formato de URL
"amount=12.5¤cy=EUR&description=YabandPay test&method=v3.POS¬ify_url=https://www.yabandpay.com/notify&operation=1&order_id=202586556498441613&pay_method=offline&request_id=a7z1lox4l6z6mdx1udgn5gtezasze1x0&sub_pay_method=point_of_sales&tid=T125119061&time=1555498137&tip_amount=0.5&user=T125119061"
Firme la cadena A con secret_key
La firma resultante es:
"YOUR_SIGNATURE"
Ejemplo de solicitud:
{
"user": "T125119061",
"sign": "YOUR_SIGNATURE",
"method": "v3.POS",
"time": 1555498137,
"data": {
"operation": "1",
"tid": "T125119061",
"amount": "12.5",
"currency": "EUR",
"tip_amount": "0.5",
"description": "YabandPay test",
"notify_url": "https://www.yabandpay.com/notify",
"order_id": "YOUR_ORDER_ID",
"pay_method": "offline",
"sub_pay_method": "point_of_sales",
"request_id": "a7z1lox4l6z6mdx1udgn5gtezasze1x0"
}
}
Ejemplo de respuesta:
{
"status": true,
"code": "200",
"data": {
"order_id": "YOUR_ORDER_ID",
"trade_id": "4552eeea-1ae8-1e40-3b4b-802dc2f56458",
"amount": "12",
"currency": "EUR",
"tip_amount": "0.5",
"state": "processing"
},
"message": ""}
Información adicional:
Consejo
Important: When an asynchronous notification returns "state": "paid", the user has completed payment. Check whether the returned data contains "cvmTypeList": ["SIGNATURE"].
If the response contains "cvmTypeList": ["SIGNATURE"], the customer must sign the receipt;
Prompt the cashier to request the customer's signature and print a receipt with a signature field;
After the customer signs, the cashier selects “Confirm signature” or “Invalid signature” based on the signature.
If “Confirm signature” is selected, the transaction completes normally;
If “Invalid signature” is selected, immediately call the transaction reversal API to reverse this transaction;
For unattended or self-service payments, signature verification may be omitted because amounts are generally small, but this carries a chargeback risk.
Resultado de la respuesta:
-
Una solicitud correcta devuelve "status": true.
-
Una solicitud fallida devuelve "status": false.
Recomendamos encarecidamente utilizar tanto las consultas de pedidos como las notificaciones asíncronas para sincronizar y actualizar el estado del pago y mantener la información de pago precisa en tiempo real.
Códigos de respuesta:
| Status | Code | Message |
|---|---|---|
| true | 200 | Success |
| false | -1000 | Internal error |
| false | -3001 | Required field is missing |
| false | -3002 | duplicate request_id |
| false | -403 | The signature Error |
| false | -4011 | Not support the payment method |
