合单下单-APP支付 
使用合单支付接口,用户只输入一次密码,即可完成多个订单的支付。目前最多一次可支持50笔订单进行合单支付。
| 请求参数 | 类型 | 描述 | 
|---|---|---|
| json | object | 声明请求的 JSON数据结构 | 
| combine_appid | string | 合单商户appid | 
| combine_mchid | string | 合单商户号 | 
| combine_out_trade_no | string | 合单商户订单号 | 
| scene_info | object | 场景信息 | 
| device_id | string | 商户端设备号 | 
| payer_client_ip | string | 用户终端IP | 
| sub_orders | object[] | 子单信息 | 
| mchid | string | 子单商户号 | 
| individual_auth_id | string | 商品单个人收款方受理授权ID | 
| individual_name | string | 商品单个人收款方平台昵称 | 
| attach | string | 附加数据 | 
| amount | object | 订单金额 | 
| total_amount | integer | 标价金额 | 
| currency | string | 标价币种 | 
| out_trade_no | string | 子单商户订单号 | 
| sub_mchid | string | 二级商户号 | 
| detail | string | 商品详情 | 
| goods_tag | string | 订单优惠标记 | 
| description | string | 商品描述 | 
| settle_info | object | 结算信息 | 
| profit_sharing | boolean | 是否指定分账 | 
| subsidy_amount | integer | 补差金额 | 
| sub_appid | string | 子商户应用ID | 
| combine_payer_info | object | 支付者 | 
| openid | string | 用户标识 | 
| identity | object | 实名支付(需单独申请权限) | 
| type | string | 证件类型 IDCARD枚举值 | 
| number | string | 加密后的证件号 | 
| name | string | 加密后的姓名 | 
| time_start | string | 交易起始时间 | 
| time_expire | string | 交易结束时间 | 
| prepay_id | string | 预支付交易会话标识 | 
| notify_url | string | 通知地址 | 
| trade_scenario | string | 交易场景 RECOMMERCE枚举值 | 
| limit_pay | string[] | 指定支付方式 no_balance|no_debit|balance_only枚举值之一 | 
| contract_info | object | 预签约信息 | 
| mchid | string | 签约商户号 | 
| appid | string | 签约商户AppID | 
| out_contract_code | string | 签约商户协议号 | 
| plan_id | number | 委托代扣协议模板ID | 
| contract_display_account | string | 用户账户展示名称 | 
| notify_url | string | 回调通知地址 | 
| subsidy_info | object | 贴息信息(微信分付) | 
| subsidy_detail | object[] | 贴息详情列表 | 
| subsidy_period_type | string | 贴息方案类型 DAILY|PERIOD枚举值之一 | 
| subsidy_plan | object[] | 贴息方案列表 | 
| subsidy_installment_num | integer | 贴息期数 3|6|12枚举值之一 | 
| subsidy_percent | integer | 贴息比例 0|100枚举值之一 | 
| headers | object | 声明请求的头参数 | 
| Wechatpay-Serial | string | 微信支付公钥ID/平台证书序列号 | 
php
$instance->v3->combineTransactions->app->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',
      'individual_auth_id' => '1900000109',
      'individual_name'    => '哈哈哈小店',
      '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',
      'identity' => [
        'type'   => 'IDCARD',
        'number' => '6B46824C852FA29AAC3DCE6BFD852E27',
        'name'   => '6B46824C852FA29AAC3DCE6BFD852E27',
      ],
    ],
    'time_start'           => '2019-12-31T15:59:60+08:00',
    'time_expire'          => '2019-12-31T15:59:60+08:00',
    'prepay_id'            => 'wx201410272009395522657a690389285100',
    'notify_url'           => 'https://yourapp.com/notify',
    'trade_scenario'       => 'RECOMMERCE',
    'limit_pay'            => ['no_balance'],
    'contract_info'        => [
      'mchid'                    => '1900000109',
      'appid'                    => 'wxd678efh567hg6787',
      'out_contract_code'        => 'wxwtdk20200910100000',
      'plan_id'                  => 12535,
      'contract_display_account' => '微信代扣用户A',
      'notify_url'               => 'https://yourapp.com/notify',
    ],
    'subsidy_info'         => [
      'subsidy_detail' => [[
        'subsidy_period_type' => 'PERIOD',
        'subsidy_plan'        => [[
          'subsidy_installment_num' => 3,
          'subsidy_percent'         => 100,
        ],],
      ],],
    ],
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();php
$instance->chain('v3/combine-transactions/app')->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',
      'individual_auth_id' => '1900000109',
      'individual_name'    => '哈哈哈小店',
      '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',
      'identity' => [
        'type'   => 'IDCARD',
        'number' => '6B46824C852FA29AAC3DCE6BFD852E27',
        'name'   => '6B46824C852FA29AAC3DCE6BFD852E27',
      ],
    ],
    'time_start'           => '2019-12-31T15:59:60+08:00',
    'time_expire'          => '2019-12-31T15:59:60+08:00',
    'prepay_id'            => 'wx201410272009395522657a690389285100',
    'notify_url'           => 'https://yourapp.com/notify',
    'trade_scenario'       => 'RECOMMERCE',
    'limit_pay'            => ['no_balance'],
    'contract_info'        => [
      'mchid'                    => '1900000109',
      'appid'                    => 'wxd678efh567hg6787',
      'out_contract_code'        => 'wxwtdk20200910100000',
      'plan_id'                  => 12535,
      'contract_display_account' => '微信代扣用户A',
      'notify_url'               => 'https://yourapp.com/notify',
    ],
    'subsidy_info'         => [
      'subsidy_detail' => [[
        'subsidy_period_type' => 'PERIOD',
        'subsidy_plan'        => [[
          'subsidy_installment_num' => 3,
          'subsidy_percent'         => 100,
        ],],
      ],],
    ],
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();php
$instance['v3/combine-transactions/app']->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',
      'individual_auth_id' => '1900000109',
      'individual_name'    => '哈哈哈小店',
      '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',
      'identity' => [
        'type'   => 'IDCARD',
        'number' => '6B46824C852FA29AAC3DCE6BFD852E27',
        'name'   => '6B46824C852FA29AAC3DCE6BFD852E27',
      ],
    ],
    'time_start'           => '2019-12-31T15:59:60+08:00',
    'time_expire'          => '2019-12-31T15:59:60+08:00',
    'prepay_id'            => 'wx201410272009395522657a690389285100',
    'notify_url'           => 'https://yourapp.com/notify',
    'trade_scenario'       => 'RECOMMERCE',
    'limit_pay'            => ['no_balance'],
    'contract_info'        => [
      'mchid'                    => '1900000109',
      'appid'                    => 'wxd678efh567hg6787',
      'out_contract_code'        => 'wxwtdk20200910100000',
      'plan_id'                  => 12535,
      'contract_display_account' => '微信代扣用户A',
      'notify_url'               => 'https://yourapp.com/notify',
    ],
    'subsidy_info'         => [
      'subsidy_detail' => [[
        'subsidy_period_type' => 'PERIOD',
        'subsidy_plan'        => [[
          'subsidy_installment_num' => 3,
          'subsidy_percent'         => 100,
        ],],
      ],],
    ],
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();php
$response = $instance->v3->combineTransactions->app->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',
      'individual_auth_id' => '1900000109',
      'individual_name'    => '哈哈哈小店',
      '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',
      'identity' => [
        'type'   => 'IDCARD',
        'number' => '6B46824C852FA29AAC3DCE6BFD852E27',
        'name'   => '6B46824C852FA29AAC3DCE6BFD852E27',
      ],
    ],
    'time_start'           => '2019-12-31T15:59:60+08:00',
    'time_expire'          => '2019-12-31T15:59:60+08:00',
    'prepay_id'            => 'wx201410272009395522657a690389285100',
    'notify_url'           => 'https://yourapp.com/notify',
    'trade_scenario'       => 'RECOMMERCE',
    'limit_pay'            => ['no_balance'],
    'contract_info'        => [
      'mchid'                    => '1900000109',
      'appid'                    => 'wxd678efh567hg6787',
      'out_contract_code'        => 'wxwtdk20200910100000',
      'plan_id'                  => 12535,
      'contract_display_account' => '微信代扣用户A',
      'notify_url'               => 'https://yourapp.com/notify',
    ],
    'subsidy_info'         => [
      'subsidy_detail' => [[
        'subsidy_period_type' => 'PERIOD',
        'subsidy_plan'        => [[
          'subsidy_installment_num' => 3,
          'subsidy_percent'         => 100,
        ],],
      ],],
    ],
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));php
$response = $instance->chain('v3/combine-transactions/app')->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',
      'individual_auth_id' => '1900000109',
      'individual_name'    => '哈哈哈小店',
      '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',
      'identity' => [
        'type'   => 'IDCARD',
        'number' => '6B46824C852FA29AAC3DCE6BFD852E27',
        'name'   => '6B46824C852FA29AAC3DCE6BFD852E27',
      ],
    ],
    'time_start'           => '2019-12-31T15:59:60+08:00',
    'time_expire'          => '2019-12-31T15:59:60+08:00',
    'prepay_id'            => 'wx201410272009395522657a690389285100',
    'notify_url'           => 'https://yourapp.com/notify',
    'trade_scenario'       => 'RECOMMERCE',
    'limit_pay'            => ['no_balance'],
    'contract_info'        => [
      'mchid'                    => '1900000109',
      'appid'                    => 'wxd678efh567hg6787',
      'out_contract_code'        => 'wxwtdk20200910100000',
      'plan_id'                  => 12535,
      'contract_display_account' => '微信代扣用户A',
      'notify_url'               => 'https://yourapp.com/notify',
    ],
    'subsidy_info'         => [
      'subsidy_detail' => [[
        'subsidy_period_type' => 'PERIOD',
        'subsidy_plan'        => [[
          'subsidy_installment_num' => 3,
          'subsidy_percent'         => 100,
        ],],
      ],],
    ],
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));php
$response = $instance['v3/combine-transactions/app']->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',
      'individual_auth_id' => '1900000109',
      'individual_name'    => '哈哈哈小店',
      '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',
      'identity' => [
        'type'   => 'IDCARD',
        'number' => '6B46824C852FA29AAC3DCE6BFD852E27',
        'name'   => '6B46824C852FA29AAC3DCE6BFD852E27',
      ],
    ],
    'time_start'           => '2019-12-31T15:59:60+08:00',
    'time_expire'          => '2019-12-31T15:59:60+08:00',
    'prepay_id'            => 'wx201410272009395522657a690389285100',
    'notify_url'           => 'https://yourapp.com/notify',
    'trade_scenario'       => 'RECOMMERCE',
    'limit_pay'            => ['no_balance'],
    'contract_info'        => [
      'mchid'                    => '1900000109',
      'appid'                    => 'wxd678efh567hg6787',
      'out_contract_code'        => 'wxwtdk20200910100000',
      'plan_id'                  => 12535,
      'contract_display_account' => '微信代扣用户A',
      'notify_url'               => 'https://yourapp.com/notify',
    ],
    'subsidy_info'         => [
      'subsidy_detail' => [[
        'subsidy_period_type' => 'PERIOD',
        'subsidy_plan'        => [[
          'subsidy_installment_num' => 3,
          'subsidy_percent'         => 100,
        ],],
      ],],
    ],
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));| 返回字典 | 类型 | 描述 | 
|---|---|---|
| prepay_id | string | 预支付交易会话标识 | 
| contract_result | object | 预签约结果 | 
| code | string | 签约结果码 | 
| message | string | 签约结果描述信息 |