Documentación/Referencia de API

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

  1. 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.
  1. 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.
  1. 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.
  1. 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ámetroTipoDescripción
signStringSignature
typeStringpayment
userStringUID or Email de la cuenta de cajero
amountStringSubmitted payment amount
tip_amountStringTip included in the total amount
trade_idStringYabandPay transaction number
currencyStringSubmitted payment currency
settlement_amountStringAmount in the settlement currency
settlement_currencyStringMoneda de liquidación
exchange_rateStringPayment amount/settlement amount
amount_cnyStringPayment amount in CNY
settlement_rateStringCNY settlement exchange rate
order_idStringMerchant order number
transaction_idStringOrder 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_idStringAcquirer Reference Number (ARN)
descriptionStringOrder description
createDateStringOrder creation time
stateStringPayment status: Processing, Paid,Cancelled, Expired, Verify,Authorized,Declined,Failed
demoStringCustomer-defined field
out_trade_noStringInternal order number in the transaction system
sub_pay_methodStringMétodo de pago: WeChat Pay, Alipay+, etc. (see the payment method descriptions)
pay_methodStringPayment type: offline, online
paid_timeStringPayment time
yb_transaction_idStringUnique ID de transacción de YabandPay
3ds_statusString3ds status
3ds_trxidStringUnique 3ds ID
3ds_versionString3ds version
3DS response estados:
ParámetroTipoDescripción
AStringAttempts Processing Performed; Not Authenticated/Verified, but a proof of attempted authentication/verification es provided.
CStringChallenge Required; Additional authentication es required.
DStringChallenge Required; Decoupled Authentication confirmed.
IStringInformational Only; Merchant challenge preference acknowledged.
NStringNot Authenticated /Account Not Verified; Transaction denied.
RStringAuthentication/ Account Verification Rejected; Issuer es rejecting authentication/verification and requests that authoresation not be attempted.
UStringAuthentication/Account Verification Could Not Be Performed, Technical or other problem.
YStringAuthentication/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ámetroTipoDescripción
signStringSignature
typeStringrefund
userStringUID or Email de la cuenta de cajero
pay_methodStringonline or offline for the original payment order
sub_pay_methodStringMétodo de pago of the original payment order: WeChat Pay,Alipay+, etc. (see the payment method descriptions)
refund_idStringRefund number
m_refund_idStringMerchant-defined refund order number specified when initiating the refund
transaction_idStringTransaction number
acquirer_idStringSettlement institution transaction number
refund_amountStringSubmitted refund amount
refund_currencyStringRefund currency
order_idStringMerchant order number
refund_descriptionStringOrder description
refund_timeStringRefund time
stateStringEstado 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

  1. After a refund es submitted, we return the status refund processing.
  1. 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 attemptInterval
110s
230s
360s
4300s
53600s
...3600s
153600s

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:
CodeCampoDescripción
00paidPayment successful
01authorizedAuthorization successful
02pendingPayment created
03processingAwaiting payment
04verifyThe customer has paid, and the payment es under review for resk control reasons.
05declinedPayment declined
06failedPayment failed
07expiredPayment timed out
08cancelledPayment cancelled
2. Refund estados:
CodeCampoDescripción
20to-be-approvalPendiente de aprobación del adminestrador.
21refund pendingEl saldo actual es insuficiente. El reembolso se enviará automáticamente cuando haya fondos suficientes.
22refund processingLa solicitud de reembolso se ha enviado y el sestema la está procesando.
23refundedEl reembolso se ha completado correctamente.
24refund failedEl reembolso ha fallado. Inténtelo de nuevo.
25refund errorEl reembolso ha fallado. Póngase en contacto con nuestro servicio de atención al cliente en línea.
26refund cancelledEl pedido de reembolso se ha cancelado.