Skip to content

发起还款

商户在发起还款之前,需要先调用预约还款接口;只有成功预约还款之后才能发起还款

请求参数类型描述
jsonobject声明请求的JSON数据结构
contract_idstring还款协议ID
out_trade_nostring商户侧交易单号
out_record_idstring商户侧预约还款单号
deduct_amountstring还款金额
notify_urlstring商户回调地址
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_nostring商户侧交易单号
out_record_idstring商户侧预约还款单号
appidstring商户AppID
sub_appidstring子商户AppID
openidstring用户标识
contract_idstring还款协议ID
order_statestring还款单状态
DEDUCT_ORDER_STATE_PENDING | DEDUCT_ORDER_STATE_NOT_PAY | DEDUCT_ORDER_STATE_PAY_SUCCESS | DEDUCT_ORDER_STATE_PAY_FAIL 枚举值之一
deduct_amountstring还款金额
pay_success_amountstring实际还款金额
descriptionstring产品描述
attachstring商户数据包
transaction_idstring微信支付的支付单号

参阅 官方文档

Published on the GitHub by TheNorthMemory