预开通服务
商户通过该接口获取preopenid,跳转到签约小程序后,用preopenid进行签约开通,本接口用于开通自动扣费前上传必要的信息。
🚫
本接口服务已于 2019.12.16
(北京时间)下线,文档仅做留存参考。
请求参数 | 类型 | 描述 |
---|---|---|
json | object | 声明请求的JSON 数据结构 |
sub_mchid | string | 特约商户号 |
appid | string | 服务商公众号ID |
sub_appid | string | 特约商户公众号ID |
trade_scene | string | 交易场景 |
openid | string | 用户标识 |
php
$instance->v3->ebike->charge->contracts->preopen->postAsync([
'json' => [
'sub_mchid' => '1510770601',
'appid' => 'wx47c677487ce3ac47',
'sub_appid' => 'wxcc603d9f0d54eaf0',
'trade_scene' => 'CHARGE',
'openid' => 'ot35_4gNgXsUuh2sQY0lT9N08AU0',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/ebike/charge/contracts/preopen')->postAsync([
'json' => [
'sub_mchid' => '1510770601',
'appid' => 'wx47c677487ce3ac47',
'sub_appid' => 'wxcc603d9f0d54eaf0',
'trade_scene' => 'CHARGE',
'openid' => 'ot35_4gNgXsUuh2sQY0lT9N08AU0',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/ebike/charge/contracts/preopen']->postAsync([
'json' => [
'sub_mchid' => '1510770601',
'appid' => 'wx47c677487ce3ac47',
'sub_appid' => 'wxcc603d9f0d54eaf0',
'trade_scene' => 'CHARGE',
'openid' => 'ot35_4gNgXsUuh2sQY0lT9N08AU0',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->ebike->charge->contracts->preopen->post([
'json' => [
'sub_mchid' => '1510770601',
'appid' => 'wx47c677487ce3ac47',
'sub_appid' => 'wxcc603d9f0d54eaf0',
'trade_scene' => 'CHARGE',
'openid' => 'ot35_4gNgXsUuh2sQY0lT9N08AU0',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/ebike/charge/contracts/preopen')->post([
'json' => [
'sub_mchid' => '1510770601',
'appid' => 'wx47c677487ce3ac47',
'sub_appid' => 'wxcc603d9f0d54eaf0',
'trade_scene' => 'CHARGE',
'openid' => 'ot35_4gNgXsUuh2sQY0lT9N08AU0',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/ebike/charge/contracts/preopen']->post([
'json' => [
'sub_mchid' => '1510770601',
'appid' => 'wx47c677487ce3ac47',
'sub_appid' => 'wxcc603d9f0d54eaf0',
'trade_scene' => 'CHARGE',
'openid' => 'ot35_4gNgXsUuh2sQY0lT9N08AU0',
],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典 | 类型 | 描述 |
---|---|---|
preopen_id | string | 预开通ID |
参阅 官方文档