Skip to content

从业机构创建先用后付订单

创建微信支付分先用后付订单

请求参数类型描述
jsonobject声明请求的JSON数据结构
out_order_nostring商户服务订单号
appidstring公众账号ID
sub_mchidstring子商户号
sub_appidstring子商户应用ID
channel_idstring渠道商商户号
service_idstring服务ID
service_introductionstring服务信息
post_paymentsobject[]后付费项目
namestring付费项目名称
amountinteger金额
descriptionstring计费说明
countinteger付费数量
post_discountsobject[]后付费商户优惠
namestring优惠名称
descriptionstring优惠说明
amountinteger优惠金额
countinteger优惠数量
time_rangeobject服务时间段
start_timestring服务开始时间
start_time_remarkstring服务开始时间备注
end_timestring服务结束时间
end_time_remarkstring服务结束时间备注
locationobject服务位置
start_locationstring服务开始地点
end_locationstring服务结束地点
risk_fundobject订单风险金
namestring风险金名称
DEPOSIT | ADVANCE | CASH_DEPOSIT | ESTIMATE_ORDER_COST 枚举值之一
amountinteger风险金额
descriptionstring风险说明
attachstring商户数据包
notify_urlstring商户回调地址
openidstring用户标识
sub_openidstring子商户公众号下的用户标识
need_user_confirmboolean是否需要用户确认
mchidstring商户号
shopping_infoobject先用后付购物详情
real_merchant_appidstring实际购物商家公众号ID
jump_linkobject单详跳转链接
jump_link_typestring跳转链接类型
JUMP_LINK_MINI_PROGRAM 枚举值
appidstring小程序跳转AppID
pathstring小程序跳转path
goodsobject[]商品列表
namestring商品名称
picturestring商品图片链接
amountinteger商品单价金额
countinteger商品数量
php
$instance->v3->payscore->acquiringbank->servicepayondeliveryorder->postAsync([
  'json' => [
    'out_order_no'         => '1234323JKHDFE1243252',
    'appid'                => 'wxd678efh567hg6787',
    'sub_mchid'            => '1900000109',
    'sub_appid'            => 'wxd678efh567hg6999',
    'channel_id'           => '1230000109',
    'service_id'           => '500001',
    'service_introduction' => '某某酒店',
    'post_payments'        => [[
      'name'        => '就餐费用, 服务费',
      'amount'      => 40000,
      'description' => '就餐人均100元,服务费:100/小时',
      'count'       => 4,
    ],],
    'post_discounts'       => [[
      'name'        => '满20减1元',
      'description' => '不与其他优惠叠加',
      'amount'      => 100,
      'count'       => 2,
    ],],
    'time_range'           => [
      'start_time'        => '20091225091010',
      'start_time_remark' => '备注1',
      'end_time'          => '20091225121010',
      'end_time_remark'   => '备注2',
    ],
    'location'             => [
      'start_location' => '嗨客时尚主题展餐厅',
      'end_location'   => '嗨客时尚主题展餐厅',
    ],
    'risk_fund'            => [
      'name'        => 'DEPOSIT',
      'amount'      => 10000,
      'description' => '就餐的预估费用',
    ],
    'attach'               => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
    'notify_url'           => 'https://api.test.com',
    'openid'               => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'sub_openid'           => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'need_user_confirm'    => true,
    'mchid'                => '1230000109',
    'shopping_info'        => [
      'real_merchant_appid' => 'wxd678efh567hg6787',
      'jump_link'           => [
        'jump_link_type' => 'JUMP_LINK_MINI_PROGRAM',
        'appid'          => '',
        'path'           => '',
      ],
      'goods'               => [[
        'name'    => '森海塞尔 MOMENTUM 4 无线耳机大馒头4 头戴式蓝牙音乐耳机自适应降噪',
        'picture' => 'http://mmbiz.qpic.cn/mmbiz_png/ldTw9dg46zkjOrzyTkbQAvQkysliaiblZhdthZWewgQMyqLZwStaNEsJrYmjwh2MlK7G4wibAFOEuISQKplSnxMWA/640?wx_fmt=png&wxfrom=200',
        'amount'  => 40000,
        'count'   => 4,
      ],],
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/payscore/acquiringbank/servicepayondeliveryorder')->postAsync([
  'json' => [
    'out_order_no'         => '1234323JKHDFE1243252',
    'appid'                => 'wxd678efh567hg6787',
    'sub_mchid'            => '1900000109',
    'sub_appid'            => 'wxd678efh567hg6999',
    'channel_id'           => '1230000109',
    'service_id'           => '500001',
    'service_introduction' => '某某酒店',
    'post_payments'        => [[
      'name'        => '就餐费用, 服务费',
      'amount'      => 40000,
      'description' => '就餐人均100元,服务费:100/小时',
      'count'       => 4,
    ],],
    'post_discounts'       => [[
      'name'        => '满20减1元',
      'description' => '不与其他优惠叠加',
      'amount'      => 100,
      'count'       => 2,
    ],],
    'time_range'           => [
      'start_time'        => '20091225091010',
      'start_time_remark' => '备注1',
      'end_time'          => '20091225121010',
      'end_time_remark'   => '备注2',
    ],
    'location'             => [
      'start_location' => '嗨客时尚主题展餐厅',
      'end_location'   => '嗨客时尚主题展餐厅',
    ],
    'risk_fund'            => [
      'name'        => 'DEPOSIT',
      'amount'      => 10000,
      'description' => '就餐的预估费用',
    ],
    'attach'               => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
    'notify_url'           => 'https://api.test.com',
    'openid'               => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'sub_openid'           => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'need_user_confirm'    => true,
    'mchid'                => '1230000109',
    'shopping_info'        => [
      'real_merchant_appid' => 'wxd678efh567hg6787',
      'jump_link'           => [
        'jump_link_type' => 'JUMP_LINK_MINI_PROGRAM',
        'appid'          => '',
        'path'           => '',
      ],
      'goods'               => [[
        'name'    => '森海塞尔 MOMENTUM 4 无线耳机大馒头4 头戴式蓝牙音乐耳机自适应降噪',
        'picture' => 'http://mmbiz.qpic.cn/mmbiz_png/ldTw9dg46zkjOrzyTkbQAvQkysliaiblZhdthZWewgQMyqLZwStaNEsJrYmjwh2MlK7G4wibAFOEuISQKplSnxMWA/640?wx_fmt=png&wxfrom=200',
        'amount'  => 40000,
        'count'   => 4,
      ],],
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/payscore/acquiringbank/servicepayondeliveryorder']->postAsync([
  'json' => [
    'out_order_no'         => '1234323JKHDFE1243252',
    'appid'                => 'wxd678efh567hg6787',
    'sub_mchid'            => '1900000109',
    'sub_appid'            => 'wxd678efh567hg6999',
    'channel_id'           => '1230000109',
    'service_id'           => '500001',
    'service_introduction' => '某某酒店',
    'post_payments'        => [[
      'name'        => '就餐费用, 服务费',
      'amount'      => 40000,
      'description' => '就餐人均100元,服务费:100/小时',
      'count'       => 4,
    ],],
    'post_discounts'       => [[
      'name'        => '满20减1元',
      'description' => '不与其他优惠叠加',
      'amount'      => 100,
      'count'       => 2,
    ],],
    'time_range'           => [
      'start_time'        => '20091225091010',
      'start_time_remark' => '备注1',
      'end_time'          => '20091225121010',
      'end_time_remark'   => '备注2',
    ],
    'location'             => [
      'start_location' => '嗨客时尚主题展餐厅',
      'end_location'   => '嗨客时尚主题展餐厅',
    ],
    'risk_fund'            => [
      'name'        => 'DEPOSIT',
      'amount'      => 10000,
      'description' => '就餐的预估费用',
    ],
    'attach'               => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
    'notify_url'           => 'https://api.test.com',
    'openid'               => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'sub_openid'           => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'need_user_confirm'    => true,
    'mchid'                => '1230000109',
    'shopping_info'        => [
      'real_merchant_appid' => 'wxd678efh567hg6787',
      'jump_link'           => [
        'jump_link_type' => 'JUMP_LINK_MINI_PROGRAM',
        'appid'          => '',
        'path'           => '',
      ],
      'goods'               => [[
        'name'    => '森海塞尔 MOMENTUM 4 无线耳机大馒头4 头戴式蓝牙音乐耳机自适应降噪',
        'picture' => 'http://mmbiz.qpic.cn/mmbiz_png/ldTw9dg46zkjOrzyTkbQAvQkysliaiblZhdthZWewgQMyqLZwStaNEsJrYmjwh2MlK7G4wibAFOEuISQKplSnxMWA/640?wx_fmt=png&wxfrom=200',
        'amount'  => 40000,
        'count'   => 4,
      ],],
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->payscore->acquiringbank->servicepayondeliveryorder->post([
  'json' => [
    'out_order_no'         => '1234323JKHDFE1243252',
    'appid'                => 'wxd678efh567hg6787',
    'sub_mchid'            => '1900000109',
    'sub_appid'            => 'wxd678efh567hg6999',
    'channel_id'           => '1230000109',
    'service_id'           => '500001',
    'service_introduction' => '某某酒店',
    'post_payments'        => [[
      'name'        => '就餐费用, 服务费',
      'amount'      => 40000,
      'description' => '就餐人均100元,服务费:100/小时',
      'count'       => 4,
    ],],
    'post_discounts'       => [[
      'name'        => '满20减1元',
      'description' => '不与其他优惠叠加',
      'amount'      => 100,
      'count'       => 2,
    ],],
    'time_range'           => [
      'start_time'        => '20091225091010',
      'start_time_remark' => '备注1',
      'end_time'          => '20091225121010',
      'end_time_remark'   => '备注2',
    ],
    'location'             => [
      'start_location' => '嗨客时尚主题展餐厅',
      'end_location'   => '嗨客时尚主题展餐厅',
    ],
    'risk_fund'            => [
      'name'        => 'DEPOSIT',
      'amount'      => 10000,
      'description' => '就餐的预估费用',
    ],
    'attach'               => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
    'notify_url'           => 'https://api.test.com',
    'openid'               => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'sub_openid'           => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'need_user_confirm'    => true,
    'mchid'                => '1230000109',
    'shopping_info'        => [
      'real_merchant_appid' => 'wxd678efh567hg6787',
      'jump_link'           => [
        'jump_link_type' => 'JUMP_LINK_MINI_PROGRAM',
        'appid'          => '',
        'path'           => '',
      ],
      'goods'               => [[
        'name'    => '森海塞尔 MOMENTUM 4 无线耳机大馒头4 头戴式蓝牙音乐耳机自适应降噪',
        'picture' => 'http://mmbiz.qpic.cn/mmbiz_png/ldTw9dg46zkjOrzyTkbQAvQkysliaiblZhdthZWewgQMyqLZwStaNEsJrYmjwh2MlK7G4wibAFOEuISQKplSnxMWA/640?wx_fmt=png&wxfrom=200',
        'amount'  => 40000,
        'count'   => 4,
      ],],
    ],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/payscore/acquiringbank/servicepayondeliveryorder')->post([
  'json' => [
    'out_order_no'         => '1234323JKHDFE1243252',
    'appid'                => 'wxd678efh567hg6787',
    'sub_mchid'            => '1900000109',
    'sub_appid'            => 'wxd678efh567hg6999',
    'channel_id'           => '1230000109',
    'service_id'           => '500001',
    'service_introduction' => '某某酒店',
    'post_payments'        => [[
      'name'        => '就餐费用, 服务费',
      'amount'      => 40000,
      'description' => '就餐人均100元,服务费:100/小时',
      'count'       => 4,
    ],],
    'post_discounts'       => [[
      'name'        => '满20减1元',
      'description' => '不与其他优惠叠加',
      'amount'      => 100,
      'count'       => 2,
    ],],
    'time_range'           => [
      'start_time'        => '20091225091010',
      'start_time_remark' => '备注1',
      'end_time'          => '20091225121010',
      'end_time_remark'   => '备注2',
    ],
    'location'             => [
      'start_location' => '嗨客时尚主题展餐厅',
      'end_location'   => '嗨客时尚主题展餐厅',
    ],
    'risk_fund'            => [
      'name'        => 'DEPOSIT',
      'amount'      => 10000,
      'description' => '就餐的预估费用',
    ],
    'attach'               => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
    'notify_url'           => 'https://api.test.com',
    'openid'               => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'sub_openid'           => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'need_user_confirm'    => true,
    'mchid'                => '1230000109',
    'shopping_info'        => [
      'real_merchant_appid' => 'wxd678efh567hg6787',
      'jump_link'           => [
        'jump_link_type' => 'JUMP_LINK_MINI_PROGRAM',
        'appid'          => '',
        'path'           => '',
      ],
      'goods'               => [[
        'name'    => '森海塞尔 MOMENTUM 4 无线耳机大馒头4 头戴式蓝牙音乐耳机自适应降噪',
        'picture' => 'http://mmbiz.qpic.cn/mmbiz_png/ldTw9dg46zkjOrzyTkbQAvQkysliaiblZhdthZWewgQMyqLZwStaNEsJrYmjwh2MlK7G4wibAFOEuISQKplSnxMWA/640?wx_fmt=png&wxfrom=200',
        'amount'  => 40000,
        'count'   => 4,
      ],],
    ],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/payscore/acquiringbank/servicepayondeliveryorder']->post([
  'json' => [
    'out_order_no'         => '1234323JKHDFE1243252',
    'appid'                => 'wxd678efh567hg6787',
    'sub_mchid'            => '1900000109',
    'sub_appid'            => 'wxd678efh567hg6999',
    'channel_id'           => '1230000109',
    'service_id'           => '500001',
    'service_introduction' => '某某酒店',
    'post_payments'        => [[
      'name'        => '就餐费用, 服务费',
      'amount'      => 40000,
      'description' => '就餐人均100元,服务费:100/小时',
      'count'       => 4,
    ],],
    'post_discounts'       => [[
      'name'        => '满20减1元',
      'description' => '不与其他优惠叠加',
      'amount'      => 100,
      'count'       => 2,
    ],],
    'time_range'           => [
      'start_time'        => '20091225091010',
      'start_time_remark' => '备注1',
      'end_time'          => '20091225121010',
      'end_time_remark'   => '备注2',
    ],
    'location'             => [
      'start_location' => '嗨客时尚主题展餐厅',
      'end_location'   => '嗨客时尚主题展餐厅',
    ],
    'risk_fund'            => [
      'name'        => 'DEPOSIT',
      'amount'      => 10000,
      'description' => '就餐的预估费用',
    ],
    'attach'               => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
    'notify_url'           => 'https://api.test.com',
    'openid'               => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'sub_openid'           => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'need_user_confirm'    => true,
    'mchid'                => '1230000109',
    'shopping_info'        => [
      'real_merchant_appid' => 'wxd678efh567hg6787',
      'jump_link'           => [
        'jump_link_type' => 'JUMP_LINK_MINI_PROGRAM',
        'appid'          => '',
        'path'           => '',
      ],
      'goods'               => [[
        'name'    => '森海塞尔 MOMENTUM 4 无线耳机大馒头4 头戴式蓝牙音乐耳机自适应降噪',
        'picture' => 'http://mmbiz.qpic.cn/mmbiz_png/ldTw9dg46zkjOrzyTkbQAvQkysliaiblZhdthZWewgQMyqLZwStaNEsJrYmjwh2MlK7G4wibAFOEuISQKplSnxMWA/640?wx_fmt=png&wxfrom=200',
        'amount'  => 40000,
        'count'   => 4,
      ],],
    ],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
out_order_nostring商户订单号
service_idstring服务ID
appidstring服务商公众号ID
mchidstring服务商商户号
sub_appidstring子商户公众号ID
sub_mchidstring子商户商户号
service_introductionstring服务信息
statestring服务订单状态
state_descriptionstring订单状态说明
post_paymentsobject[]后付费项目
namestring付费名称
amountnumber付费金额
descriptionstring付费说明
countnumber付费数量
post_discountsobject[]商户优惠
namestring优惠名称
descriptionstring优惠说明
amountnumber优惠金额
countnumber优惠数量
risk_fundobject服务风险金
namestring风险名称
amountnumber风险金额
descriptionstring风险说明
time_rangeobject服务时间
start_timestring服务开始时间
end_timestring服务结束时间
start_time_remarkstring服务开始时间备注
end_time_remarkstring服务结束时间备注
locationobject服务位置
start_locationstring服务开始地点
end_locationstring服务结束地点
attachstring附加数据
notify_urlstring商户回调地址
order_idstring微信支付服务订单号
packagestring跳转微信侧数据包
shopping_infoobject先用后付购物详情
real_merchant_appidstring实际购物商家公众号ID
jump_linkobject单详跳转链接
jump_link_typestring跳转链接类型
appidstring小程序跳转AppID
pathstring小程序跳转path
goodsobject[]商品列表
namestring商品名称
picturestring商品图片链接
amountnumber商品单价金额
countnumber商品数量
category_idstring[]商品品类ID

参阅 官方文档

Published on the GitHub by TheNorthMemory