创单结单合并
该接口适用于无需微信支付分做订单风控判断的业务场景,在服务完成后,通过该接口对用户进行免密代扣。
| 请求参数 | 类型 | 描述 |
|---|---|---|
| json | object | 声明请求的JSON数据结构 |
| out_order_no | string | 商户服务订单号 |
| appid | string | 公众账号ID |
| service_id | string | 服务ID |
| post_payments | object[] | 后付费项目 |
| name | string | 付费项目名称 |
| amount | integer | 金额 |
| description | string | 计费说明 |
| count | integer | 付费数量 |
| post_discounts | object[] | 后付费商户优惠 |
| name | string | 优惠名称 |
| description | string | 优惠说明 |
| amount | integer | 优惠金额 |
| count | integer | 优惠数量 |
| time_range | object | 服务时间段 |
| start_time | string | 服务开始时间 |
| start_time_remark | string | 服务开始时间备注 |
| end_time | string | 服务结束时间 |
| end_time_remark | string | 服务结束时间备注 |
| location | object | 服务位置 |
| start_location | string | 服务开始地点 |
| end_location | string | 服务结束地点 |
| service_introduction | string | 服务信息 |
| attach | string | 商户数据包 |
| notify_url | string | 商户回调地址 |
| openid | string | 用户标识 |
| total_amount | integer | 总金额 |
| profit_sharing | boolean | 微信支付服务分账标记 |
| goods_tag | string | 订单优惠标记 |
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' => '20091225091010',
'start_time_remark' => '开始租借时间',
'end_time' => '20091225121010',
'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' => '20091225091010',
'start_time_remark' => '开始租借时间',
'end_time' => '20091225121010',
'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' => '20091225091010',
'start_time_remark' => '开始租借时间',
'end_time' => '20091225121010',
'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' => '20091225091010',
'start_time_remark' => '开始租借时间',
'end_time' => '20091225121010',
'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' => '20091225091010',
'start_time_remark' => '开始租借时间',
'end_time' => '20091225121010',
'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' => '20091225091010',
'start_time_remark' => '开始租借时间',
'end_time' => '20091225121010',
'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_no | string | 商户服务订单号 |
| appid | string | 公众账号ID |
| service_id | string | 服务ID |
| post_payments | object[] | 后付费项目 |
| name | string | 付费项目名称 |
| amount | integer | 金额 |
| description | string | 计费说明 |
| count | integer | 付费数量 |
| post_discounts | object[] | 后付费商户优惠 |
| name | string | 优惠名称 |
| description | string | 优惠说明 |
| amount | integer | 优惠金额 |
| count | integer | 优惠数量 |
| time_range | object | 服务时间段 |
| start_time | string | 服务开始时间 |
| start_time_remark | string | 服务开始时间备注 |
| end_time | string | 服务结束时间 |
| end_time_remark | string | 服务结束时间备注 |
| location | object | 服务位置 |
| start_location | string | 服务开始地点 |
| end_location | string | 服务结束地点 |
| service_introduction | string | 服务信息 |
| mchid | string | 商户号 |
| order_id | string | 微信支付服务订单号 |
| state | string | 服务订单状态CREATED | DOING | DONE | REVOKED | EXPIRED 枚举值之一 |
| state_description | string | 订单状态说明USER_CONFIRM | MCH_COMPLETE 枚举值之一 |
| attach | string | 商户数据包 |
| notify_url | string | 商户回调地址 |
| total_amount | integer | 总金额 |
参阅 官方文档