APP方式预签约
电商服务商从外部App拉起微信客户端发起签约前,需先后台调用预签约接口完成预签约,获取pre_entrustweb_id,再拉起微信客户端;用户完成签约授权后,再返回App。
请求参数 | 类型 | 描述 |
---|---|---|
json | object | 声明请求的JSON 数据结构 |
appid | string | 商户APPID |
plan_id | integer | 委托代扣协议模板Id |
out_contract_code | string | 商户签约协议号 |
contract_display_account | string | 用户账户展示名称 |
notify_url | string | 回调通知地址 |
return_app | boolean | 返回app标识 |
php
$instance->v3->ecommerce->combinePapay->contracts->preEntrustSign->postAsync([
'json' => [
'appid' => 'wxd678efh567hg6787',
'plan_id' => 12535,
'out_contract_code' => 'wxwtdk20200910100000',
'contract_display_account' => '微信代扣用户A',
'notify_url' => 'https://yourapp.com/notify',
'return_app' => true,
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/ecommerce/combine-papay/contracts/pre-entrust-sign')->postAsync([
'json' => [
'appid' => 'wxd678efh567hg6787',
'plan_id' => 12535,
'out_contract_code' => 'wxwtdk20200910100000',
'contract_display_account' => '微信代扣用户A',
'notify_url' => 'https://yourapp.com/notify',
'return_app' => true,
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/ecommerce/combine-papay/contracts/pre-entrust-sign']->postAsync([
'json' => [
'appid' => 'wxd678efh567hg6787',
'plan_id' => 12535,
'out_contract_code' => 'wxwtdk20200910100000',
'contract_display_account' => '微信代扣用户A',
'notify_url' => 'https://yourapp.com/notify',
'return_app' => true,
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->ecommerce->combinePapay->contracts->preEntrustSign->post([
'json' => [
'appid' => 'wxd678efh567hg6787',
'plan_id' => 12535,
'out_contract_code' => 'wxwtdk20200910100000',
'contract_display_account' => '微信代扣用户A',
'notify_url' => 'https://yourapp.com/notify',
'return_app' => true,
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/ecommerce/combine-papay/contracts/pre-entrust-sign')->post([
'json' => [
'appid' => 'wxd678efh567hg6787',
'plan_id' => 12535,
'out_contract_code' => 'wxwtdk20200910100000',
'contract_display_account' => '微信代扣用户A',
'notify_url' => 'https://yourapp.com/notify',
'return_app' => true,
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/ecommerce/combine-papay/contracts/pre-entrust-sign']->post([
'json' => [
'appid' => 'wxd678efh567hg6787',
'plan_id' => 12535,
'out_contract_code' => 'wxwtdk20200910100000',
'contract_display_account' => '微信代扣用户A',
'notify_url' => 'https://yourapp.com/notify',
'return_app' => true,
],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典 | 类型 | 描述 |
---|---|---|
pre_entrustweb_id | string | 预签约Id |
mchid | string | 商户号 |
plan_id | integer | 委托代扣协议模板Id |
out_contract_code | string | 商户签约协议号 |
参阅 官方文档