服务商场景中预授权
服务商场景中预授权
请求参数 | 类型 | 描述 |
---|---|---|
json | object | 声明请求的JSON 数据结构 |
service_id | string | 服务ID |
appid | string | 服务商的公众号ID |
sub_appid | string | 子商户的公众号ID |
sub_mchid | string | 子商户的商户号 |
authorization_code | string | 授权协议号 |
notify_url | string | 通知地址 |
scene | string | 授权场景 |
transaction_scene_info | object | 微信支付交易中授权附带的参数 |
mchid | string | 支付下单的商户号 |
sub_mchid | string | 支付下单的子商户号 |
php
$instance->v3->payscore->partner->permissions->applyForScene->postAsync([
'json' => [
'service_id' => '500001',
'appid' => 'wxd678efh567hg6787',
'sub_appid' => 'wxd678efh567hg6787',
'sub_mchid' => '1230000109',
'authorization_code' => '实例1234323JKHDFE1243252',
'notify_url' => 'http://www.qq.com',
'scene' => 'TRANSACTION',
'transaction_scene_info' => [
'mchid' => '1230000109',
'sub_mchid' => '1230000109',
],
],
])
->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
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
php
$instance->chain('v3/payscore/partner/permissions/apply-for-scene')->postAsync([
'json' => [
'service_id' => '500001',
'appid' => 'wxd678efh567hg6787',
'sub_appid' => 'wxd678efh567hg6787',
'sub_mchid' => '1230000109',
'authorization_code' => '实例1234323JKHDFE1243252',
'notify_url' => 'http://www.qq.com',
'scene' => 'TRANSACTION',
'transaction_scene_info' => [
'mchid' => '1230000109',
'sub_mchid' => '1230000109',
],
],
])
->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
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
php
$instance['v3/payscore/partner/permissions/apply-for-scene']->postAsync([
'json' => [
'service_id' => '500001',
'appid' => 'wxd678efh567hg6787',
'sub_appid' => 'wxd678efh567hg6787',
'sub_mchid' => '1230000109',
'authorization_code' => '实例1234323JKHDFE1243252',
'notify_url' => 'http://www.qq.com',
'scene' => 'TRANSACTION',
'transaction_scene_info' => [
'mchid' => '1230000109',
'sub_mchid' => '1230000109',
],
],
])
->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
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
php
$response = $instance->v3->payscore->partner->permissions->applyForScene->post([
'json' => [
'service_id' => '500001',
'appid' => 'wxd678efh567hg6787',
'sub_appid' => 'wxd678efh567hg6787',
'sub_mchid' => '1230000109',
'authorization_code' => '实例1234323JKHDFE1243252',
'notify_url' => 'http://www.qq.com',
'scene' => 'TRANSACTION',
'transaction_scene_info' => [
'mchid' => '1230000109',
'sub_mchid' => '1230000109',
],
],
]);
print_r(json_decode((string) $response->getBody(), true));
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
php
$response = $instance->chain('v3/payscore/partner/permissions/apply-for-scene')->post([
'json' => [
'service_id' => '500001',
'appid' => 'wxd678efh567hg6787',
'sub_appid' => 'wxd678efh567hg6787',
'sub_mchid' => '1230000109',
'authorization_code' => '实例1234323JKHDFE1243252',
'notify_url' => 'http://www.qq.com',
'scene' => 'TRANSACTION',
'transaction_scene_info' => [
'mchid' => '1230000109',
'sub_mchid' => '1230000109',
],
],
]);
print_r(json_decode((string) $response->getBody(), true));
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
php
$response = $instance['v3/payscore/partner/permissions/apply-for-scene']->post([
'json' => [
'service_id' => '500001',
'appid' => 'wxd678efh567hg6787',
'sub_appid' => 'wxd678efh567hg6787',
'sub_mchid' => '1230000109',
'authorization_code' => '实例1234323JKHDFE1243252',
'notify_url' => 'http://www.qq.com',
'scene' => 'TRANSACTION',
'transaction_scene_info' => [
'mchid' => '1230000109',
'sub_mchid' => '1230000109',
],
],
]);
print_r(json_decode((string) $response->getBody(), true));
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
返回字典 | 类型 | 描述 |
---|---|---|
scene | string | 授权场景, 与输入中一致 |
transaction_permissions_token | string | 微信支付交易中授权token |
参阅 官方文档