创建用户的签约计划
商户通过此接口基于商户已创建且正常进行中的支付分计划,创建用户的签约计划以供用户签约。
请求参数 | 类型 | 描述 |
---|---|---|
json | object | 声明请求的JSON 数据结构 |
service_id | string | 支付分服务ID |
plan_id | string | 支付分计划ID |
appid | string | AppID |
openid | string | 待签约用户在商户应用下的OpenID |
merchant_sign_plan_no | string | 商户签约计划单号 |
notify_url | string | 签约成功事件通知回调地址 |
sign_plan_detail | object[] | 签约计划对应的计划详情列表的商户侧单号信息 |
plan_detail_no | number | 计划明细序号 |
merchant_plan_detail_no | string | 商户侧计划明细使用订单号 |
php
$instance->v3->payscore->signPlan->userSignPlans->postAsync([
'json' => [
'service_id' => '2002000000000558128851361561536',
'plan_id' => '01000033210000324638000000376258',
'appid' => 'wxd678efh567hg6787',
'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/user-sign-plans')->postAsync([
'json' => [
'service_id' => '2002000000000558128851361561536',
'plan_id' => '01000033210000324638000000376258',
'appid' => 'wxd678efh567hg6787',
'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/user-sign-plans']->postAsync([
'json' => [
'service_id' => '2002000000000558128851361561536',
'plan_id' => '01000033210000324638000000376258',
'appid' => 'wxd678efh567hg6787',
'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->userSignPlans->post([
'json' => [
'service_id' => '2002000000000558128851361561536',
'plan_id' => '01000033210000324638000000376258',
'appid' => 'wxd678efh567hg6787',
'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/user-sign-plans')->post([
'json' => [
'service_id' => '2002000000000558128851361561536',
'plan_id' => '01000033210000324638000000376258',
'appid' => 'wxd678efh567hg6787',
'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/user-sign-plans']->post([
'json' => [
'service_id' => '2002000000000558128851361561536',
'plan_id' => '01000033210000324638000000376258',
'appid' => 'wxd678efh567hg6787',
'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_plan | object | 用户的签约计划 |
sign_plan_id | string | 计划签约ID |
openid | string | 签约计划用户应用下的OpenID |
service_id | string | 计划所属服务 |
mchid | string | 商户号 |
appid | string | AppID |
merchant_sign_plan_no | string | 商户侧签约计划号 |
merchant_callback_url | string | 商户回调地址 |
plan_id | string | 签约所属计划ID |
going_detail_no | number | 目前用户进行到的计划详情序号 |
sign_state | string | 计划签约状态 |
cancel_sign_time | string | 签约计划取消时间 |
cancel_sign_type | string | 签约计划取消类型 |
cancel_reason | string | 签约计划取消原因 |
plan_name | string | 签约计划的名称 |
plan_over_time | string | 签约计划的过期时间 |
total_origin_price | number | 签约计划原总金额(单位分) |
deduction_quantity | number | 签约计划扣费次数 |
total_actual_price | number | 签约计划实际总金额(单位分) |
signed_detail_list | object[] | 签约计划明细列表 |
plan_detail_no | number | 计划明细序号 |
original_price | number | 计划明细原支付金额(单位分) |
plan_discount_description | string | 计划明细优惠说明 |
actual_price | number | 计划明细实际支付金额(单位分) |
plan_detail_state | string | 计划明细状态 |
order_id | string | 计划明细对应的支付分服务单号 |
merchant_plan_detail_no | string | 商户侧计划明细使用订单号 |
plan_detail_name | string | 计划详情名称 |
actual_pay_price | number | 计划明细对应订单实际支付金额(单位分) |
use_time | string | 详情使用时间 |
complete_time | string | 详情完成时间 |
cancel_time | string | 详情取消时间 |
sign_time | string | 签约时间 |
package | string | 跳转微信侧确认签约小程序的数据 |
参阅 官方文档