预授权请款
适用于:预授权后的请款
在预授权成功后对订单进行请款,必须在预授权完成后的30天内请款,否则将自动过期。
请款货币必须与预授权货币一致,并且金额不能超过原始授权金额。
每个授权交易仅仅接受一次请款,不支持多次请款。
API URL:https://mapi.yabandpay.com/Payments
Method:POST
POST data type:Json
参数 | 类型 | 描述 | 是否必填 |
---|---|---|---|
user | String | 收银员账号的UID | 必填 |
sign | String | 签名 | 必填 |
method | String | v3.Capture | 必填 |
time | Long | 时间戳 | 必填 |
- 参数
Parameter | Type | Description | 是否必填 |
---|---|---|---|
trade_id | String | 对应预授权的trade_id | 必填 |
amount | String | 金额数字。例如 € 24.99 应该写成24.99 | 必填 |
currency | String | 货币代码,ISO 4217,例如EUR,CHF | 必填 |
description | String | 订单描述 | 必填 |
notify_url | String | 支付完成后异步通知地址 | 必填 |
request_id | String | 请求id需保持唯一,建议24以上位数字+字母 | 必填 |
签名示例:
拼接为URL方式并排序后的字符串
"amount=1¤cy=EUR&description=test&method=v3.Capture¬ify_url=https://www.yabandpay.com/notify&request_id=ca51f2fas3i0f8uiw7efj6oe4i2w1ghj&time=1720684254&trade_id=160899f3-f6d9-a8d8-ab5b-82eacdab9c5b&user=016683"
得到的 stringA 使用 secret_key做签名
得到的签名如下:
"6aea50e6a1c79d38b3398d32524deb17a38e8f2c84ac08cdbf147b47a78e01d2"
提交示例:
{
"user": "016683",
"sign": "6aea50e6a1c79d38b3398d32524deb17a38e8f2c84ac08cdbf147b47a78e01d2",
"method": "v3.Capture",
"time": 1720684254,
"data": {
"description": "test",
"trade_id": "160899f3-f6d9-a8d8-ab5b-82eacdab9c5b",
"amount": "1",
"currency": "EUR",
"notify_url": "https://www.yabandpay.com/notify",
"request_id": "ca51f2fas3i0f8uiw7efj6oe4i2w1ghj"
}
}
返回示例:
{
"status": true,
"code": "200",
"data": {
"order_id": "23505805395809345894869",
"trade_id": "160899f3-f6d9-a8d8-ab5b-82eacdab9c5b",
"amount": "1",
"currency": "EUR",
"state": "paid",
},
"message": "",
"response_id": "202407111550570060848432"
}
更多信息:
返回结果:
若调用成功,则返回
"status": true
若调用失败,则返回
"status": fales
我们强烈建议同时使用订单查询和异步通知来同步和更新支付状态,以确保支付信息的实时准确性。
返回代码:
Status | Code | Message |
---|---|---|
true | 200 | |
fales | -1000 | Internal error |
fales | -403 | The signature Error |
fales | -2001 | The user not exist |
fales | -3001 | Required field is missing |
fales | -4118 | Incorrect request ID |
fales | -4089 | Exceed capture window |
fales | -4084 | The captured amount exceeds the original authorized amount |
fales | -4085 | The captured currency is different from the original authorization currency |
fales | -4024 | The original trade ID is incorrect |