发起还款
商户在发起还款之前,需要先调用预约还款接口;只有成功预约还款之后才能发起还款
| 请求参数 | 类型 | 描述 |
|---|---|---|
| json | object | 声明请求的JSON数据结构 |
| contract_id | string | 还款协议ID |
| out_trade_no | string | 商户侧交易单号 |
| out_record_id | string | 商户侧预约还款单号 |
| deduct_amount | string | 还款金额 |
| notify_url | string | 商户回调地址 |
php
$instance->v3->creditRepayment->partner->deductOrders->postAsync([
'json' => [
'contract_id' => '20251105000000123456789',
'out_trade_no' => '1217752501201407033233368018',
'out_record_id' => '1234567abcde',
'deduct_amount' => '10000',
'notify_url' => 'wxd678efh567hg6787',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();php
$instance->chain('v3/credit-repayment/partner/deduct-orders')->postAsync([
'json' => [
'contract_id' => '20251105000000123456789',
'out_trade_no' => '1217752501201407033233368018',
'out_record_id' => '1234567abcde',
'deduct_amount' => '10000',
'notify_url' => 'wxd678efh567hg6787',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();php
$instance['v3/credit-repayment/partner/deduct-orders']->postAsync([
'json' => [
'contract_id' => '20251105000000123456789',
'out_trade_no' => '1217752501201407033233368018',
'out_record_id' => '1234567abcde',
'deduct_amount' => '10000',
'notify_url' => 'wxd678efh567hg6787',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();php
$response = $instance->v3->creditRepayment->partner->deductOrders->post([
'json' => [
'contract_id' => '20251105000000123456789',
'out_trade_no' => '1217752501201407033233368018',
'out_record_id' => '1234567abcde',
'deduct_amount' => '10000',
'notify_url' => 'wxd678efh567hg6787',
],
]);
print_r(json_decode((string) $response->getBody(), true));php
$response = $instance->chain('v3/credit-repayment/partner/deduct-orders')->post([
'json' => [
'contract_id' => '20251105000000123456789',
'out_trade_no' => '1217752501201407033233368018',
'out_record_id' => '1234567abcde',
'deduct_amount' => '10000',
'notify_url' => 'wxd678efh567hg6787',
],
]);
print_r(json_decode((string) $response->getBody(), true));php
$response = $instance['v3/credit-repayment/partner/deduct-orders']->post([
'json' => [
'contract_id' => '20251105000000123456789',
'out_trade_no' => '1217752501201407033233368018',
'out_record_id' => '1234567abcde',
'deduct_amount' => '10000',
'notify_url' => 'wxd678efh567hg6787',
],
]);
print_r(json_decode((string) $response->getBody(), true));| 返回字典 | 类型 | 描述 |
|---|---|---|
| out_trade_no | string | 商户侧交易单号 |
| out_record_id | string | 商户侧预约还款单号 |
| appid | string | 商户AppID |
| sub_appid | string | 子商户AppID |
| openid | string | 用户标识 |
| contract_id | string | 还款协议ID |
| order_state | string | 还款单状态DEDUCT_ORDER_STATE_PENDING | DEDUCT_ORDER_STATE_NOT_PAY | DEDUCT_ORDER_STATE_PAY_SUCCESS | DEDUCT_ORDER_STATE_PAY_FAIL 枚举值之一 |
| deduct_amount | string | 还款金额 |
| pay_success_amount | string | 实际还款金额 |
| description | string | 产品描述 |
| attach | string | 商户数据包 |
| transaction_id | string | 微信支付的支付单号 |
参阅 官方文档