Properties

$baseUrl

$baseUrl : string

The base url of WeChat API.

Type

string

$openId

$openId : 

{@inheritdoc}.

Type

$scopes

$scopes : array

{@inheritdoc}.

Type

array

$stateless

$stateless : boolean

Indicates if the session state should be utilized.

Type

boolean

$withCountryCode

$withCountryCode : boolean

Return country code instead of country name.

Type

boolean

$name

$name : string

Provider name.

Type

string

$clientId

$clientId : string

The client ID.

Type

string

$clientSecret

$clientSecret : string

The client secret.

Type

string

$redirectUrl

$redirectUrl : string

The redirect URL.

Type

string

$parameters

$parameters : array

The custom parameters to be sent with the request.

Type

array

$scopeSeparator

$scopeSeparator : string

The separating character for the requested scopes.

Type

string

$encodingType

$encodingType : integer

The type of the encoding in the query.

Type

integer — Can be either PHP_QUERY_RFC3986 or PHP_QUERY_RFC1738

$componentAppId

$componentAppId : string

Component AppId.

Type

string

$componentAccessToken

$componentAccessToken : string

Component Access Token.

Type

string

Methods

withCountryCode()

withCountryCode() : $this

Return country code instead of country name.

Returns

$this

getAccessToken()

getAccessToken(string  $code) : \Overtrue\Socialite\AccessTokenInterface

Get the access token for the given code.

Parameters

string $code

Returns

\Overtrue\Socialite\AccessTokenInterface

getCodeFields()

getCodeFields(string|null  $state = null) : array

{@inheritdoc}.

Parameters

string|null $state

Returns

array

__construct()

__construct(\Symfony\Component\HttpFoundation\Request  $request, string  $clientId, \EasyWeChat\OpenPlatform\AccessToken|array  $credentials, string|null  $redirectUrl = null) 

Create a new provider instance.

(Overriding).

Parameters

\Symfony\Component\HttpFoundation\Request $request
string $clientId
\EasyWeChat\OpenPlatform\AccessToken|array $credentials
string|null $redirectUrl

redirect()

redirect(string  $redirectUrl = null) : \Symfony\Component\HttpFoundation\RedirectResponse

Redirect the user of the application to the provider's authentication screen.

Parameters

string $redirectUrl

Returns

\Symfony\Component\HttpFoundation\RedirectResponse

setRedirectUrl()

setRedirectUrl(string  $redirectUrl) : $this

Set redirect url.

Parameters

string $redirectUrl

Returns

$this

withRedirectUrl()

withRedirectUrl(string  $redirectUrl) : $this

Set redirect url.

Parameters

string $redirectUrl

Returns

$this

getRedirectUrl()

getRedirectUrl() : string

Return the redirect url.

Returns

string

scopes()

scopes(array  $scopes) : $this

Set the scopes of the requested access.

Parameters

array $scopes

Returns

$this

stateless()

stateless() : $this

Indicates that the provider should operate as stateless.

Returns

$this

with()

with(array  $parameters) : $this

Set the custom parameters of the request.

Parameters

array $parameters

Returns

$this

getName()

getName() : string

Returns

string

getAuthUrl()

getAuthUrl(string  $state) : string

Get the authentication URL for the provider.

Parameters

string $state

Returns

string

buildAuthUrlFromBase()

buildAuthUrlFromBase(string  $url, string  $state) : string

Get the authentication URL for the provider.

Parameters

string $url
string $state

Returns

string

getTokenUrl()

getTokenUrl() : string

{@inheritdoc}.

Returns

string

getUserByToken()

getUserByToken(\Overtrue\Socialite\AccessTokenInterface  $token) : array

Get the raw user for the given access token.

Parameters

\Overtrue\Socialite\AccessTokenInterface $token

Returns

array

mapUserToObject()

mapUserToObject(array  $user) : \Overtrue\Socialite\User

Map the raw user array to a Socialite User instance.

Parameters

array $user

Returns

\Overtrue\Socialite\User

getTokenFields()

getTokenFields(string  $code) : array

{@inheritdoc}.

Parameters

string $code

Returns

array

removeCallback()

removeCallback(mixed  $response) : string

Remove the fucking callback parentheses.

Parameters

mixed $response

Returns

string

formatScopes()

formatScopes(array  $scopes, string  $scopeSeparator) : string

Format the given scopes.

Parameters

array $scopes
string $scopeSeparator

Returns

string

hasInvalidState()

hasInvalidState() : boolean

Determine if the current request / session has a mismatching "state".

Returns

boolean

getCode()

getCode() : string

Get the code from the request.

Returns

string

getHttpClient()

getHttpClient() : \GuzzleHttp\Client

Get a fresh instance of the Guzzle HTTP client.

Returns

\GuzzleHttp\Client

usesState()

usesState() : boolean

Determine if the provider is operating with state.

Returns

boolean

isStateless()

isStateless() : boolean

Determine if the provider is operating as stateless.

Returns

boolean

arrayItem()

arrayItem(array  $array, string  $key, mixed  $default = null) : mixed

Return array item by key.

Parameters

array $array
string $key
mixed $default

Returns

mixed

makeState()

makeState() : string|boolean

Put state to session storage and return it.

Returns

string|boolean

componentAppId()

componentAppId() : string

Get component app id.

Returns

string

componentAccessToken()

componentAccessToken() : string

Get component access token.

Returns

string