Skip to content

撤销转账

商户通过转账接口发起付款后,在用户确认收款之前可以通过该接口撤销付款。该接口返回成功仅表示撤销请求已受理,系统会异步处理退款等操作,以最终查询单据返回状态为准。

请求参数类型描述
out_bill_nostring商户单号
jsonobject声明请求的JSON数据结构
sub_mchidstring二级商户号
php
$instance->v3->fundApp->mchTransfer->partner->transferBills->outBillNo->_out_bill_no_->cancel->postAsync([
  'out_bill_no' => 'plfk2020042013',
  'json' => [
    'sub_mchid' => '1900001121',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/fund-app/mch-transfer/partner/transfer-bills/out-bill-no/{out_bill_no}/cancel')->postAsync([
  'out_bill_no' => 'plfk2020042013',
  'json' => [
    'sub_mchid' => '1900001121',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/fund-app/mch-transfer/partner/transfer-bills/out-bill-no/{out_bill_no}/cancel']->postAsync([
  'out_bill_no' => 'plfk2020042013',
  'json' => [
    'sub_mchid' => '1900001121',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->fundApp->mchTransfer->partner->transferBills->outBillNo->_out_bill_no_->cancel->post([
  'out_bill_no' => 'plfk2020042013',
  'json' => [
    'sub_mchid' => '1900001121',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/fund-app/mch-transfer/partner/transfer-bills/out-bill-no/{out_bill_no}/cancel')->post([
  'out_bill_no' => 'plfk2020042013',
  'json' => [
    'sub_mchid' => '1900001121',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/fund-app/mch-transfer/partner/transfer-bills/out-bill-no/{out_bill_no}/cancel']->post([
  'out_bill_no' => 'plfk2020042013',
  'json' => [
    'sub_mchid' => '1900001121',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
sub_mchidstring二级商户号
out_bill_nostring商户单号
transfer_bill_nostring微信转账单号
statestring单据状态
ACCEPTED | PROCESSING | WAIT_USER_CONFIRM | TRANSFERING | SUCCESS | FAIL | CANCELING | CANCELLED 枚举值之一
transfer_amountnumber转账金额
transfer_remarkstring转账备注
fail_reasonstring失败原因
openidstring收款用户OpenID
user_namestring收款用户姓名
create_timestring单据创建时间
update_timestring最后一次单据状态变更时间

参阅 官方文档

Published on the GitHub by TheNorthMemory