Skip to content

服务关联预授权

模式一:在刷掌原生小程序完成开通刷掌服务后,继续授权商家刷掌服务,跳转到商家侧,触发商家调用预授权;模式二:商家主动发起授权,先调用预授权接口,再跳转刷掌小程序

🔰

微信刷掌服务目前正在逐步推广中,暂不支持开放接入。如有合作意愿,请联系行业的运营经理沟通。

请求参数类型描述
jsonobject声明请求的JSON数据结构
openidstringOpenID
preauthorize_session_idstring预授权会话ID
organization_idstring机构ID
php
$instance->v3->palmservice->authorization->preauthorize->postAsync([
  'json' => [
    'openid'                  => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'preauthorize_session_id' => '181167098309019291163',
    'organization_id'         => '1004',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/palmservice/authorization/preauthorize')->postAsync([
  'json' => [
    'openid'                  => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'preauthorize_session_id' => '181167098309019291163',
    'organization_id'         => '1004',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/palmservice/authorization/preauthorize']->postAsync([
  'json' => [
    'openid'                  => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'preauthorize_session_id' => '181167098309019291163',
    'organization_id'         => '1004',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->palmservice->authorization->preauthorize->post([
  'json' => [
    'openid'                  => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'preauthorize_session_id' => '181167098309019291163',
    'organization_id'         => '1004',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/palmservice/authorization/preauthorize')->post([
  'json' => [
    'openid'                  => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'preauthorize_session_id' => '181167098309019291163',
    'organization_id'         => '1004',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/palmservice/authorization/preauthorize']->post([
  'json' => [
    'openid'                  => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'preauthorize_session_id' => '181167098309019291163',
    'organization_id'         => '1004',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
permission_tokenstring预授权token

参阅 官方文档

Published on the GitHub by TheNorthMemory