Skip to content

查询用户授权状态

用户申请使用服务时,商户可通过此接口查询用户是否“已授权”本服务。在“已授权”状态下的服务,用户才可以申请使用。

请求参数类型描述
queryobject声明请求的查询参数
appidstring公众账号ID
service_idstring服务ID
openidstring用户标识
php
$instance->v3->payscore->userServiceState->getAsync([
  'query' => [
    'appid'      => '',
    'service_id' => '',
    'openid'     => '',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/payscore/user-service-state')->getAsync([
  'query' => [
    'appid'      => '',
    'service_id' => '',
    'openid'     => '',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/payscore/user-service-state']->getAsync([
  'query' => [
    'appid'      => '',
    'service_id' => '',
    'openid'     => '',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->payscore->userServiceState->get([
  'query' => [
    'appid'      => '',
    'service_id' => '',
    'openid'     => '',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/payscore/user-service-state')->get([
  'query' => [
    'appid'      => '',
    'service_id' => '',
    'openid'     => '',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/payscore/user-service-state']->get([
  'query' => [
    'appid'      => '',
    'service_id' => '',
    'openid'     => '',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
appidstring公众账号ID
service_idstring服务ID
openidstring用户标识
use_service_statestring用户授权服务情况
UNAVAILABLE | AVAILABLE 枚举值之一

参阅 官方文档

Published on the GitHub by TheNorthMemory