查询用户授权状态
用户申请使用服务时,商户可通过此接口查询用户是否“已授权”本服务。在“已授权”状态下的服务,用户才可以申请使用。
请求参数 | 类型 | 描述 |
---|---|---|
query | object | 声明请求的查询参数 |
appid | string | 公众账号ID |
service_id | string | 服务ID |
openid | string | 用户标识 |
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));
返回字典 | 类型 | 描述 |
---|---|---|
appid | string | 公众账号ID |
service_id | string | 服务ID |
openid | string | 用户标识 |
use_service_state | string | 用户授权服务情况UNAVAILABLE | AVAILABLE 枚举值之一 |
参阅 官方文档