Methods summary
public
|
#
__construct( string $authSite, string $clientId, string $clientSecret, string $redirectUri, League\OAuth2\Client\Token\AccessToken |string $token = null )
Constructor.
Parameters
- $authSite
- The site where the application was registered (ex:
MLA )
- $clientId
- The App ID granted by MercadoLibre
- $clientSecret
- The secret key granted by MercadoLibre
- $redirectUri
- The URI that will process the MercadoLibre callback
- $token
- Code or token previously granted (optional)
Throws
Overrides
|
public
string
|
#
getAuthorizationUrl( array $options = [] )
Builds and returns the authorization URL.
Builds and returns the authorization URL.
Parameters
Returns
string Authorization URL
Overrides
|
public
string
|
#
getState( )
Returns the current value of the state parameter.
Returns the current value of the state parameter.
Returns
string
Overrides
|
public
League\OAuth2\Client\Token\AccessToken |null
|
#
setToken( League\OAuth2\Client\Token\AccessToken |string $token )
Set a token using a code or a previously created token.
Set a token using a code or a previously created token.
Parameters
- $token
- Code or token previously granted
Returns
Throws
|
public
League\OAuth2\Client\Token\AccessToken |null
|
#
getToken( )
Get the current token.
Returns
Throws
|
public
Docta\MercadoLibre\OAuth2\Client\ResourceOwner |null
|
#
getOwner( )
Get the owner resource for the current token.
Get the owner resource for the current token.
Returns
Throws
|
public
Docta\MercadoLibre\OAuth2\Client\ResourceGeneric
|
#
get( string $path, array $query = [] )
Execute a GET request
Parameters
- $path
- Path relative to the API URL
- $query
- Query parameters to include in the URL (optional)
Returns
Throws
|
public
Docta\MercadoLibre\OAuth2\Client\ResourceGeneric
|
#
post( string $path, array $data = [], array $query = [] )
Execute a POST request
Parameters
- $path
- Path relative to the API URL
- $data
- Data to be sent through the HTTP headers (optional)
- $query
- Query parameters to include in the URL (optional)
Returns
Throws
|
public
Docta\MercadoLibre\OAuth2\Client\ResourceGeneric
|
#
put( string $path, array $data = [], array $query = [] )
Execute a PUT request
Parameters
- $path
- Path relative to the API URL
- $data
- Data to be sent through the HTTP headers (optional)
- $query
- Query parameters to include in the URL (optional)
Returns
Throws
|
public
Docta\MercadoLibre\OAuth2\Client\ResourceGeneric
|
#
delete( string $path, array $query = [] )
Execute a DELETE request
Parameters
- $path
- Path relative to the API URL
- $query
- Query parameters to include in the URL (optional)
Returns
Throws
|
public
Docta\MercadoLibre\OAuth2\Client\ResourceGeneric
|
#
options( string $path, array $query = [] )
Execute a OPTIONS request
Execute a OPTIONS request
Parameters
- $path
- Path relative to the API URL
- $query
- Query parameters to include in the URL (optional)
Returns
Throws
|
public
Docta\MercadoLibre\OAuth2\Client\ResourceGeneric
|
#
execute( string $method, string $path, array $query = [], array $data = [] )
Execute a custom request
Parameters
- $method
- Request method
- $path
- Path relative to the API URL
- $query
- Query parameters to include in the URL (optional)
- $data
- Data to be sent through the HTTP headers (optional)
Returns
Throws
|
public
Psr\Http\Message\RequestInterface
|
#
buildRequest( string $method, string $url, array $data = [] )
Build and return an appropriate request.
Build and return an appropriate request.
Parameters
Returns
|
public
Docta\MercadoLibre\OAuth2\Client\ResourceGeneric |mixed
|
#
buildResource( mixed $response = null )
Build and return a resource.
Build and return a resource.
Parameters
Returns
|
protected
|
|