Skip to content

创单结单合并

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

请求参数类型描述
jsonobject声明请求的JSON数据结构
out_order_nostring商户服务订单号
appidstring公众账号ID
service_idstring服务ID
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
service_introductionstring服务信息
attachstring商户数据包
notify_urlstring商户回调地址
openidstring用户标识
total_amountinteger总金额
profit_sharingboolean微信支付服务分账标记
goods_tagstring订单优惠标记
php
$instance->v3->payscore->serviceorder->directComplete->postAsync([
  'json' => [
    'out_order_no'         => '1234323JKHDFE1243252',
    'appid'                => 'wxd678efh567hg6787',
    'service_id'           => '500001',
    'post_payments'        => [[
      'name'        => '就餐费用, 服务费',
      'amount'      => 40000,
      'description' => '就餐人均100元,服务费:100/小时',
      'count'       => 4,
    ],],
    'post_discounts'       => [[
      'name'        => '满20减1元',
      'description' => '不与其他优惠叠加',
      'amount'      => 100,
      'count'       => 2,
    ],],
    'time_range'           => [
      'start_time'        => '',
      'start_time_remark' => '',
      'end_time'          => '',
      'end_time_remark'   => '',
    ],
    'location'             => [
      'start_location' => '',
      'end_location'   => '',
    ],
    'service_introduction' => '某某酒店',
    'attach'               => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
    'notify_url'           => 'https://api.test.com',
    'openid'               => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'total_amount'         => 50000,
    'profit_sharing'       => true,
    'goods_tag'            => '',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/payscore/serviceorder/direct-complete')->postAsync([
  'json' => [
    'out_order_no'         => '1234323JKHDFE1243252',
    'appid'                => 'wxd678efh567hg6787',
    'service_id'           => '500001',
    'post_payments'        => [[
      'name'        => '就餐费用, 服务费',
      'amount'      => 40000,
      'description' => '就餐人均100元,服务费:100/小时',
      'count'       => 4,
    ],],
    'post_discounts'       => [[
      'name'        => '满20减1元',
      'description' => '不与其他优惠叠加',
      'amount'      => 100,
      'count'       => 2,
    ],],
    'time_range'           => [
      'start_time'        => '',
      'start_time_remark' => '',
      'end_time'          => '',
      'end_time_remark'   => '',
    ],
    'location'             => [
      'start_location' => '',
      'end_location'   => '',
    ],
    'service_introduction' => '某某酒店',
    'attach'               => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
    'notify_url'           => 'https://api.test.com',
    'openid'               => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'total_amount'         => 50000,
    'profit_sharing'       => true,
    'goods_tag'            => '',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/payscore/serviceorder/direct-complete']->postAsync([
  'json' => [
    'out_order_no'         => '1234323JKHDFE1243252',
    'appid'                => 'wxd678efh567hg6787',
    'service_id'           => '500001',
    'post_payments'        => [[
      'name'        => '就餐费用, 服务费',
      'amount'      => 40000,
      'description' => '就餐人均100元,服务费:100/小时',
      'count'       => 4,
    ],],
    'post_discounts'       => [[
      'name'        => '满20减1元',
      'description' => '不与其他优惠叠加',
      'amount'      => 100,
      'count'       => 2,
    ],],
    'time_range'           => [
      'start_time'        => '',
      'start_time_remark' => '',
      'end_time'          => '',
      'end_time_remark'   => '',
    ],
    'location'             => [
      'start_location' => '',
      'end_location'   => '',
    ],
    'service_introduction' => '某某酒店',
    'attach'               => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
    'notify_url'           => 'https://api.test.com',
    'openid'               => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'total_amount'         => 50000,
    'profit_sharing'       => true,
    'goods_tag'            => '',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->payscore->serviceorder->directComplete->post([
  'json' => [
    'out_order_no'         => '1234323JKHDFE1243252',
    'appid'                => 'wxd678efh567hg6787',
    'service_id'           => '500001',
    'post_payments'        => [[
      'name'        => '就餐费用, 服务费',
      'amount'      => 40000,
      'description' => '就餐人均100元,服务费:100/小时',
      'count'       => 4,
    ],],
    'post_discounts'       => [[
      'name'        => '满20减1元',
      'description' => '不与其他优惠叠加',
      'amount'      => 100,
      'count'       => 2,
    ],],
    'time_range'           => [
      'start_time'        => '',
      'start_time_remark' => '',
      'end_time'          => '',
      'end_time_remark'   => '',
    ],
    'location'             => [
      'start_location' => '',
      'end_location'   => '',
    ],
    'service_introduction' => '某某酒店',
    'attach'               => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
    'notify_url'           => 'https://api.test.com',
    'openid'               => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'total_amount'         => 50000,
    'profit_sharing'       => true,
    'goods_tag'            => '',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/payscore/serviceorder/direct-complete')->post([
  'json' => [
    'out_order_no'         => '1234323JKHDFE1243252',
    'appid'                => 'wxd678efh567hg6787',
    'service_id'           => '500001',
    'post_payments'        => [[
      'name'        => '就餐费用, 服务费',
      'amount'      => 40000,
      'description' => '就餐人均100元,服务费:100/小时',
      'count'       => 4,
    ],],
    'post_discounts'       => [[
      'name'        => '满20减1元',
      'description' => '不与其他优惠叠加',
      'amount'      => 100,
      'count'       => 2,
    ],],
    'time_range'           => [
      'start_time'        => '',
      'start_time_remark' => '',
      'end_time'          => '',
      'end_time_remark'   => '',
    ],
    'location'             => [
      'start_location' => '',
      'end_location'   => '',
    ],
    'service_introduction' => '某某酒店',
    'attach'               => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
    'notify_url'           => 'https://api.test.com',
    'openid'               => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'total_amount'         => 50000,
    'profit_sharing'       => true,
    'goods_tag'            => '',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/payscore/serviceorder/direct-complete']->post([
  'json' => [
    'out_order_no'         => '1234323JKHDFE1243252',
    'appid'                => 'wxd678efh567hg6787',
    'service_id'           => '500001',
    'post_payments'        => [[
      'name'        => '就餐费用, 服务费',
      'amount'      => 40000,
      'description' => '就餐人均100元,服务费:100/小时',
      'count'       => 4,
    ],],
    'post_discounts'       => [[
      'name'        => '满20减1元',
      'description' => '不与其他优惠叠加',
      'amount'      => 100,
      'count'       => 2,
    ],],
    'time_range'           => [
      'start_time'        => '',
      'start_time_remark' => '',
      'end_time'          => '',
      'end_time_remark'   => '',
    ],
    'location'             => [
      'start_location' => '',
      'end_location'   => '',
    ],
    'service_introduction' => '某某酒店',
    'attach'               => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
    'notify_url'           => 'https://api.test.com',
    'openid'               => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'total_amount'         => 50000,
    'profit_sharing'       => true,
    'goods_tag'            => '',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
out_order_nostring商户服务订单号
appidstring公众账号ID
service_idstring服务ID
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
service_introductionstring服务信息
mchidstring商户号
order_idstring微信支付服务订单号
statestring服务订单状态
CREATED | DOING | DONE | REVOKED | EXPIRED 枚举值之一
state_descriptionstring订单状态说明
USER_CONFIRM | MCH_COMPLETE 枚举值之一
attachstring商户数据包
notify_urlstring商户回调地址
total_amountinteger总金额

参阅 官方文档

Published on the GitHub by TheNorthMemory