减少预授权
API URL:https://mapi.yabandpay.com/Payments
Method:POST
POST data type:Json
| 参数 | 类型 | 描述 | 是否必填 |
|---|---|---|---|
| user | String | 收银员账号的UID | 必填 |
| sign | String | 签名 | 必填 |
| method | String | v3.PreauthDecrement | 必填 |
| time | Long | 时间戳 | 必填 |
- 参数
| 参数 | 类型 | 描述 | 是否必填 |
|---|---|---|---|
| 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=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=016683"
得到的 stringA 使用 secret_key做签名
得到的签名如下:
"17e307c0230854e96e56a1e1ab7abf90582f50dc3a7186614dd4082ba8055650"
提交示例:
{
"user": "016683",
"sign": "17e307c0230854e96e56a1e1ab7abf90582f50dc3a7186614dd4082ba8055650",
"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"
}
}
返回示例:
{
"status": true,
"code": "200",
"data": {
"order_id": "23505805395809345894869",
"trade_id": "160899f3-f6d9-a8d8-ab5b-82eacdab9c5b",
"amount": "1",
"currency": "EUR",
"state": "authorized"
},
"message": "",
"response_id": "202407111550570060848432"
}
更多信息:
返回结果:
若调用成功,则返回
"status": true若调用失败,则返回
"status": false
此接口用于减少预授权金额。同步就可获得调用结果,减少金额不可大于预授权金额。
返回代码:
| 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 |