支付订单。
POST /client/payment/order/pay/{orderId}
| 参数名 | 类型 | 描述 |
| x-merchant-token | String | 商户令牌 |
| x-merchant-code | String | 商户代码 |
| Content-Type | String | application/json |
| 参数名 | 类型 | 描述 |
| orderId | String | 订单ID,从下单返回值中获取 |
| 参数名 | 类型 | 描述 |
| payment | String | 支付方式,目前仅支持"BALANCE" |
{
"payment": "BALANCE"
}
fetch('/client/payment/order/pay/N2025032701271232584', {
method: 'POST',
headers: {
'x-merchant-token': 'your_token',
'x-merchant-code': 'your_code',
'Content-Type': 'application/json'
},
body: JSON.stringify({
payment: "BALANCE"
})
})
.then(response => response.json())
.then(data => console.log(data));
{
"msg": "操作成功",
"code": 200,
"data": {
"paymentType": "BALANCE",
"paymentName": "余额支付",
"status": 1
}
}
//错误返回
{"msg":"余额不足","code":500}
| 参数名 | 类型 | 描述 |
| paymentType | String | 支付方式(BALANCE=余额支付) |
| paymentName | String | 支付方式名称 |
| status | Integer | 支付状态(1=支付成功,0=支付失败) |
| 错误码 | 描述 |
| 500 | 订单已失效 |
| 500 | 商户钱包账户不存在 |
| 500 | 余额不足 |