Skip to content

创建用户的签约计划详情对应的服务订单

根据用户签约的计划和对应要服务的计划详情序号,创建服务订单。

请求参数类型描述
jsonobject声明请求的JSON数据结构
service_idstring支付分服务ID
sign_plan_idstring待创建服务订单对应的用户的签约计划
plan_detail_nonumber待创建服务订单对应的用户的签约计划详情序号
appidstring商户的AppID
openidstring商户公众号下的用户标识
notify_urlstring商户扣款成功回调通知的地址
service_introductionstring服务信息
time_rangeobject服务时间
start_timestring服务开始时间
end_timestring服务结束时间
start_time_remarkstring服务开始时间备注
end_time_remarkstring服务结束时间备注
locationobject服务位置
start_locationstring服务开始地点
end_locationstring服务结束地点
attachstring附加数据
out_trade_nostring商户侧订单号
php
$instance->v3->payscore->signPlan->serviceorder->postAsync([
  'json' => [
    'service_id' => '2002000000000558128851361561536',
    'sign_plan_id' => '01000033210000324638000000376258',
    'plan_detail_no' => 2,
    'appid' => 'wxd678efh567hg6787',
    'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'notify_url' => 'https://api.test.com',
    'service_introduction' => '羽毛球课基础练习课程',
    'time_range' => [
      'start_time' => '20091225091010',
      'end_time' => '20091225121010',
      'start_time_remark' => '备注1',
      'end_time_remark' => '备注2',
    ],
    'location' => [
      'start_location' => '嗨客时尚主题展餐厅',
      'end_location' => '嗨客时尚主题展餐厅',
    ],
    'attach' => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
    'out_trade_no' => '1514323JSVDFE1243252',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/payscore/sign-plan/serviceorder')->postAsync([
  'json' => [
    'service_id' => '2002000000000558128851361561536',
    'sign_plan_id' => '01000033210000324638000000376258',
    'plan_detail_no' => 2,
    'appid' => 'wxd678efh567hg6787',
    'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'notify_url' => 'https://api.test.com',
    'service_introduction' => '羽毛球课基础练习课程',
    'time_range' => [
      'start_time' => '20091225091010',
      'end_time' => '20091225121010',
      'start_time_remark' => '备注1',
      'end_time_remark' => '备注2',
    ],
    'location' => [
      'start_location' => '嗨客时尚主题展餐厅',
      'end_location' => '嗨客时尚主题展餐厅',
    ],
    'attach' => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
    'out_trade_no' => '1514323JSVDFE1243252',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/payscore/sign-plan/serviceorder']->postAsync([
  'json' => [
    'service_id' => '2002000000000558128851361561536',
    'sign_plan_id' => '01000033210000324638000000376258',
    'plan_detail_no' => 2,
    'appid' => 'wxd678efh567hg6787',
    'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'notify_url' => 'https://api.test.com',
    'service_introduction' => '羽毛球课基础练习课程',
    'time_range' => [
      'start_time' => '20091225091010',
      'end_time' => '20091225121010',
      'start_time_remark' => '备注1',
      'end_time_remark' => '备注2',
    ],
    'location' => [
      'start_location' => '嗨客时尚主题展餐厅',
      'end_location' => '嗨客时尚主题展餐厅',
    ],
    'attach' => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
    'out_trade_no' => '1514323JSVDFE1243252',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->payscore->signPlan->serviceorder->post([
  'json' => [
    'service_id' => '2002000000000558128851361561536',
    'sign_plan_id' => '01000033210000324638000000376258',
    'plan_detail_no' => 2,
    'appid' => 'wxd678efh567hg6787',
    'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'notify_url' => 'https://api.test.com',
    'service_introduction' => '羽毛球课基础练习课程',
    'time_range' => [
      'start_time' => '20091225091010',
      'end_time' => '20091225121010',
      'start_time_remark' => '备注1',
      'end_time_remark' => '备注2',
    ],
    'location' => [
      'start_location' => '嗨客时尚主题展餐厅',
      'end_location' => '嗨客时尚主题展餐厅',
    ],
    'attach' => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
    'out_trade_no' => '1514323JSVDFE1243252',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/payscore/sign-plan/serviceorder')->post([
  'json' => [
    'service_id' => '2002000000000558128851361561536',
    'sign_plan_id' => '01000033210000324638000000376258',
    'plan_detail_no' => 2,
    'appid' => 'wxd678efh567hg6787',
    'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'notify_url' => 'https://api.test.com',
    'service_introduction' => '羽毛球课基础练习课程',
    'time_range' => [
      'start_time' => '20091225091010',
      'end_time' => '20091225121010',
      'start_time_remark' => '备注1',
      'end_time_remark' => '备注2',
    ],
    'location' => [
      'start_location' => '嗨客时尚主题展餐厅',
      'end_location' => '嗨客时尚主题展餐厅',
    ],
    'attach' => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
    'out_trade_no' => '1514323JSVDFE1243252',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/payscore/sign-plan/serviceorder']->post([
  'json' => [
    'service_id' => '2002000000000558128851361561536',
    'sign_plan_id' => '01000033210000324638000000376258',
    'plan_detail_no' => 2,
    'appid' => 'wxd678efh567hg6787',
    'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'notify_url' => 'https://api.test.com',
    'service_introduction' => '羽毛球课基础练习课程',
    'time_range' => [
      'start_time' => '20091225091010',
      'end_time' => '20091225121010',
      'start_time_remark' => '备注1',
      'end_time_remark' => '备注2',
    ],
    'location' => [
      'start_location' => '嗨客时尚主题展餐厅',
      'end_location' => '嗨客时尚主题展餐厅',
    ],
    'attach' => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
    'out_trade_no' => '1514323JSVDFE1243252',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
out_order_nostring商户订单号
service_idstring服务ID
appidstring商户公众号ID
mchidstring商户号
service_introductionstring服务信息
statestring服务订单状态
state_descriptionstring订单状态说明
post_paymentsobject[]后付费项目
namestring付费名称
amountnumber付费金额
descriptionstring付费说明
post_discountsobject[]商户优惠
namestring优惠名称
amountnumber优惠金额
risk_fundobject服务风险金
amountnumber风险金额
time_rangeobject服务时间
start_timestring服务开始时间
end_timestring服务结束时间
start_time_remarkstring服务开始时间备注
end_time_remarkstring服务结束时间备注
locationobject服务位置
start_locationstring服务开始地点
end_locationstring服务结束地点
attachstring附加数据
notify_urlstring商户回调地址
order_idstring微信支付服务订单号

参阅 官方文档

Published on the GitHub by TheNorthMemory