Skip to content

电商合单委托代扣支付

商户可以通过该接口发起免密的合单支付

请求参数类型描述
jsonobject声明请求的JSON数据结构
combine_appidstring合单商户appid
combine_mchidstring合单商户号
combine_out_trade_nostring合单商户订单号
contract_idstring委托代扣协议ID
sub_ordersobject[]子单信息
mchidstring子单商户号
attachstring附加数据
amountobject订单金额
total_amountinteger标价金额
currencystring标价币种
out_trade_nostring子单商户订单号
sub_mchidstring二级商户号
sub_appidstring二级商户appid
descriptionstring商品描述
settle_infoobject结算信息
profit_sharingboolean是否指定分账
subsidy_amountinteger补差金额
php
$instance->v3->ecommerce->combinePapay->transactions->postAsync([
  'json' => [
    'combine_appid' => 'wxd678efh567hg6787',
    'combine_mchid' => '1900000109',
    'combine_out_trade_no' => 'P20150806125346',
    'contract_id' => '123124412412423431',
    'sub_orders' => [[
      'mchid' => '1900000109',
      'attach' => '深圳分店',
      'amount' => [
        'total_amount' => 100,
        'currency' => 'CNY',
      ],
      'out_trade_no' => '20150806125346',
      'sub_mchid' => '1900000109',
      'sub_appid' => 'wxd678efh567hg6787',
      'description' => '腾讯充值中心-QQ会员充值',
      'settle_info' => [
        'profit_sharing' => true,
        'subsidy_amount' => 10,
      ],
    ],],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/ecommerce/combine-papay/transactions')->postAsync([
  'json' => [
    'combine_appid' => 'wxd678efh567hg6787',
    'combine_mchid' => '1900000109',
    'combine_out_trade_no' => 'P20150806125346',
    'contract_id' => '123124412412423431',
    'sub_orders' => [[
      'mchid' => '1900000109',
      'attach' => '深圳分店',
      'amount' => [
        'total_amount' => 100,
        'currency' => 'CNY',
      ],
      'out_trade_no' => '20150806125346',
      'sub_mchid' => '1900000109',
      'sub_appid' => 'wxd678efh567hg6787',
      'description' => '腾讯充值中心-QQ会员充值',
      'settle_info' => [
        'profit_sharing' => true,
        'subsidy_amount' => 10,
      ],
    ],],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/ecommerce/combine-papay/transactions']->postAsync([
  'json' => [
    'combine_appid' => 'wxd678efh567hg6787',
    'combine_mchid' => '1900000109',
    'combine_out_trade_no' => 'P20150806125346',
    'contract_id' => '123124412412423431',
    'sub_orders' => [[
      'mchid' => '1900000109',
      'attach' => '深圳分店',
      'amount' => [
        'total_amount' => 100,
        'currency' => 'CNY',
      ],
      'out_trade_no' => '20150806125346',
      'sub_mchid' => '1900000109',
      'sub_appid' => 'wxd678efh567hg6787',
      'description' => '腾讯充值中心-QQ会员充值',
      'settle_info' => [
        'profit_sharing' => true,
        'subsidy_amount' => 10,
      ],
    ],],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->ecommerce->combinePapay->transactions->post([
  'json' => [
    'combine_appid' => 'wxd678efh567hg6787',
    'combine_mchid' => '1900000109',
    'combine_out_trade_no' => 'P20150806125346',
    'contract_id' => '123124412412423431',
    'sub_orders' => [[
      'mchid' => '1900000109',
      'attach' => '深圳分店',
      'amount' => [
        'total_amount' => 100,
        'currency' => 'CNY',
      ],
      'out_trade_no' => '20150806125346',
      'sub_mchid' => '1900000109',
      'sub_appid' => 'wxd678efh567hg6787',
      'description' => '腾讯充值中心-QQ会员充值',
      'settle_info' => [
        'profit_sharing' => true,
        'subsidy_amount' => 10,
      ],
    ],],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/ecommerce/combine-papay/transactions')->post([
  'json' => [
    'combine_appid' => 'wxd678efh567hg6787',
    'combine_mchid' => '1900000109',
    'combine_out_trade_no' => 'P20150806125346',
    'contract_id' => '123124412412423431',
    'sub_orders' => [[
      'mchid' => '1900000109',
      'attach' => '深圳分店',
      'amount' => [
        'total_amount' => 100,
        'currency' => 'CNY',
      ],
      'out_trade_no' => '20150806125346',
      'sub_mchid' => '1900000109',
      'sub_appid' => 'wxd678efh567hg6787',
      'description' => '腾讯充值中心-QQ会员充值',
      'settle_info' => [
        'profit_sharing' => true,
        'subsidy_amount' => 10,
      ],
    ],],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/ecommerce/combine-papay/transactions']->post([
  'json' => [
    'combine_appid' => 'wxd678efh567hg6787',
    'combine_mchid' => '1900000109',
    'combine_out_trade_no' => 'P20150806125346',
    'contract_id' => '123124412412423431',
    'sub_orders' => [[
      'mchid' => '1900000109',
      'attach' => '深圳分店',
      'amount' => [
        'total_amount' => 100,
        'currency' => 'CNY',
      ],
      'out_trade_no' => '20150806125346',
      'sub_mchid' => '1900000109',
      'sub_appid' => 'wxd678efh567hg6787',
      'description' => '腾讯充值中心-QQ会员充值',
      'settle_info' => [
        'profit_sharing' => true,
        'subsidy_amount' => 10,
      ],
    ],],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
combine_appidstring合单商户APPID
combine_mchidstring合单商户号
combine_out_trade_nostring合单商户订单号
sub_ordersobject[]子单信息
mchidstring子单商户号
trade_typestring交易类型
trade_statestring交易状态
bank_typestring付款银行
attachstring附加数据
success_timestring支付完成时间
transaction_idstring子单微信订单号
out_trade_nostring子单商户订单号
sub_mchidstring二级商户号
sub_appidstring二级商户appid
amountobject订单金额
total_amountinteger标价金额
currencystring标价币种
payer_amountinteger现金支付金额
payer_currencystring现金支付币种
combine_payer_infoobject支付者
openidstring用户标识

参阅 官方文档

Published on the GitHub by TheNorthMemory