App场景预约扣费类型签约的预签约
商户可调用本接口预先指定签约信息,生成预签约会话及对应的预签约ID,再携带预签约ID(pre_entrustweb_id)参数,通过微信SDK拉起微信支付客户端的签约页面。
请求参数 | 类型 | 描述 |
---|---|---|
json | object | 声明请求的JSON 数据结构 |
sp_appid | string | 应用ID |
sp_openid | string | 用户在服务商商户应用下的用户标示 |
sub_mchid | string | 子商户号 |
sub_appid | string | 子商户的AppID |
sub_openid | string | 子商户AppID对应的用户OpenID |
plan_id | number | 委托代扣模板ID |
out_contract_code | string | 商户签约协议号 |
contract_display_account | string | 用户账户展示名称 |
contract_notify_url | string | 签约结果通知地址 |
out_user_code | string | 商户侧用户标识 |
deduct_schedule | object | 用于预约扣费的预约信息 |
estimated_deduct_date | string | 预计扣费的日期 |
estimated_deduct_amount | object | 预计的扣费金额 |
total | number | 金额 |
currency | string | 货币类型 |
description | string | 商品描述 |
php
$instance->v3->papay->scheduledDeductSign->partner->contracts->preEntrustSign->app->postAsync([
'json' => [
'sp_appid' => 'wxd678efh567hg6787',
'sp_openid' => 'oYobu0MVnQfWpSMOYJz2AHPG_gQw',
'sub_mchid' => '1900000109',
'sub_appid' => 'wxd678efh567hg6787',
'sub_openid' => 'wxd678efh567hg6787',
'plan_id' => 12535,
'out_contract_code' => 'wxwtdk20200910100000',
'contract_display_account' => '微信代扣用户A',
'contract_notify_url' => 'https://yourapp.com/notify',
'out_user_code' => '用户A',
'deduct_schedule' => [
'estimated_deduct_date' => '2019-11-22',
'estimated_deduct_amount' => [
'total' => 1,
'currency' => 'CNY',
],
'description' => '小乔-碎云皮肤(微信83区沧海之耀)',
],
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/papay/scheduled-deduct-sign/partner/contracts/pre-entrust-sign/app')->postAsync([
'json' => [
'sp_appid' => 'wxd678efh567hg6787',
'sp_openid' => 'oYobu0MVnQfWpSMOYJz2AHPG_gQw',
'sub_mchid' => '1900000109',
'sub_appid' => 'wxd678efh567hg6787',
'sub_openid' => 'wxd678efh567hg6787',
'plan_id' => 12535,
'out_contract_code' => 'wxwtdk20200910100000',
'contract_display_account' => '微信代扣用户A',
'contract_notify_url' => 'https://yourapp.com/notify',
'out_user_code' => '用户A',
'deduct_schedule' => [
'estimated_deduct_date' => '2019-11-22',
'estimated_deduct_amount' => [
'total' => 1,
'currency' => 'CNY',
],
'description' => '小乔-碎云皮肤(微信83区沧海之耀)',
],
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/papay/scheduled-deduct-sign/partner/contracts/pre-entrust-sign/app']->postAsync([
'json' => [
'sp_appid' => 'wxd678efh567hg6787',
'sp_openid' => 'oYobu0MVnQfWpSMOYJz2AHPG_gQw',
'sub_mchid' => '1900000109',
'sub_appid' => 'wxd678efh567hg6787',
'sub_openid' => 'wxd678efh567hg6787',
'plan_id' => 12535,
'out_contract_code' => 'wxwtdk20200910100000',
'contract_display_account' => '微信代扣用户A',
'contract_notify_url' => 'https://yourapp.com/notify',
'out_user_code' => '用户A',
'deduct_schedule' => [
'estimated_deduct_date' => '2019-11-22',
'estimated_deduct_amount' => [
'total' => 1,
'currency' => 'CNY',
],
'description' => '小乔-碎云皮肤(微信83区沧海之耀)',
],
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->papay->scheduledDeductSign->partner->contracts->preEntrustSign->app->post([
'json' => [
'sp_appid' => 'wxd678efh567hg6787',
'sp_openid' => 'oYobu0MVnQfWpSMOYJz2AHPG_gQw',
'sub_mchid' => '1900000109',
'sub_appid' => 'wxd678efh567hg6787',
'sub_openid' => 'wxd678efh567hg6787',
'plan_id' => 12535,
'out_contract_code' => 'wxwtdk20200910100000',
'contract_display_account' => '微信代扣用户A',
'contract_notify_url' => 'https://yourapp.com/notify',
'out_user_code' => '用户A',
'deduct_schedule' => [
'estimated_deduct_date' => '2019-11-22',
'estimated_deduct_amount' => [
'total' => 1,
'currency' => 'CNY',
],
'description' => '小乔-碎云皮肤(微信83区沧海之耀)',
],
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/papay/scheduled-deduct-sign/partner/contracts/pre-entrust-sign/app')->post([
'json' => [
'sp_appid' => 'wxd678efh567hg6787',
'sp_openid' => 'oYobu0MVnQfWpSMOYJz2AHPG_gQw',
'sub_mchid' => '1900000109',
'sub_appid' => 'wxd678efh567hg6787',
'sub_openid' => 'wxd678efh567hg6787',
'plan_id' => 12535,
'out_contract_code' => 'wxwtdk20200910100000',
'contract_display_account' => '微信代扣用户A',
'contract_notify_url' => 'https://yourapp.com/notify',
'out_user_code' => '用户A',
'deduct_schedule' => [
'estimated_deduct_date' => '2019-11-22',
'estimated_deduct_amount' => [
'total' => 1,
'currency' => 'CNY',
],
'description' => '小乔-碎云皮肤(微信83区沧海之耀)',
],
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/papay/scheduled-deduct-sign/partner/contracts/pre-entrust-sign/app']->post([
'json' => [
'sp_appid' => 'wxd678efh567hg6787',
'sp_openid' => 'oYobu0MVnQfWpSMOYJz2AHPG_gQw',
'sub_mchid' => '1900000109',
'sub_appid' => 'wxd678efh567hg6787',
'sub_openid' => 'wxd678efh567hg6787',
'plan_id' => 12535,
'out_contract_code' => 'wxwtdk20200910100000',
'contract_display_account' => '微信代扣用户A',
'contract_notify_url' => 'https://yourapp.com/notify',
'out_user_code' => '用户A',
'deduct_schedule' => [
'estimated_deduct_date' => '2019-11-22',
'estimated_deduct_amount' => [
'total' => 1,
'currency' => 'CNY',
],
'description' => '小乔-碎云皮肤(微信83区沧海之耀)',
],
],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典 | 类型 | 描述 |
---|---|---|
pre_entrustweb_id | string | 预签约ID |
参阅 官方文档