Skip to content

合单下单-JSAPI支付

使用合单支付接口,用户只输入一次密码,即可完成多个订单的支付。目前最多一次可支持50笔订单进行合单支付。

请求参数类型描述
jsonobject声明请求的JSON数据结构
combine_appidstring合单商户appid
combine_mchidstring合单商户号
combine_out_trade_nostring合单商户订单号
scene_infoobject场景信息
device_idstring商户端设备号
payer_client_ipstring用户终端IP
sub_ordersobject[]子单信息
mchidstring子单商户号
attachstring附加数据
amountobject订单金额
total_amountinteger标价金额
currencystring标价币种
out_trade_nostring子单商户订单号
sub_mchidstring二级商户号
detailstring商品详情
goods_tagstring订单优惠标记
descriptionstring商品描述
settle_infoobject结算信息
profit_sharingboolean是否指定分账
subsidy_amountinteger补差金额
sub_appidstring子商户应用ID
combine_payer_infoobject支付者
openidstring用户标识
sub_openidstring用户子标识
time_startstring交易起始时间
time_expirestring交易结束时间
notify_urlstring通知地址
limit_paystring[]指定支付方式
no_balance | no_debit | balance_only 枚举值之一
php
$instance->v3->combineTransactions->jsapi->postAsync([
  'json' => [
    'combine_appid'        => 'wxd678efh567hg6787',
    'combine_mchid'        => '1900000109',
    'combine_out_trade_no' => 'P20150806125346',
    'scene_info'           => [
      'device_id'       => 'POS1:1',
      'payer_client_ip' => '14.17.22.32',
    ],
    'sub_orders'           => [[
      'mchid'        => '1900000109',
      'attach'       => '深圳分店',
      'amount'       => [
        'total_amount' => 100,
        'currency'     => 'CNY',
      ],
      'out_trade_no' => '20150806125346',
      'sub_mchid'    => '1900000109',
      'detail'       => '买单费用',
      'goods_tag'    => 'WXG',
      'description'  => '腾讯充值中心-QQ会员充值',
      'settle_info'  => [
        'profit_sharing' => true,
        'subsidy_amount' => 10,
      ],
      'sub_appid'    => 'wxd678efh567hg6999',
    ],],
    'combine_payer_info'   => [
      'openid'     => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
      'sub_openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    ],
    'time_start'           => '2019-12-31T15:59:60+08:00',
    'time_expire'          => '2019-12-31T15:59:60+08:00',
    'notify_url'           => 'https://yourapp.com/notify',
    'limit_pay'            => ['string'],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/combine-transactions/jsapi')->postAsync([
  'json' => [
    'combine_appid'        => 'wxd678efh567hg6787',
    'combine_mchid'        => '1900000109',
    'combine_out_trade_no' => 'P20150806125346',
    'scene_info'           => [
      'device_id'       => 'POS1:1',
      'payer_client_ip' => '14.17.22.32',
    ],
    'sub_orders'           => [[
      'mchid'        => '1900000109',
      'attach'       => '深圳分店',
      'amount'       => [
        'total_amount' => 100,
        'currency'     => 'CNY',
      ],
      'out_trade_no' => '20150806125346',
      'sub_mchid'    => '1900000109',
      'detail'       => '买单费用',
      'goods_tag'    => 'WXG',
      'description'  => '腾讯充值中心-QQ会员充值',
      'settle_info'  => [
        'profit_sharing' => true,
        'subsidy_amount' => 10,
      ],
      'sub_appid'    => 'wxd678efh567hg6999',
    ],],
    'combine_payer_info'   => [
      'openid'     => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
      'sub_openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    ],
    'time_start'           => '2019-12-31T15:59:60+08:00',
    'time_expire'          => '2019-12-31T15:59:60+08:00',
    'notify_url'           => 'https://yourapp.com/notify',
    'limit_pay'            => ['string'],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/combine-transactions/jsapi']->postAsync([
  'json' => [
    'combine_appid'        => 'wxd678efh567hg6787',
    'combine_mchid'        => '1900000109',
    'combine_out_trade_no' => 'P20150806125346',
    'scene_info'           => [
      'device_id'       => 'POS1:1',
      'payer_client_ip' => '14.17.22.32',
    ],
    'sub_orders'           => [[
      'mchid'        => '1900000109',
      'attach'       => '深圳分店',
      'amount'       => [
        'total_amount' => 100,
        'currency'     => 'CNY',
      ],
      'out_trade_no' => '20150806125346',
      'sub_mchid'    => '1900000109',
      'detail'       => '买单费用',
      'goods_tag'    => 'WXG',
      'description'  => '腾讯充值中心-QQ会员充值',
      'settle_info'  => [
        'profit_sharing' => true,
        'subsidy_amount' => 10,
      ],
      'sub_appid'    => 'wxd678efh567hg6999',
    ],],
    'combine_payer_info'   => [
      'openid'     => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
      'sub_openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    ],
    'time_start'           => '2019-12-31T15:59:60+08:00',
    'time_expire'          => '2019-12-31T15:59:60+08:00',
    'notify_url'           => 'https://yourapp.com/notify',
    'limit_pay'            => ['string'],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->combineTransactions->jsapi->post([
  'json' => [
    'combine_appid'        => 'wxd678efh567hg6787',
    'combine_mchid'        => '1900000109',
    'combine_out_trade_no' => 'P20150806125346',
    'scene_info'           => [
      'device_id'       => 'POS1:1',
      'payer_client_ip' => '14.17.22.32',
    ],
    'sub_orders'           => [[
      'mchid'        => '1900000109',
      'attach'       => '深圳分店',
      'amount'       => [
        'total_amount' => 100,
        'currency'     => 'CNY',
      ],
      'out_trade_no' => '20150806125346',
      'sub_mchid'    => '1900000109',
      'detail'       => '买单费用',
      'goods_tag'    => 'WXG',
      'description'  => '腾讯充值中心-QQ会员充值',
      'settle_info'  => [
        'profit_sharing' => true,
        'subsidy_amount' => 10,
      ],
      'sub_appid'    => 'wxd678efh567hg6999',
    ],],
    'combine_payer_info'   => [
      'openid'     => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
      'sub_openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    ],
    'time_start'           => '2019-12-31T15:59:60+08:00',
    'time_expire'          => '2019-12-31T15:59:60+08:00',
    'notify_url'           => 'https://yourapp.com/notify',
    'limit_pay'            => ['string'],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/combine-transactions/jsapi')->post([
  'json' => [
    'combine_appid'        => 'wxd678efh567hg6787',
    'combine_mchid'        => '1900000109',
    'combine_out_trade_no' => 'P20150806125346',
    'scene_info'           => [
      'device_id'       => 'POS1:1',
      'payer_client_ip' => '14.17.22.32',
    ],
    'sub_orders'           => [[
      'mchid'        => '1900000109',
      'attach'       => '深圳分店',
      'amount'       => [
        'total_amount' => 100,
        'currency'     => 'CNY',
      ],
      'out_trade_no' => '20150806125346',
      'sub_mchid'    => '1900000109',
      'detail'       => '买单费用',
      'goods_tag'    => 'WXG',
      'description'  => '腾讯充值中心-QQ会员充值',
      'settle_info'  => [
        'profit_sharing' => true,
        'subsidy_amount' => 10,
      ],
      'sub_appid'    => 'wxd678efh567hg6999',
    ],],
    'combine_payer_info'   => [
      'openid'     => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
      'sub_openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    ],
    'time_start'           => '2019-12-31T15:59:60+08:00',
    'time_expire'          => '2019-12-31T15:59:60+08:00',
    'notify_url'           => 'https://yourapp.com/notify',
    'limit_pay'            => ['string'],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/combine-transactions/jsapi']->post([
  'json' => [
    'combine_appid'        => 'wxd678efh567hg6787',
    'combine_mchid'        => '1900000109',
    'combine_out_trade_no' => 'P20150806125346',
    'scene_info'           => [
      'device_id'       => 'POS1:1',
      'payer_client_ip' => '14.17.22.32',
    ],
    'sub_orders'           => [[
      'mchid'        => '1900000109',
      'attach'       => '深圳分店',
      'amount'       => [
        'total_amount' => 100,
        'currency'     => 'CNY',
      ],
      'out_trade_no' => '20150806125346',
      'sub_mchid'    => '1900000109',
      'detail'       => '买单费用',
      'goods_tag'    => 'WXG',
      'description'  => '腾讯充值中心-QQ会员充值',
      'settle_info'  => [
        'profit_sharing' => true,
        'subsidy_amount' => 10,
      ],
      'sub_appid'    => 'wxd678efh567hg6999',
    ],],
    'combine_payer_info'   => [
      'openid'     => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
      'sub_openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    ],
    'time_start'           => '2019-12-31T15:59:60+08:00',
    'time_expire'          => '2019-12-31T15:59:60+08:00',
    'notify_url'           => 'https://yourapp.com/notify',
    'limit_pay'            => ['string'],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
prepay_idstring预支付交易会话标识

参阅 官方文档

Published on the GitHub by TheNorthMemory