Skip to content

Commit

Permalink
[更新]增加确认接受公众号将某权限集高级权限的授权接口
Browse files Browse the repository at this point in the history
  • Loading branch information
zoujingli committed May 23, 2018
1 parent 515884e commit d5fb9d2
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions WeOpen/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,27 @@ public function getAuthorizerInfo($authorizerAppid)
return $result['authorizer_info'];
}

/**
* 确认接受公众号将某权限集高级权限的授权
* @param string $authorizerAppid 授权公众号或小程序的appid
* @param string $funcscopeCategoryId 权限集ID
* @param string $confirmValue 是否确认(1.确认授权, 2.取消确认)
* @return array
* @throws InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function setAuthorization($authorizerAppid, $funcscopeCategoryId, $confirmValue)
{
$componentAccessToken = $this->getComponentAccessToken();
$url = "https://api.weixin.qq.com/cgi-bin/component/api_confirm_authorization?component_access_token={$componentAccessToken}";
return $this->httpPostForJson($url, [
'confirm_value' => $confirmValue,
'authorizer_appid' => $authorizerAppid,
'funcscope_category_id' => $funcscopeCategoryId,
'component_appid' => $this->config->get('component_appid'),
]);
}

/**
* 设置授权方的选项信息
* @param string $authorizerAppid 授权公众号或小程序的appid
Expand Down

0 comments on commit d5fb9d2

Please sign in to comment.