Constants

CACHE_KEY_ACCESS_TOKEN

CACHE_KEY_ACCESS_TOKEN = 'easywechat.open_platform.authorizer_access_token'

CACHE_KEY_REFRESH_TOKEN

CACHE_KEY_REFRESH_TOKEN = 'easywechat.open_platform.authorizer_refresh_token'

Properties

$appId

$appId : string

Authorizer AppId.

Type

string

$openPlatformAppId

$openPlatformAppId : string

OpenPlatform AppId.

Type

string

Methods

setAppId()

setAppId(string  $appId) : $this

Sets the authorizer app id.

Parameters

string $appId

Returns

$this

getAppId()

getAppId() : string

Gets the authorizer app id, or throws if not found.

Throws

\EasyWeChat\Core\Exception

Returns

string

setAccessToken()

setAccessToken(string  $token, integer  $expires = 7200) : $this

Saves the authorizer access token in cache.

Parameters

string $token
integer $expires

Returns

$this

getAccessToken()

getAccessToken() : string

Gets the authorizer access token.

Returns

string

setRefreshToken()

setRefreshToken(string  $refreshToken) : $this

Saves the authorizer refresh token in cache.

Parameters

string $refreshToken

Returns

$this

getRefreshToken()

getRefreshToken() : string

Gets the authorizer refresh token.

Throws

\EasyWeChat\Core\Exception

when refresh token is not present

Returns

string

getAccessTokenCacheKey()

getAccessTokenCacheKey() : string

Gets the authorizer access token cache key.

Returns

string

getRefreshTokenCacheKey()

getRefreshTokenCacheKey() : string

Gets the authorizer refresh token cache key.

Returns

string