创建支付分计划
商户可以基于有按计划确认权限的服务,通过此接口创建支付分计划。
请求参数 | 类型 | 描述 |
---|---|---|
json | object | 声明请求的JSON 数据结构 |
service_id | string | 计划所属服务 |
appid | string | AppID |
plan_name | string | 支付分计划名称 |
plan_duration | number | 支付分计划有效期(单位天) |
deduction_quantity | number | 支付分计划扣费次数 |
total_original_price | number | 支付分计划原总金额(单位分) |
total_actual_price | number | 支付分计划实际扣费总金额(单位分) |
plan_detail_list | object[] | 支付分计划明细列表 |
original_price | number | 计划明细原支付金额(单位分) |
plan_discount_description | string | 计划明细优惠说明 |
actual_price | number | 计划明细实际支付金额(单位分) |
plan_detail_name | string | 计划明细名称 |
merchant_plan_no | string | 商户侧计划号 |
php
$instance->v3->payscore->plan->payscorePlans->postAsync([
'json' => [
'service_id' => '2002000000000558128851361561536',
'appid' => 'wxd678efh567hg6787',
'plan_name' => '瑜伽课20节',
'plan_duration' => 300,
'deduction_quantity' => 10,
'total_original_price' => 15000,
'total_actual_price' => 15000,
'plan_detail_list' => [[
'original_price' => 15000,
'plan_discount_description' => '享受九折',
'actual_price' => 14000,
'plan_detail_name' => '第八节课',
],],
'merchant_plan_no' => '1234323JKHDFE1243252',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/payscore/plan/payscore-plans')->postAsync([
'json' => [
'service_id' => '2002000000000558128851361561536',
'appid' => 'wxd678efh567hg6787',
'plan_name' => '瑜伽课20节',
'plan_duration' => 300,
'deduction_quantity' => 10,
'total_original_price' => 15000,
'total_actual_price' => 15000,
'plan_detail_list' => [[
'original_price' => 15000,
'plan_discount_description' => '享受九折',
'actual_price' => 14000,
'plan_detail_name' => '第八节课',
],],
'merchant_plan_no' => '1234323JKHDFE1243252',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/payscore/plan/payscore-plans']->postAsync([
'json' => [
'service_id' => '2002000000000558128851361561536',
'appid' => 'wxd678efh567hg6787',
'plan_name' => '瑜伽课20节',
'plan_duration' => 300,
'deduction_quantity' => 10,
'total_original_price' => 15000,
'total_actual_price' => 15000,
'plan_detail_list' => [[
'original_price' => 15000,
'plan_discount_description' => '享受九折',
'actual_price' => 14000,
'plan_detail_name' => '第八节课',
],],
'merchant_plan_no' => '1234323JKHDFE1243252',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->payscore->plan->payscorePlans->post([
'json' => [
'service_id' => '2002000000000558128851361561536',
'appid' => 'wxd678efh567hg6787',
'plan_name' => '瑜伽课20节',
'plan_duration' => 300,
'deduction_quantity' => 10,
'total_original_price' => 15000,
'total_actual_price' => 15000,
'plan_detail_list' => [[
'original_price' => 15000,
'plan_discount_description' => '享受九折',
'actual_price' => 14000,
'plan_detail_name' => '第八节课',
],],
'merchant_plan_no' => '1234323JKHDFE1243252',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/payscore/plan/payscore-plans')->post([
'json' => [
'service_id' => '2002000000000558128851361561536',
'appid' => 'wxd678efh567hg6787',
'plan_name' => '瑜伽课20节',
'plan_duration' => 300,
'deduction_quantity' => 10,
'total_original_price' => 15000,
'total_actual_price' => 15000,
'plan_detail_list' => [[
'original_price' => 15000,
'plan_discount_description' => '享受九折',
'actual_price' => 14000,
'plan_detail_name' => '第八节课',
],],
'merchant_plan_no' => '1234323JKHDFE1243252',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/payscore/plan/payscore-plans']->post([
'json' => [
'service_id' => '2002000000000558128851361561536',
'appid' => 'wxd678efh567hg6787',
'plan_name' => '瑜伽课20节',
'plan_duration' => 300,
'deduction_quantity' => 10,
'total_original_price' => 15000,
'total_actual_price' => 15000,
'plan_detail_list' => [[
'original_price' => 15000,
'plan_discount_description' => '享受九折',
'actual_price' => 14000,
'plan_detail_name' => '第八节课',
],],
'merchant_plan_no' => '1234323JKHDFE1243252',
],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典 | 类型 | 描述 |
---|---|---|
plan_id | string | 支付分计划ID |
service_id | string | 计划所属服务 |
mchid | string | 商户号 |
appid | string | AppID |
merchant_plan_no | string | 商户侧计划号 |
plan_name | string | 支付分计划名称 |
plan_duration | number | 支付分计划有效期(单位天) |
plan_state | string | 支付分计划状态 |
total_original_price | number | 支付分计划原总金额(单位分) |
deduction_quantity | number | 支付分计划扣费次数 |
total_actual_price | number | 支付分计划实际扣费总金额(单位分) |
plan_detail_list | object[] | 支付分计划明细列表 |
plan_detail_no | number | 计划明细序号 |
plan_detail_name | string | 计划明细名称 |
original_price | number | 计划明细原支付金额(单位分) |
plan_discount_description | string | 计划明细优惠说明 |
actual_price | number | 计划明细实际支付金额(单位分) |
stop_mchid | string | 终止方商户号 |
stop_time | string | 终止时间 |
参阅 官方文档