H5场景预约扣费类型签约的预签约
商户可调用本接口预先指定签约信息,生成预签约会话及对应的跳转URL,引导用户在原浏览器中请求该URL,将跳转至用户微信支付客户端的签约页面。
请求参数 | 类型 | 描述 |
---|---|---|
json | object | 声明请求的JSON 数据结构 |
appid | string | 应用ID |
openid | string | 用户在直连商户应用下的用户标示 |
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 | 商品描述 |
jump_control | object | 跳转控制信息 |
jump_appid | string | 跳转的应用AppID |
php
$instance->v3->papay->scheduledDeductSign->contracts->preEntrustSign->h5->postAsync([
'json' => [
'appid' => 'wxd678efh567hg6787',
'openid' => 'oYobu0MVnQfWpSMOYJz2AHPG_gQw',
'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区沧海之耀)',
],
'jump_control' => [
'jump_appid' => 'wxd678efh567hg6787',
],
],
])
->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/contracts/pre-entrust-sign/h5')->postAsync([
'json' => [
'appid' => 'wxd678efh567hg6787',
'openid' => 'oYobu0MVnQfWpSMOYJz2AHPG_gQw',
'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区沧海之耀)',
],
'jump_control' => [
'jump_appid' => 'wxd678efh567hg6787',
],
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/papay/scheduled-deduct-sign/contracts/pre-entrust-sign/h5']->postAsync([
'json' => [
'appid' => 'wxd678efh567hg6787',
'openid' => 'oYobu0MVnQfWpSMOYJz2AHPG_gQw',
'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区沧海之耀)',
],
'jump_control' => [
'jump_appid' => 'wxd678efh567hg6787',
],
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->papay->scheduledDeductSign->contracts->preEntrustSign->h5->post([
'json' => [
'appid' => 'wxd678efh567hg6787',
'openid' => 'oYobu0MVnQfWpSMOYJz2AHPG_gQw',
'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区沧海之耀)',
],
'jump_control' => [
'jump_appid' => 'wxd678efh567hg6787',
],
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/papay/scheduled-deduct-sign/contracts/pre-entrust-sign/h5')->post([
'json' => [
'appid' => 'wxd678efh567hg6787',
'openid' => 'oYobu0MVnQfWpSMOYJz2AHPG_gQw',
'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区沧海之耀)',
],
'jump_control' => [
'jump_appid' => 'wxd678efh567hg6787',
],
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/papay/scheduled-deduct-sign/contracts/pre-entrust-sign/h5']->post([
'json' => [
'appid' => 'wxd678efh567hg6787',
'openid' => 'oYobu0MVnQfWpSMOYJz2AHPG_gQw',
'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区沧海之耀)',
],
'jump_control' => [
'jump_appid' => 'wxd678efh567hg6787',
],
],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典 | 类型 | 描述 |
---|---|---|
redirect_url | string | 拉起微信支付客户端的URL |
参阅 官方文档