创建支付分订单
用户申请使用服务时,商户可通过此接口申请创建微信支付分订单。
请求参数 | 类型 | 描述 |
---|---|---|
json | object | 声明请求的JSON 数据结构 |
service_id | string | 服务ID |
appid | string | 服务商应用ID |
sub_mchid | string | 子商户号 |
sub_appid | string | 子商户应用ID |
out_order_no | string | 商户服务订单号 |
service_introduction | string | 服务信息 |
post_payments | object[] | 后付费项目 |
name | string | 付费项目名称 |
description | string | 付费说明 |
amount | integer | 金额 |
count | integer | 付费数量 |
post_discounts | object[] | 后付费商户优惠 |
name | string | 优惠名称 |
description | string | 优惠说明 |
amount | integer | 优惠金额 |
count | integer | 优惠数量 |
risk_fund | object | 订单风险金 |
name | string | 风险金名称 |
amount | integer | 风险金额 |
description | string | 风险说明 |
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 | 预计服务结束地点 |
openid | string | 服务商公众号下的用户标识 |
sub_openid | string | 子商户公众号下的用户标识 |
need_user_confirm | boolean | 是否需要用户确认 |
notify_url | string | 商户回调地址 |
attach | string | 商户数据包 |
php
$instance->v3->payscore->partner->serviceorder->postAsync([
'json' => [
'service_id' => '2002000000000558128851361561536',
'appid' => 'wxd678efh567hg6787',
'sub_mchid' => '1900000109',
'sub_appid' => 'wxd678efh567hg6999',
'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,
],],
'risk_fund' => [
'name' => 'DEPOSIT',
'amount' => 10000,
'description' => '就餐的预估费用',
],
'time_range' => [
'start_time' => '20091225091010',
'start_time_remark' => '开始租借时间',
'end_time' => '20091225121010',
'end_time_remark' => '租借结束时间',
],
'location' => [
'start_location' => '嗨客时尚主题展餐厅',
'end_location' => '嗨客时尚主题展餐厅',
],
'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
'sub_openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
'need_user_confirm' => true,
'notify_url' => 'https://api.test.com',
'attach' => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/payscore/partner/serviceorder')->postAsync([
'json' => [
'service_id' => '2002000000000558128851361561536',
'appid' => 'wxd678efh567hg6787',
'sub_mchid' => '1900000109',
'sub_appid' => 'wxd678efh567hg6999',
'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,
],],
'risk_fund' => [
'name' => 'DEPOSIT',
'amount' => 10000,
'description' => '就餐的预估费用',
],
'time_range' => [
'start_time' => '20091225091010',
'start_time_remark' => '开始租借时间',
'end_time' => '20091225121010',
'end_time_remark' => '租借结束时间',
],
'location' => [
'start_location' => '嗨客时尚主题展餐厅',
'end_location' => '嗨客时尚主题展餐厅',
],
'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
'sub_openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
'need_user_confirm' => true,
'notify_url' => 'https://api.test.com',
'attach' => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/payscore/partner/serviceorder']->postAsync([
'json' => [
'service_id' => '2002000000000558128851361561536',
'appid' => 'wxd678efh567hg6787',
'sub_mchid' => '1900000109',
'sub_appid' => 'wxd678efh567hg6999',
'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,
],],
'risk_fund' => [
'name' => 'DEPOSIT',
'amount' => 10000,
'description' => '就餐的预估费用',
],
'time_range' => [
'start_time' => '20091225091010',
'start_time_remark' => '开始租借时间',
'end_time' => '20091225121010',
'end_time_remark' => '租借结束时间',
],
'location' => [
'start_location' => '嗨客时尚主题展餐厅',
'end_location' => '嗨客时尚主题展餐厅',
],
'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
'sub_openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
'need_user_confirm' => true,
'notify_url' => 'https://api.test.com',
'attach' => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->payscore->partner->serviceorder->post([
'json' => [
'service_id' => '2002000000000558128851361561536',
'appid' => 'wxd678efh567hg6787',
'sub_mchid' => '1900000109',
'sub_appid' => 'wxd678efh567hg6999',
'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,
],],
'risk_fund' => [
'name' => 'DEPOSIT',
'amount' => 10000,
'description' => '就餐的预估费用',
],
'time_range' => [
'start_time' => '20091225091010',
'start_time_remark' => '开始租借时间',
'end_time' => '20091225121010',
'end_time_remark' => '租借结束时间',
],
'location' => [
'start_location' => '嗨客时尚主题展餐厅',
'end_location' => '嗨客时尚主题展餐厅',
],
'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
'sub_openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
'need_user_confirm' => true,
'notify_url' => 'https://api.test.com',
'attach' => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/payscore/partner/serviceorder')->post([
'json' => [
'service_id' => '2002000000000558128851361561536',
'appid' => 'wxd678efh567hg6787',
'sub_mchid' => '1900000109',
'sub_appid' => 'wxd678efh567hg6999',
'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,
],],
'risk_fund' => [
'name' => 'DEPOSIT',
'amount' => 10000,
'description' => '就餐的预估费用',
],
'time_range' => [
'start_time' => '20091225091010',
'start_time_remark' => '开始租借时间',
'end_time' => '20091225121010',
'end_time_remark' => '租借结束时间',
],
'location' => [
'start_location' => '嗨客时尚主题展餐厅',
'end_location' => '嗨客时尚主题展餐厅',
],
'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
'sub_openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
'need_user_confirm' => true,
'notify_url' => 'https://api.test.com',
'attach' => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/payscore/partner/serviceorder']->post([
'json' => [
'service_id' => '2002000000000558128851361561536',
'appid' => 'wxd678efh567hg6787',
'sub_mchid' => '1900000109',
'sub_appid' => 'wxd678efh567hg6999',
'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,
],],
'risk_fund' => [
'name' => 'DEPOSIT',
'amount' => 10000,
'description' => '就餐的预估费用',
],
'time_range' => [
'start_time' => '20091225091010',
'start_time_remark' => '开始租借时间',
'end_time' => '20091225121010',
'end_time_remark' => '租借结束时间',
],
'location' => [
'start_location' => '嗨客时尚主题展餐厅',
'end_location' => '嗨客时尚主题展餐厅',
],
'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
'sub_openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
'need_user_confirm' => true,
'notify_url' => 'https://api.test.com',
'attach' => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典 | 类型 | 描述 |
---|---|---|
out_order_no | string | 商户服务订单号 |
service_id | string | 服务ID |
appid | string | 服务商应用ID |
mchid | string | 服务商商户号 |
sub_appid | string | 子商户应用ID |
sub_mchid | string | 子商户号 |
service_introduction | string | 服务信息 |
state | string | 服务订单状态 |
state_description | string | 订单状态说明 |
post_payments | object[] | 后付费项目 |
name | string | 付费项目名称 |
description | string | 付费说明 |
amount | integer | 金额 |
count | integer | 付费数量 |
post_discounts | object[] | 商户优惠 |
name | string | 优惠名称 |
description | string | 优惠说明 |
amount | integer | 优惠金额 |
count | integer | 优惠数量 |
risk_fund | object | 订单风险金 |
name | string | 风险金名称 |
amount | integer | 风险金额 |
description | string | 风险说明 |
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 | 预计服务结束地点 |
attach | string | 商户数据包 |
notify_url | string | 商户回调地址 |
order_id | string | 微信支付服务订单号 |
package | string | 跳转微信侧数据包 |
查询支付分订单
用于查询单笔微信支付分订单详细信息。
请求参数 | 类型 | 描述 |
---|---|---|
query | object | 声明请求的查询参数 |
service_id | string | 服务ID |
sub_mchid | string | 子商户号 |
out_order_no | string | 商户服务订单号 |
query_id | string | 回跳查询ID |
php
$instance->v3->payscore->partner->serviceorder->getAsync([
'query' => [
'service_id' => '2002000000000558128851361561536',
'sub_mchid' => '1900000109',
'out_order_no' => '1234323JKHDFE1243252',
'query_id' => '',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/payscore/partner/serviceorder')->getAsync([
'query' => [
'service_id' => '2002000000000558128851361561536',
'sub_mchid' => '1900000109',
'out_order_no' => '1234323JKHDFE1243252',
'query_id' => '',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/payscore/partner/serviceorder']->getAsync([
'query' => [
'service_id' => '2002000000000558128851361561536',
'sub_mchid' => '1900000109',
'out_order_no' => '1234323JKHDFE1243252',
'query_id' => '',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->payscore->partner->serviceorder->get([
'query' => [
'service_id' => '2002000000000558128851361561536',
'sub_mchid' => '1900000109',
'out_order_no' => '1234323JKHDFE1243252',
'query_id' => '',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/payscore/partner/serviceorder')->get([
'query' => [
'service_id' => '2002000000000558128851361561536',
'sub_mchid' => '1900000109',
'out_order_no' => '1234323JKHDFE1243252',
'query_id' => '',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/payscore/partner/serviceorder']->get([
'query' => [
'service_id' => '2002000000000558128851361561536',
'sub_mchid' => '1900000109',
'out_order_no' => '1234323JKHDFE1243252',
'query_id' => '',
],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典 | 类型 | 描述 |
---|---|---|
out_order_no | string | 商户服务订单号 |
service_id | string | 服务ID |
appid | string | 服务商应用ID |
mchid | string | 服务商商户号 |
sub_appid | string | 子商户应用ID |
sub_mchid | string | 子商户号 |
service_introduction | string | 服务信息 |
state | string | 服务订单状态 |
state_description | string | 订单状态说明 |
post_payments | object[] | 后付费项目 |
name | string | 付费名称 |
description | string | 付费说明 |
amount | integer | 付费金额 |
count | integer | 付费数量 |
post_discounts | object[] | 后付费商户优惠 |
name | string | 优惠名称 |
description | string | 优惠说明 |
amount | integer | 优惠金额 |
count | integer | 优惠数量 |
risk_fund | object | 订单风险金 |
name | string | 风险金名称 |
amount | integer | 风险金额 |
description | string | 风险说明 |
total_amount | integer | 总金额 |
need_collection | boolean | 是否需要收款 |
collection | object | 收款信息 |
state | string | 收款状态 |
total_amount | integer | 总收款金额 |
paying_amount | integer | 待收金额 |
paid_amount | integer | 已收金额 |
details | object[] | 收款明细列表 |
seq | integer | 收款序号 |
amount | integer | 单笔收款金额 |
paid_type | string | 收款成功渠道 |
paid_time | string | 收款成功时间 |
transaction_id | string | 微信支付交易单号 |
promotion_detail | object[] | 优惠功能 |
coupon_id | string | 券ID |
name | string | 优惠名称 |
scope | string | 优惠范围 |
type | string | 优惠类型 |
amount | integer | 优惠券面额 |
stock_id | string | 活动ID |
wechatpay_contribute | integer | 微信出资 |
merchant_contribute | integer | 商户出资 |
other_contribute | integer | 其他出资 |
currency | string | 优惠币种 |
goods_detail | object[] | 单品列表 |
goods_id | string | 商品编码 |
quantity | integer | 商品数量 |
unit_price | integer | 商品价格 |
discount_amount | integer | 商品优惠金额 |
goods_remark | string | 商品备注 |
bank_type | string | 收款银行 |
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 | 服务结束地点 |
attach | string | 商户数据包 |
notify_url | string | 商户回调地址 |
openid | string | 服务商公众号下的用户标识 |
sub_openid | string | 子商户公众号下的用户标识 |
order_id | string | 微信支付服务订单号 |