PHP Class RakutenRws_Client

Show file Open project: rakuten-ws/rws-php-sdk Class Usage Examples

Protected Properties

Property Type Description
$accessToken
$accessTokenInfo
$affiliateId
$developerId
$httpClient
$options
$redirectUrl
$secret

Public Methods

Method Description
__construct ( RakutenRws_HttpClient $httpClient = null, $options = [] ) Constructor.
execute ( string $operation, array $parameter = [], string $version = null ) Executes API
fetchAccessTokenFromCode ( string $code = null ) : string Fetches OAuth2 AccessToken from Code
getAccessToken ( ) : string | null Gets the fetched AccessToken
getAccessTokenUrl ( ) : string Gets OAuth2 Access Token URL
getAffiliateId ( ) : string | null Gets AffilateID
getApplicationId ( ) : string | null Gets DeveloperID
getAuthorizeUrl ( string $scope ) : string Gets OAuth2 Authorize URL
getHttpClient ( ) : RakutenRws_HttpClient Gets Http Client instance
setAffiliateId ( string $affiliateId ) Sets the AffiliateID
setApplicationId ( string $developerId ) Sets the DeveloperID
setProxy ( string $proxy ) Sets the proxy to use connect rakuten service
setRedirectUrl ( string $redirectUrl ) Sets Redirect Url
setSecret ( string $secret ) Sets Application Secret

Method Details

__construct() public method

Constructor.
public __construct ( RakutenRws_HttpClient $httpClient = null, $options = [] )
$httpClient RakutenRws_HttpClient HTTP Client instance

execute() public method

Executes API
public execute ( string $operation, array $parameter = [], string $version = null )
$operation string The operation name
$parameter array The request parameter
$version string The API version

fetchAccessTokenFromCode() public method

Fetches OAuth2 AccessToken from Code
public fetchAccessTokenFromCode ( string $code = null ) : string
$code string The Code
return string The Access Token, If response is invalid return null

getAccessToken() public method

Gets the fetched AccessToken
public getAccessToken ( ) : string | null
return string | null The AccessToken

getAccessTokenUrl() public method

Gets OAuth2 Access Token URL
public getAccessTokenUrl ( ) : string
return string The OAuth2 Access Token URL

getAffiliateId() public method

Gets AffilateID
public getAffiliateId ( ) : string | null
return string | null The AffiliateID

getApplicationId() public method

Gets DeveloperID
public getApplicationId ( ) : string | null
return string | null The DeveloperID

getAuthorizeUrl() public method

Gets OAuth2 Authorize URL
public getAuthorizeUrl ( string $scope ) : string
$scope string The scopes that is separated by ','
return string The Authorize URL

getHttpClient() public method

Gets Http Client instance
public getHttpClient ( ) : RakutenRws_HttpClient
return RakutenRws_HttpClient The Http Client

setAffiliateId() public method

Sets the AffiliateID
public setAffiliateId ( string $affiliateId )
$affiliateId string The AffiliateID

setApplicationId() public method

Sets the DeveloperID
public setApplicationId ( string $developerId )
$developerId string The DeveloperID

setProxy() public method

Sets the proxy to use connect rakuten service
public setProxy ( string $proxy )
$proxy string The proxy

setRedirectUrl() public method

Sets Redirect Url
public setRedirectUrl ( string $redirectUrl )
$redirectUrl string The Redirect URL

setSecret() public method

Sets Application Secret
public setSecret ( string $secret )
$secret string The Application Secret

Property Details

$accessToken protected property

protected $accessToken

$accessTokenInfo protected property

protected $accessTokenInfo

$affiliateId protected property

protected $affiliateId

$developerId protected property

protected $developerId

$httpClient protected property

protected $httpClient

$options protected property

protected $options

$redirectUrl protected property

protected $redirectUrl

$secret protected property

protected $secret