Skip to content

创建用户的签约计划

商户通过此接口基于商户已创建且正常进行中的支付分计划,创建用户的签约计划以供用户签约。

请求参数类型描述
jsonobject声明请求的JSON数据结构
service_idstring支付分服务ID
plan_idstring支付分计划ID
appidstring服务商的AppID
sub_mchidstring子商户号
sub_appidstring子商户的AppID
openidstring待签约用户在服务商应用下的OpenID
sub_openidstring待签约用户在子商户应用下的OpenID
merchant_sign_plan_nostring商户签约计划单号
notify_urlstring签约成功事件通知回调地址
sign_plan_detailobject[]签约计划对应的计划详情列表的商户侧单号信息
plan_detail_nonumber计划明细序号
merchant_plan_detail_nostring商户侧计划明细使用订单号
php
$instance->v3->payscore->signPlan->partner->userSignPlans->postAsync([
  'json' => [
    'service_id'            => '2002000000000558128851361561536',
    'plan_id'               => '01000033210000324638000000376258',
    'appid'                 => 'wxd678efh567hg6787',
    'sub_mchid'             => '1900000109',
    'sub_appid'             => 'wxd678efh567hg6999',
    'openid'                => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'sub_openid'            => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'merchant_sign_plan_no' => '1234323JKHDFE1243252',
    'notify_url'            => 'https://api.test.com',
    'sign_plan_detail'      => [[
      'plan_detail_no'          => 1,
      'merchant_plan_detail_no' => '1234323JKHDFE1243252',
    ],],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/payscore/sign-plan/partner/user-sign-plans')->postAsync([
  'json' => [
    'service_id'            => '2002000000000558128851361561536',
    'plan_id'               => '01000033210000324638000000376258',
    'appid'                 => 'wxd678efh567hg6787',
    'sub_mchid'             => '1900000109',
    'sub_appid'             => 'wxd678efh567hg6999',
    'openid'                => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'sub_openid'            => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'merchant_sign_plan_no' => '1234323JKHDFE1243252',
    'notify_url'            => 'https://api.test.com',
    'sign_plan_detail'      => [[
      'plan_detail_no'          => 1,
      'merchant_plan_detail_no' => '1234323JKHDFE1243252',
    ],],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/payscore/sign-plan/partner/user-sign-plans']->postAsync([
  'json' => [
    'service_id'            => '2002000000000558128851361561536',
    'plan_id'               => '01000033210000324638000000376258',
    'appid'                 => 'wxd678efh567hg6787',
    'sub_mchid'             => '1900000109',
    'sub_appid'             => 'wxd678efh567hg6999',
    'openid'                => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'sub_openid'            => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'merchant_sign_plan_no' => '1234323JKHDFE1243252',
    'notify_url'            => 'https://api.test.com',
    'sign_plan_detail'      => [[
      'plan_detail_no'          => 1,
      'merchant_plan_detail_no' => '1234323JKHDFE1243252',
    ],],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->payscore->signPlan->partner->userSignPlans->post([
  'json' => [
    'service_id'            => '2002000000000558128851361561536',
    'plan_id'               => '01000033210000324638000000376258',
    'appid'                 => 'wxd678efh567hg6787',
    'sub_mchid'             => '1900000109',
    'sub_appid'             => 'wxd678efh567hg6999',
    'openid'                => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'sub_openid'            => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'merchant_sign_plan_no' => '1234323JKHDFE1243252',
    'notify_url'            => 'https://api.test.com',
    'sign_plan_detail'      => [[
      'plan_detail_no'          => 1,
      'merchant_plan_detail_no' => '1234323JKHDFE1243252',
    ],],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/payscore/sign-plan/partner/user-sign-plans')->post([
  'json' => [
    'service_id'            => '2002000000000558128851361561536',
    'plan_id'               => '01000033210000324638000000376258',
    'appid'                 => 'wxd678efh567hg6787',
    'sub_mchid'             => '1900000109',
    'sub_appid'             => 'wxd678efh567hg6999',
    'openid'                => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'sub_openid'            => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'merchant_sign_plan_no' => '1234323JKHDFE1243252',
    'notify_url'            => 'https://api.test.com',
    'sign_plan_detail'      => [[
      'plan_detail_no'          => 1,
      'merchant_plan_detail_no' => '1234323JKHDFE1243252',
    ],],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/payscore/sign-plan/partner/user-sign-plans']->post([
  'json' => [
    'service_id'            => '2002000000000558128851361561536',
    'plan_id'               => '01000033210000324638000000376258',
    'appid'                 => 'wxd678efh567hg6787',
    'sub_mchid'             => '1900000109',
    'sub_appid'             => 'wxd678efh567hg6999',
    'openid'                => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'sub_openid'            => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'merchant_sign_plan_no' => '1234323JKHDFE1243252',
    'notify_url'            => 'https://api.test.com',
    'sign_plan_detail'      => [[
      'plan_detail_no'          => 1,
      'merchant_plan_detail_no' => '1234323JKHDFE1243252',
    ],],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
sign_planobject用户的签约计划
sign_plan_idstring计划签约ID
openidstring签约计划用户服务商应用下的OpenID
sub_openidstring签约计划用户子商户应用下的OpenID
service_idstring计划所属服务
mchidstring服务商商户号
sub_mchidstring子商户商户号
appidstring服务商AppID
sub_appidstring子商户AppID
merchant_sign_plan_nostring商户侧签约计划号
merchant_callback_urlstring商户回调地址
plan_idstring签约所属计划ID
going_detail_nonumber目前用户进行到的计划详情序号
sign_statestring计划签约状态
cancel_sign_timestring签约计划取消时间
cancel_sign_typestring签约计划取消类型
cancel_reasonstring签约计划取消原因
plan_namestring签约计划的名称
plan_over_timestring签约计划的过期时间
total_origin_pricenumber签约计划原总金额(单位分)
deduction_quantitynumber签约计划扣费次数
total_actual_pricenumber签约计划实际总金额(单位分)
signed_detail_listobject[]签约计划明细列表
plan_detail_nonumber计划明细序号
original_pricenumber计划明细原支付金额(单位分)
plan_discount_descriptionstring计划明细优惠说明
actual_pricenumber计划明细实际支付金额(单位分)
plan_detail_statestring计划明细状态
order_idstring计划明细对应的支付分服务单号
merchant_plan_detail_nostring商户侧计划明细使用订单号
plan_detail_namestring计划详情名称
actual_pay_pricenumber计划明细对应订单实际支付金额(单位分)
use_timestring详情使用时间
complete_timestring详情完成时间
cancel_timestring详情取消时间
sign_timestring签约时间
packagestring跳转微信侧确认签约小程序的数据

参阅 官方文档

Published on the GitHub by TheNorthMemory