Skip to content

创单结单合并

该接口适用于无需微信支付分做订单风控判断的业务场景,在服务完成后,通过该接口对用户进行免密代扣。

请求参数类型描述
jsonobject声明请求的JSON数据结构
service_idstring服务ID
appidstring服务商应用ID
sub_appidstring子商户应用ID
sub_mchidstring子商户号
out_order_nostring商户服务订单号
service_introductionstring服务信息
post_paymentsobject[]后付费项目
namestring付费名称
descriptionstring付费说明
amountinteger付费金额
countinteger付费数量
post_discountsobject[]后付费商户优惠
namestring优惠名称
descriptionstring优惠说明
amountinteger优惠金额
countinteger优惠数量
total_amountinteger总金额
time_rangeobject服务时间段
start_timestring服务开始时间
start_time_remarkstring服务开始时间备注
end_timestring服务结束时间
end_time_remarkstring服务结束时间备注
locationobject服务位置
start_locationstring服务开始地点
end_locationstring服务结束地点
profit_sharingboolean微信支付服务分账标记
goods_tagstring订单优惠标记
attachstring商户数据包
notify_urlstring商户回调地址
openidstring服务商公众号下的用户标识
php
$instance->v3->payscore->partner->serviceorder->directComplete->postAsync([
  'json' => [
    'service_id'           => '2002000000000558128851361561536',
    'appid'                => 'wxd678efh567hg6787',
    'sub_appid'            => 'wxd678efh567hg6999',
    'sub_mchid'            => '1900000109',
    'out_order_no'         => '1234323JKHDFE1243252',
    'service_introduction' => 'XX充电宝',
    'post_payments'        => [[
      'name'        => '就餐费用',
      'description' => '就餐人均100元',
      'amount'      => 40000,
      'count'       => 4,
    ],],
    'post_discounts'       => [[
      'name'        => '满20减1元',
      'description' => '不与其他优惠叠加',
      'amount'      => 100,
      'count'       => 2,
    ],],
    'total_amount'         => 50000,
    'time_range'           => [
      'start_time'        => '20091225091010',
      'start_time_remark' => '开始租借时间',
      'end_time'          => '20091225121010',
      'end_time_remark'   => '租借结束时间',
    ],
    'location'             => [
      'start_location' => '嗨客时尚主题展餐厅',
      'end_location'   => '嗨客时尚主题展餐厅',
    ],
    'profit_sharing'       => true,
    'goods_tag'            => 'goods_tag',
    'attach'               => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
    'notify_url'           => 'https://api.test.com',
    'openid'               => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$instance->chain('v3/payscore/partner/serviceorder/direct-complete')->postAsync([
  'json' => [
    'service_id'           => '2002000000000558128851361561536',
    'appid'                => 'wxd678efh567hg6787',
    'sub_appid'            => 'wxd678efh567hg6999',
    'sub_mchid'            => '1900000109',
    'out_order_no'         => '1234323JKHDFE1243252',
    'service_introduction' => 'XX充电宝',
    'post_payments'        => [[
      'name'        => '就餐费用',
      'description' => '就餐人均100元',
      'amount'      => 40000,
      'count'       => 4,
    ],],
    'post_discounts'       => [[
      'name'        => '满20减1元',
      'description' => '不与其他优惠叠加',
      'amount'      => 100,
      'count'       => 2,
    ],],
    'total_amount'         => 50000,
    'time_range'           => [
      'start_time'        => '20091225091010',
      'start_time_remark' => '开始租借时间',
      'end_time'          => '20091225121010',
      'end_time_remark'   => '租借结束时间',
    ],
    'location'             => [
      'start_location' => '嗨客时尚主题展餐厅',
      'end_location'   => '嗨客时尚主题展餐厅',
    ],
    'profit_sharing'       => true,
    'goods_tag'            => 'goods_tag',
    'attach'               => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
    'notify_url'           => 'https://api.test.com',
    'openid'               => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$instance['v3/payscore/partner/serviceorder/direct-complete']->postAsync([
  'json' => [
    'service_id'           => '2002000000000558128851361561536',
    'appid'                => 'wxd678efh567hg6787',
    'sub_appid'            => 'wxd678efh567hg6999',
    'sub_mchid'            => '1900000109',
    'out_order_no'         => '1234323JKHDFE1243252',
    'service_introduction' => 'XX充电宝',
    'post_payments'        => [[
      'name'        => '就餐费用',
      'description' => '就餐人均100元',
      'amount'      => 40000,
      'count'       => 4,
    ],],
    'post_discounts'       => [[
      'name'        => '满20减1元',
      'description' => '不与其他优惠叠加',
      'amount'      => 100,
      'count'       => 2,
    ],],
    'total_amount'         => 50000,
    'time_range'           => [
      'start_time'        => '20091225091010',
      'start_time_remark' => '开始租借时间',
      'end_time'          => '20091225121010',
      'end_time_remark'   => '租借结束时间',
    ],
    'location'             => [
      'start_location' => '嗨客时尚主题展餐厅',
      'end_location'   => '嗨客时尚主题展餐厅',
    ],
    'profit_sharing'       => true,
    'goods_tag'            => 'goods_tag',
    'attach'               => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
    'notify_url'           => 'https://api.test.com',
    'openid'               => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$response = $instance->v3->payscore->partner->serviceorder->directComplete->post([
  'json' => [
    'service_id'           => '2002000000000558128851361561536',
    'appid'                => 'wxd678efh567hg6787',
    'sub_appid'            => 'wxd678efh567hg6999',
    'sub_mchid'            => '1900000109',
    'out_order_no'         => '1234323JKHDFE1243252',
    'service_introduction' => 'XX充电宝',
    'post_payments'        => [[
      'name'        => '就餐费用',
      'description' => '就餐人均100元',
      'amount'      => 40000,
      'count'       => 4,
    ],],
    'post_discounts'       => [[
      'name'        => '满20减1元',
      'description' => '不与其他优惠叠加',
      'amount'      => 100,
      'count'       => 2,
    ],],
    'total_amount'         => 50000,
    'time_range'           => [
      'start_time'        => '20091225091010',
      'start_time_remark' => '开始租借时间',
      'end_time'          => '20091225121010',
      'end_time_remark'   => '租借结束时间',
    ],
    'location'             => [
      'start_location' => '嗨客时尚主题展餐厅',
      'end_location'   => '嗨客时尚主题展餐厅',
    ],
    'profit_sharing'       => true,
    'goods_tag'            => 'goods_tag',
    'attach'               => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
    'notify_url'           => 'https://api.test.com',
    'openid'               => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
  ],
]);
print_r($response->getStatusCode() === 204);
php
$response = $instance->chain('v3/payscore/partner/serviceorder/direct-complete')->post([
  'json' => [
    'service_id'           => '2002000000000558128851361561536',
    'appid'                => 'wxd678efh567hg6787',
    'sub_appid'            => 'wxd678efh567hg6999',
    'sub_mchid'            => '1900000109',
    'out_order_no'         => '1234323JKHDFE1243252',
    'service_introduction' => 'XX充电宝',
    'post_payments'        => [[
      'name'        => '就餐费用',
      'description' => '就餐人均100元',
      'amount'      => 40000,
      'count'       => 4,
    ],],
    'post_discounts'       => [[
      'name'        => '满20减1元',
      'description' => '不与其他优惠叠加',
      'amount'      => 100,
      'count'       => 2,
    ],],
    'total_amount'         => 50000,
    'time_range'           => [
      'start_time'        => '20091225091010',
      'start_time_remark' => '开始租借时间',
      'end_time'          => '20091225121010',
      'end_time_remark'   => '租借结束时间',
    ],
    'location'             => [
      'start_location' => '嗨客时尚主题展餐厅',
      'end_location'   => '嗨客时尚主题展餐厅',
    ],
    'profit_sharing'       => true,
    'goods_tag'            => 'goods_tag',
    'attach'               => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
    'notify_url'           => 'https://api.test.com',
    'openid'               => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
  ],
]);
print_r($response->getStatusCode() === 204);
php
$response = $instance['v3/payscore/partner/serviceorder/direct-complete']->post([
  'json' => [
    'service_id'           => '2002000000000558128851361561536',
    'appid'                => 'wxd678efh567hg6787',
    'sub_appid'            => 'wxd678efh567hg6999',
    'sub_mchid'            => '1900000109',
    'out_order_no'         => '1234323JKHDFE1243252',
    'service_introduction' => 'XX充电宝',
    'post_payments'        => [[
      'name'        => '就餐费用',
      'description' => '就餐人均100元',
      'amount'      => 40000,
      'count'       => 4,
    ],],
    'post_discounts'       => [[
      'name'        => '满20减1元',
      'description' => '不与其他优惠叠加',
      'amount'      => 100,
      'count'       => 2,
    ],],
    'total_amount'         => 50000,
    'time_range'           => [
      'start_time'        => '20091225091010',
      'start_time_remark' => '开始租借时间',
      'end_time'          => '20091225121010',
      'end_time_remark'   => '租借结束时间',
    ],
    'location'             => [
      'start_location' => '嗨客时尚主题展餐厅',
      'end_location'   => '嗨客时尚主题展餐厅',
    ],
    'profit_sharing'       => true,
    'goods_tag'            => 'goods_tag',
    'attach'               => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
    'notify_url'           => 'https://api.test.com',
    'openid'               => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
  ],
]);
print_r($response->getStatusCode() === 204);
返回字典类型描述
空字符串(无返回内容)

参阅 官方文档

Published on the GitHub by TheNorthMemory