API REFERENCE
Diminuir autorização
Parâmetros
| Parameter | Type | Descrição | Obrigatório |
|---|---|---|---|
| data.trade_id | string | 对应减少预授权的trade_id | ✓ |
| data.amount | string | 金额数字。例如 € 24.99 应该写成24.99 | ✓ |
| data.currency | string | 货币代码,ISO 4217,例如EUR,CHF | ✓ |
| data.description | string | 订单描述 | ✓ |
| data.notify_url | string | 支付完成后异步通知地址 | ✓ |
| data.request_id | string | 请求id需保持唯一,建议24以上位数字+字母 | ✓ |
| Parâmetro | Tipo | Descrição | Obrigatório |
|---|---|---|---|
| user | String | Conta de caixa UID | Obrigatório |
| sign | String | Signature | Obrigatório |
| method | String | v3.PreauthDecrement | Obrigatório |
| time | Long | Timestamp | Obrigatório |
- Parâmetros
| Parâmetro | Tipo | Descrição | Obrigatório |
|---|---|---|---|
| trade_id | String | trade_id of the authorization to decrease | Obrigatório |
| amount | String | Valor numérico. Por exemplo, € 24.99 must be written as 24.99 | Obrigatório |
| currency | String | Código da moeda ISO 4217 currency code, such as EUR or CHF | Obrigatório |
| description | String | Descrição do pedido | Obrigatório |
| notify_url | String | URL de notificação assíncrona após o pagamento completion | Obrigatório |
| request_id | String | ID de solicitação exclusivo; recomenda-se pelo menos 24 alphanumeric characters are recommended | Obrigatório |
Exemplo de assinatura:
Parâmetros ordenados concatenados em uma cadeia de consulta no formato de URL
"amount=0.1¤cy=EUR&description=test&method=v3.PreauthDecrement¬ify_url=https://www.yabandpay.com/notify&request_id=skc5vtsovtetqe09us0jdrqm1vjdeaki&time=1774246236&trade_id=9222e0e1-6ef5-639f-3692-90f1e2a33e68&user=YOUR_CASHIER_UID"
Assine a stringA usando secret_key
A assinatura resultante é:
"YOUR_SIGNATURE"
Exemplo de solicitação:
{
"user": "YOUR_CASHIER_UID",
"sign": "YOUR_SIGNATURE",
"method": "v3.PreauthDecrement",
"time": 1774246236,
"data": {
"description": "test",
"trade_id": "9222e0e1-6ef5-639f-3692-90f1e2a33e68",
"amount": "0.1",
"currency": "EUR",
"notify_url": "https://www.yabandpay.com/notify",
"request_id": "skc5vtsovtetqe09us0jdrqm1vjdeaki"
}
}
Exemplo de resposta:
{
"status": true,
"code": "200",
"data": {
"order_id": "YOUR_ORDER_ID",
"trade_id": "160899f3-f6d9-a8d8-ab5b-82eacdab9c5b",
"amount": "1",
"currency": "EUR",
"state": "authorized"
},
"message": "",
"response_id": "202407111550570060848432"
}
Informações adicionais:
Resultado da resposta:
-
Uma solicitação bem-sucedida retorna "status": true.
-
Uma solicitação malsucedida retorna "status": false.
Esta API reduz o valor da autorização. O resultado é retornado de forma síncrona. A redução não pode exceder o valor autorizado.
Códigos de resposta:
| 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 | -4024 | The original trade ID is incorrect |
