Constants

GET

GET = 'get'

POST

POST = 'post'

JSON

JSON = 'json'

GET_AUTH_INFO

GET_AUTH_INFO = 'https://api.weixin.qq.com/cgi-bin/component/api_query_auth'

Get auth info api.

GET_AUTHORIZER_TOKEN

GET_AUTHORIZER_TOKEN = 'https://api.weixin.qq.com/cgi-bin/component/api_authorizer_token'

Get authorizer token api.

GET_AUTHORIZER_INFO

GET_AUTHORIZER_INFO = 'https://api.weixin.qq.com/cgi-bin/component/api_get_authorizer_info'

Get authorizer info api.

GET_AUTHORIZER_OPTION

GET_AUTHORIZER_OPTION = 'https://api.weixin.qq.com/cgi-bin/component/api_get_authorizer_option'

Get authorizer options api.

SET_AUTHORIZER_OPTION

SET_AUTHORIZER_OPTION = 'https://api.weixin.qq.com/cgi-bin/component/api_set_authorizer_option'

Set authorizer options api.

GET_AUTHORIZER_LIST

GET_AUTHORIZER_LIST = 'https://api.weixin.qq.com/cgi-bin/component/api_get_authorizer_list'

Properties

$maxRetries

$maxRetries : integer

Type

integer

Methods

getAppId()

getAppId() : string

Get OpenPlatform AppId.

Returns

string

setHttp()

setHttp(\EasyWeChat\Core\Http  $http) : $this

Set the http instance.

Parameters

\EasyWeChat\Core\Http $http

Returns

$this

setAccessToken()

setAccessToken(\EasyWeChat\Core\AccessToken  $accessToken) : $this

Set the request token.

Parameters

\EasyWeChat\Core\AccessToken $accessToken

Returns

$this

maxRetries()

maxRetries(integer  $retries) 

Parameters

integer $retries

parseJSON()

parseJSON(string  $method, array  $args) : \EasyWeChat\Support\Collection

Parse JSON from response and check error.

Parameters

string $method
array $args

Returns

\EasyWeChat\Support\Collection

getAuthorizationInfo()

getAuthorizationInfo(  $authCode = null) : \EasyWeChat\Support\Collection

Get authorization info.

Parameters

$authCode

Returns

\EasyWeChat\Support\Collection

getAuthorizerToken()

getAuthorizerToken(  $appId,   $refreshToken) : \EasyWeChat\Support\Collection

Get authorizer token.

It doesn't cache the authorizer-access-token. So developers should NEVER call this method. It'll called by: AuthorizerAccessToken::renewAccessToken()

Parameters

$appId
$refreshToken

Returns

\EasyWeChat\Support\Collection

getAuthorizerInfo()

getAuthorizerInfo(string  $authorizerAppId) : \EasyWeChat\Support\Collection

Get authorizer info.

Parameters

string $authorizerAppId

Returns

\EasyWeChat\Support\Collection

getAuthorizerOption()

getAuthorizerOption(  $authorizerAppId,   $optionName) : \EasyWeChat\Support\Collection

Get options.

Parameters

$authorizerAppId
$optionName

Returns

\EasyWeChat\Support\Collection

setAuthorizerOption()

setAuthorizerOption(  $authorizerAppId,   $optionName,   $optionValue) : \EasyWeChat\Support\Collection

Set authorizer option.

Parameters

$authorizerAppId
$optionName
$optionValue

Returns

\EasyWeChat\Support\Collection

getAuthorizerList()

getAuthorizerList(integer  $offset, integer  $count = 500) : \EasyWeChat\Support\Collection

Get authorizer list.

Parameters

integer $offset
integer $count

Returns

\EasyWeChat\Support\Collection

registerHttpMiddlewares()

registerHttpMiddlewares() 

Register Guzzle middlewares.

accessTokenMiddleware()

accessTokenMiddleware() : \Closure

Attache access token to request query.

Returns

\Closure

logMiddleware()

logMiddleware() : \Closure

Log the request.

Returns

\Closure

retryMiddleware()

retryMiddleware() : \Closure

Return retry middleware.

Returns

\Closure

checkAndThrow()

checkAndThrow(array  $contents) 

Check the array data errors, and Throw exception when the contents contains error.

Parameters

array $contents

Throws

\EasyWeChat\Core\Exceptions\HttpException