Skip to content

完结分账

1、不需要进行分账的订单,可直接调用本接口将订单的金额全部解冻给特约商户 2、调用多次分账接口后,需要解冻剩余资金时,调用本接口将剩余的分账金额全部解冻给特约商户 3、已调用请求单次分账后,剩余待分账金额为零,不需要再调用此接口。

请求参数类型描述
securitytrue声明加载商户API证书
xmlobject声明请求的XML数据结构
mch_idstring商户号
sub_mch_idstring子商户号
appidstring公众账号ID
sign_typestring签名类型
HMAC-SHA256 枚举值
transaction_idstring微信订单号
out_order_nostring商户分账单号
descriptionstring分账完结描述
php
$instance->v2->secapi->pay->profitsharingfinish->postAsync([
  'security' => true,
  'xml' => [
    'mch_id'         => '1900000100',
    'sub_mch_id'     => '1900000109',
    'appid'          => 'wx8888888888888888',
    'sign_type'      => 'HMAC-SHA256',
    'transaction_id' => '4208450740201411110007820472',
    'out_order_no'   => 'P20150806125346',
    'description'    => '分账已完成',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance->chain('v2/secapi/pay/profitsharingfinish')->postAsync([
  'security' => true,
  'xml' => [
    'mch_id'         => '1900000100',
    'sub_mch_id'     => '1900000109',
    'appid'          => 'wx8888888888888888',
    'sign_type'      => 'HMAC-SHA256',
    'transaction_id' => '4208450740201411110007820472',
    'out_order_no'   => 'P20150806125346',
    'description'    => '分账已完成',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance['v2/secapi/pay/profitsharingfinish']->postAsync([
  'security' => true,
  'xml' => [
    'mch_id'         => '1900000100',
    'sub_mch_id'     => '1900000109',
    'appid'          => 'wx8888888888888888',
    'sign_type'      => 'HMAC-SHA256',
    'transaction_id' => '4208450740201411110007820472',
    'out_order_no'   => 'P20150806125346',
    'description'    => '分账已完成',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$response = $instance->v2->secapi->pay->profitsharingfinish->post([
  'security' => true,
  'xml' => [
    'mch_id'         => '1900000100',
    'sub_mch_id'     => '1900000109',
    'appid'          => 'wx8888888888888888',
    'sign_type'      => 'HMAC-SHA256',
    'transaction_id' => '4208450740201411110007820472',
    'out_order_no'   => 'P20150806125346',
    'description'    => '分账已完成',
  ],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance->chain('v2/secapi/pay/profitsharingfinish')->post([
  'security' => true,
  'xml' => [
    'mch_id'         => '1900000100',
    'sub_mch_id'     => '1900000109',
    'appid'          => 'wx8888888888888888',
    'sign_type'      => 'HMAC-SHA256',
    'transaction_id' => '4208450740201411110007820472',
    'out_order_no'   => 'P20150806125346',
    'description'    => '分账已完成',
  ],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance['v2/secapi/pay/profitsharingfinish']->post([
  'security' => true,
  'xml' => [
    'mch_id'         => '1900000100',
    'sub_mch_id'     => '1900000109',
    'appid'          => 'wx8888888888888888',
    'sign_type'      => 'HMAC-SHA256',
    'transaction_id' => '4208450740201411110007820472',
    'out_order_no'   => 'P20150806125346',
    'description'    => '分账已完成',
  ],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
返回字典类型描述
sub_appidstring子商户公众账号ID
sub_mch_idstring子商户号
return_codestring返回状态码
SUCCESS | FAIL 枚举值之一
return_msgstring返回信息
appidstring公众账号ID
mch_idstring商户号
nonce_strstring随机字符串
signstring签名
result_codestring业务结果
SUCCESS | FAIL 枚举值之一
err_codestring错误代码
err_code_desstring错误代码描述
transaction_idstring微信订单号
out_order_nostring商户分账单号
order_idstring微信分账单号

参阅 官方文档 官方文档

Published on the GitHub by TheNorthMemory