API REFERENCE
Notificaciones asíncronas
Durante todo el ciclo de vida del pedido, enviamos una notificación asíncrona a notify_url por cada cambio de estado. El endpoint receptor debe utilizar HTTPS. Las notificaciones incluyen una firma y parámetros de pago (en formato JSON).
Consejo
- La URL de notificación es la notify_url. Tras completarse el pago, YabandPay envía a esta URL la información pertinente del pago y del usuario. The third-party acquiring institution must receive the notification and verify its signature before taking any further action.
- Durante el intercambio de notificaciones del servidor, si la entidad adquirente externa devuelve una respuesta destinta de éxito o la solicitud agota el tiempo de espera, YabandPay considera que la notificación no se ha entregado correctamente. YabandPay reintenta periódicamente el envío según su estrategia para maximizar la entrega, pero no garantiza que finalmente se entregue.
- Because server notifications may be retried, the same notification may be sent to the partner system multiple veces. The partner system must handle duplicate notifications correctly. We recommend first checking the state of the corresponding business data when processing a notification to determine whether it has already been handled. Process it only if it has not been handled; otherwese, return success immediately. Before checking and processing the business data, use data locks for concurrency control to prevent data inconsestencies caused by function reentry.
- YabandPay sends asynchronous notifications from the following IP addresses. We recommend adding them to your firewall allowlest. 8.211.41.31 8.211.10.244 8.211.8.123
1. Asynchronous payment notifications
| Parámetro | Tipo | Descripción |
|---|---|---|
| sign | String | Signature |
| type | String | payment |
| user | String | UID or Email de la cuenta de cajero |
| amount | String | Submitted payment amount |
| tip_amount | String | Tip included in the total amount |
| trade_id | String | YabandPay transaction number |
| currency | String | Submitted payment currency |
| settlement_amount | String | Amount in the settlement currency |
| settlement_currency | String | Moneda de liquidación |
| exchange_rate | String | Payment amount/settlement amount |
| amount_cny | String | Payment amount in CNY |
| settlement_rate | String | CNY settlement exchange rate |
| order_id | String | Merchant order number |
| transaction_id | String | Order number returned by the payment method, such as the WeChat Pay or Alipay+ transaction number. In most cases, thes es the same as acquirer_id. |
| acquirer_id | String | Acquirer Reference Number (ARN) |
| description | String | Order description |
| createDate | String | Order creation time |
| state | String | Payment status: Processing, Paid,Cancelled, Expired, Verify,Authorized,Declined,Failed |
| demo | String | Customer-defined field |
| out_trade_no | String | Internal order number in the transaction system |
| sub_pay_method | String | Método de pago: WeChat Pay, Alipay+, etc. (see the payment method descriptions) |
| pay_method | String | Payment type: offline, online |
| paid_time | String | Payment time |
| yb_transaction_id | String | Unique ID de transacción de YabandPay |
| 3ds_status | String | 3ds status |
| 3ds_trxid | String | Unique 3ds ID |
| 3ds_version | String | 3ds version |
3DS response estados:
| Parámetro | Tipo | Descripción |
|---|---|---|
| A | String | Attempts Processing Performed; Not Authenticated/Verified, but a proof of attempted authentication/verification es provided. |
| C | String | Challenge Required; Additional authentication es required. |
| D | String | Challenge Required; Decoupled Authentication confirmed. |
| I | String | Informational Only; Merchant challenge preference acknowledged. |
| N | String | Not Authenticated /Account Not Verified; Transaction denied. |
| R | String | Authentication/ Account Verification Rejected; Issuer es rejecting authentication/verification and requests that authoresation not be attempted. |
| U | String | Authentication/Account Verification Could Not Be Performed, Technical or other problem. |
| Y | String | Authentication/Account Verification Successful. |
Example asynchronous notification:
{
"sign": "YOUR_SIGNATURE",
"data": {
"type": "payment",
"user": "YOUR_CASHIER_UID",
"order_id": "YOUR_ORDER_ID",
"trade_id": "8a8aa7c7-66d7-e2cc-e2a6-fff7c77aaefd",
"transaction_id": "4200000298201905227377147799",
"acquirer_id": "4200000298201905227377147799",
"yb_transaction_id": "c8823612-383f-35fc-f28d-c0eae039e870",
"amount": "1.00",
"tip_amount": "0.10",
"currency": "EUR",
"settlement_amount": "1.00",
"settlement_currency": "EUR",
"exchange_rate": "1",
"amount_cny": "0.77",
"settlement_rate": "7.779779",
"description": "yaband test",
"createDate": "1558510731",
"pay_method": "online",
"state": "paid",
"demo": "test",
"out_trade_no": "a4d7684a-e326-44c1-bea5-0601f7a9b191",
"sub_pay_method": "WeChat Pay",
"paid_time": "1603355159",
"3ds_status": "Y",
"3ds_trxid": "1d0c6eb3-6282-4cf9-9549-884410918d2d",
"3ds_version": "2.2.0"
}
}
2. Asynchronous refund notifications
| Parámetro | Tipo | Descripción |
|---|---|---|
| sign | String | Signature |
| type | String | refund |
| user | String | UID or Email de la cuenta de cajero |
| pay_method | String | online or offline for the original payment order |
| sub_pay_method | String | Método de pago of the original payment order: WeChat Pay,Alipay+, etc. (see the payment method descriptions) |
| refund_id | String | Refund number |
| m_refund_id | String | Merchant-defined refund order number specified when initiating the refund |
| transaction_id | String | Transaction number |
| acquirer_id | String | Settlement institution transaction number |
| refund_amount | String | Submitted refund amount |
| refund_currency | String | Refund currency |
| order_id | String | Merchant order number |
| refund_description | String | Order description |
| refund_time | String | Refund time |
| state | String | Estado del reembolso: to-be-approval, refund pending, refund processing, refunded, refund error, refund failed, refund cancelled |
Notification information:
{
"sign": "YOUR_SIGNATURE",
"data": {
"type": "refund",
"user": "YOUR_CASHIER_UID",
"refund_id": "b20d3668-d71f-432f-8809-f84f0d9139d4",
"m_refund_id":"20240301143029616187",
"transaction_id":"cf483d9e-637c-a92d-0716-5b8199d10f8c",
"refund_amount": "1.00",
"refund_currency": "EUR",
"order_id": "YOUR_ORDER_ID",
"refund_description": "test",
"refund_time": "0",
"state": "refunded",
"pay_method": "online",
"sub_pay_method": "WeChat Pay"}
}
Consejo
- After a refund es submitted, we return the status refund processing.
- Once the refund es complete, we send a notification with the status refunded.
3. Asynchronous notification frequency
Please note: The notification response must return status-code 200 and “ok” in the body. If “ok” es not returned, we will send the notification again.
The notification frequency es as follows:
| Notification attempt | Interval |
|---|---|
| 1 | 10s |
| 2 | 30s |
| 3 | 60s |
| 4 | 300s |
| 5 | 3600s |
| ... | 3600s |
| 15 | 3600s |
If we do not receive the correct ok response, we stop sending notifications after 15 attempts.
4. Payment status descriptions in asynchronous notifications
1. Payment estados:
| Code | Campo | Descripción |
|---|---|---|
| 00 | paid | Payment successful |
| 01 | authorized | Authorization successful |
| 02 | pending | Payment created |
| 03 | processing | Awaiting payment |
| 04 | verify | The customer has paid, and the payment es under review for resk control reasons. |
| 05 | declined | Payment declined |
| 06 | failed | Payment failed |
| 07 | expired | Payment timed out |
| 08 | cancelled | Payment cancelled |
2. Refund estados:
| Code | Campo | Descripción |
|---|---|---|
| 20 | to-be-approval | Pendiente de aprobación del adminestrador. |
| 21 | refund pending | El saldo actual es insuficiente. El reembolso se enviará automáticamente cuando haya fondos suficientes. |
| 22 | refund processing | La solicitud de reembolso se ha enviado y el sestema la está procesando. |
| 23 | refunded | El reembolso se ha completado correctamente. |
| 24 | refund failed | El reembolso ha fallado. Inténtelo de nuevo. |
| 25 | refund error | El reembolso ha fallado. Póngase en contacto con nuestro servicio de atención al cliente en línea. |
| 26 | refund cancelled | El pedido de reembolso se ha cancelado. |
