商户预授权
商户预授权
请求参数 | 类型 | 描述 |
---|---|---|
json | object | 声明请求的JSON 数据结构 |
service_id | string | 服务ID |
appid | string | 服务商应用ID |
sub_appid | string | 子商户应用ID |
sub_mchid | string | 子商户号 |
authorization_code | string | 授权协议号 |
notify_url | string | 商户回调地址 |
php
$instance->v3->payscore->partner->permissions->postAsync([
'json' => [
'service_id' => 'service_id',
'appid' => 'wxd678efh567hg6787',
'sub_appid' => 'wxd678efh567hg6787',
'sub_mchid' => '1230000109',
'authorization_code' => '1234323JKHDFE1243252',
'notify_url' => 'http://www.qq.com',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
php
$instance->chain('v3/payscore/partner/permissions')->postAsync([
'json' => [
'service_id' => 'service_id',
'appid' => 'wxd678efh567hg6787',
'sub_appid' => 'wxd678efh567hg6787',
'sub_mchid' => '1230000109',
'authorization_code' => '1234323JKHDFE1243252',
'notify_url' => 'http://www.qq.com',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
php
$instance['v3/payscore/partner/permissions']->postAsync([
'json' => [
'service_id' => 'service_id',
'appid' => 'wxd678efh567hg6787',
'sub_appid' => 'wxd678efh567hg6787',
'sub_mchid' => '1230000109',
'authorization_code' => '1234323JKHDFE1243252',
'notify_url' => 'http://www.qq.com',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
php
$response = $instance->v3->payscore->partner->permissions->post([
'json' => [
'service_id' => 'service_id',
'appid' => 'wxd678efh567hg6787',
'sub_appid' => 'wxd678efh567hg6787',
'sub_mchid' => '1230000109',
'authorization_code' => '1234323JKHDFE1243252',
'notify_url' => 'http://www.qq.com',
],
]);
print_r(json_decode((string) $response->getBody(), true));
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
php
$response = $instance->chain('v3/payscore/partner/permissions')->post([
'json' => [
'service_id' => 'service_id',
'appid' => 'wxd678efh567hg6787',
'sub_appid' => 'wxd678efh567hg6787',
'sub_mchid' => '1230000109',
'authorization_code' => '1234323JKHDFE1243252',
'notify_url' => 'http://www.qq.com',
],
]);
print_r(json_decode((string) $response->getBody(), true));
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
php
$response = $instance['v3/payscore/partner/permissions']->post([
'json' => [
'service_id' => 'service_id',
'appid' => 'wxd678efh567hg6787',
'sub_appid' => 'wxd678efh567hg6787',
'sub_mchid' => '1230000109',
'authorization_code' => '1234323JKHDFE1243252',
'notify_url' => 'http://www.qq.com',
],
]);
print_r(json_decode((string) $response->getBody(), true));
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
返回字典 | 类型 | 描述 |
---|---|---|
apply_permissions_token | string | 预授权token |