Skip to content

个人收款交易下单-小程序

使用个人收款交易接口,可支持为个人收款方在微信支付服务后台生成与支付交易单,返回正确的预支付交易会话标识后按照交易场景调起支付。

请求参数类型描述
jsonobject声明请求的JSON数据结构
combine_appidstring平台商户应用ID
combine_mchidstring平台商户号
combine_out_trade_nostring交易单订单号
combine_payer_infoobject支付者
openidstring用户标识
scene_infoobject场景信息
device_idstring商户端设备号
payer_client_ipstring用户终端IP
sub_ordersobject[]商品单信息
mchidstring商品单发起商户号
individual_auth_idstring商品单个人收款方受理授权ID
individual_namestring商品单个人收款方平台昵称
out_trade_nostring商品单订单号
amountobject商品单金额
total_amountnumber标价金额
currencystring标价币种
attachstring附加数据
descriptionstring商品描述
time_expirestring交易结束时间
notify_urlstring通知地址
trade_scenariostring交易场景
RECOMMERCE 枚举值
php
$instance->v3->combineTransactions->miniprogram->postAsync([
  'json' => [
    'combine_appid'        => 'wxd678efh567hg6787',
    'combine_mchid'        => '1230000109',
    'combine_out_trade_no' => 'P20150806125346',
    'combine_payer_info'   => [
      'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    ],
    'scene_info'           => [
      'device_id'       => 'POS1:1',
      'payer_client_ip' => '127.0.0.1',
    ],
    'sub_orders'           => [[
      'mchid'              => '1230000109',
      'individual_auth_id' => '1900000109',
      'individual_name'    => '哈哈哈小店',
      'out_trade_no'       => '20150806125346',
      'amount'             => [
        'total_amount' => 10,
        'currency'     => 'CNY',
      ],
      'attach'             => '深圳分店',
      'description'        => 'Image形象店-深圳腾大-QQ公仔',
    ],],
    'time_expire'          => '2018-06-08T10:34:56+08:00',
    'notify_url'           => 'https://yourapp.com/notify',
    'trade_scenario'       => 'RECOMMERCE',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/combine-transactions/miniprogram')->postAsync([
  'json' => [
    'combine_appid'        => 'wxd678efh567hg6787',
    'combine_mchid'        => '1230000109',
    'combine_out_trade_no' => 'P20150806125346',
    'combine_payer_info'   => [
      'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    ],
    'scene_info'           => [
      'device_id'       => 'POS1:1',
      'payer_client_ip' => '127.0.0.1',
    ],
    'sub_orders'           => [[
      'mchid'              => '1230000109',
      'individual_auth_id' => '1900000109',
      'individual_name'    => '哈哈哈小店',
      'out_trade_no'       => '20150806125346',
      'amount'             => [
        'total_amount' => 10,
        'currency'     => 'CNY',
      ],
      'attach'             => '深圳分店',
      'description'        => 'Image形象店-深圳腾大-QQ公仔',
    ],],
    'time_expire'          => '2018-06-08T10:34:56+08:00',
    'notify_url'           => 'https://yourapp.com/notify',
    'trade_scenario'       => 'RECOMMERCE',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/combine-transactions/miniprogram']->postAsync([
  'json' => [
    'combine_appid'        => 'wxd678efh567hg6787',
    'combine_mchid'        => '1230000109',
    'combine_out_trade_no' => 'P20150806125346',
    'combine_payer_info'   => [
      'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    ],
    'scene_info'           => [
      'device_id'       => 'POS1:1',
      'payer_client_ip' => '127.0.0.1',
    ],
    'sub_orders'           => [[
      'mchid'              => '1230000109',
      'individual_auth_id' => '1900000109',
      'individual_name'    => '哈哈哈小店',
      'out_trade_no'       => '20150806125346',
      'amount'             => [
        'total_amount' => 10,
        'currency'     => 'CNY',
      ],
      'attach'             => '深圳分店',
      'description'        => 'Image形象店-深圳腾大-QQ公仔',
    ],],
    'time_expire'          => '2018-06-08T10:34:56+08:00',
    'notify_url'           => 'https://yourapp.com/notify',
    'trade_scenario'       => 'RECOMMERCE',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->combineTransactions->miniprogram->post([
  'json' => [
    'combine_appid'        => 'wxd678efh567hg6787',
    'combine_mchid'        => '1230000109',
    'combine_out_trade_no' => 'P20150806125346',
    'combine_payer_info'   => [
      'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    ],
    'scene_info'           => [
      'device_id'       => 'POS1:1',
      'payer_client_ip' => '127.0.0.1',
    ],
    'sub_orders'           => [[
      'mchid'              => '1230000109',
      'individual_auth_id' => '1900000109',
      'individual_name'    => '哈哈哈小店',
      'out_trade_no'       => '20150806125346',
      'amount'             => [
        'total_amount' => 10,
        'currency'     => 'CNY',
      ],
      'attach'             => '深圳分店',
      'description'        => 'Image形象店-深圳腾大-QQ公仔',
    ],],
    'time_expire'          => '2018-06-08T10:34:56+08:00',
    'notify_url'           => 'https://yourapp.com/notify',
    'trade_scenario'       => 'RECOMMERCE',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/combine-transactions/miniprogram')->post([
  'json' => [
    'combine_appid'        => 'wxd678efh567hg6787',
    'combine_mchid'        => '1230000109',
    'combine_out_trade_no' => 'P20150806125346',
    'combine_payer_info'   => [
      'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    ],
    'scene_info'           => [
      'device_id'       => 'POS1:1',
      'payer_client_ip' => '127.0.0.1',
    ],
    'sub_orders'           => [[
      'mchid'              => '1230000109',
      'individual_auth_id' => '1900000109',
      'individual_name'    => '哈哈哈小店',
      'out_trade_no'       => '20150806125346',
      'amount'             => [
        'total_amount' => 10,
        'currency'     => 'CNY',
      ],
      'attach'             => '深圳分店',
      'description'        => 'Image形象店-深圳腾大-QQ公仔',
    ],],
    'time_expire'          => '2018-06-08T10:34:56+08:00',
    'notify_url'           => 'https://yourapp.com/notify',
    'trade_scenario'       => 'RECOMMERCE',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/combine-transactions/miniprogram']->post([
  'json' => [
    'combine_appid'        => 'wxd678efh567hg6787',
    'combine_mchid'        => '1230000109',
    'combine_out_trade_no' => 'P20150806125346',
    'combine_payer_info'   => [
      'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    ],
    'scene_info'           => [
      'device_id'       => 'POS1:1',
      'payer_client_ip' => '127.0.0.1',
    ],
    'sub_orders'           => [[
      'mchid'              => '1230000109',
      'individual_auth_id' => '1900000109',
      'individual_name'    => '哈哈哈小店',
      'out_trade_no'       => '20150806125346',
      'amount'             => [
        'total_amount' => 10,
        'currency'     => 'CNY',
      ],
      'attach'             => '深圳分店',
      'description'        => 'Image形象店-深圳腾大-QQ公仔',
    ],],
    'time_expire'          => '2018-06-08T10:34:56+08:00',
    'notify_url'           => 'https://yourapp.com/notify',
    'trade_scenario'       => 'RECOMMERCE',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
prepay_idstring预支付交易会话标识

参阅 官方文档

Published on the GitHub by TheNorthMemory