取消支付
该API用于取消支付订单,包括未支付、已支付或者已完成预授权的任何支付订单
如果没有收到YabandPay的最终支付结果(成功或者失败),或者想关闭支付订单,可以调用本接口将支付订单取消。
[!TIP|style:flat]
时间限制:支付订单只能在约定时间内进行取消操作,即从交易发起到第二天30分钟内 (T+1日00:30 ),欧洲中部时区。
金额限制:必须全额取消,不支持部分金额取消。
退款限制:如果支付订单进行了任何退款操作,那么不能被取消。
结算以及费用:支付订单被取消以后不会进行清结算,YabandPay也不会收取任何交易费用。
API URL:https://mapi.yabandpay.com/Payments
Method:POST
POST data type:Json
参数 | 类型 | 描述 | 是否必填 |
---|---|---|---|
user | String | 收银员账号的UID | 必填 |
sign | String | 签名 | 必填 |
method | String | v3.CancelPayment | 必填 |
time | Long | 时间戳 | 必填 |
- 参数
参数 | 类型 | 描述 | 是否必填 |
---|---|---|---|
trade_id | String | YabandPay订单编号 | 必填 |
签名示例:
拼接为URL方式并排序后的字符串
"method=v3.CancelPayment&time=1546588959&trade_id=4a49ffb3-a30f-ba92-9422-1969afb6f121&user=016683"
得到的 stringA 使用 secret_key做签名
得到的签名如下:
"ce35c72989dbda9a3393f4c2810ea71bd7755dd25061f1ae8073aea8e2db6dbe"
提交示例:
{
"user": "016683",
"sign": "ce35c72989dbda9a3393f4c2810ea71bd7755dd25061f1ae8073aea8e2db6dbe",
"method": "v3.CancelPayment",
"time": 1546588959,
"data": {
"trade_id": "4a49ffb3-a30f-ba92-9422-1969afb6f121"
}
}
返回示例:
{
"status": true,
"code": "200",
"data": {
"type": "payment",
"user": "016683",
"amount": "0.10",
"currency": "EUR",
"trade_id": "4a49ffb3-a30f-ba92-9422-1969afb6f121",
"description": "YabandPay test",
"order_id": "280244567856723026",
"createDate": "1706771212",
"demo": "test",
"transaction_id": "",
"state": "cancelled"
},
"message": ""
}
更多信息:
返回结果:
- 若取消成功,则返回
"status": true
- 若取消失败,则返回
"status": fales
可以通过调用订单查询查询订单状态,如果订单状态state
为cancelled
,即取消成功。
返回代码:
Status | Code | Message |
---|---|---|
true | 200 | |
fales | -4111 | Exceed cancel window |
fales | -4112 | The transaction has been cleared cannot be cancelled |
fales | -4114 | The trade_id does not exist |
fales | -4115 | The transaction cannot be cancelled |
fales | -4116 | The transaction has been cancelled |
fales | -4117 | The transaction has been Expired |