PHP Class PayPal\Rest\ApiContext

Call level parameters such as request id, credentials etc
Afficher le fichier Open project: paypal/rest-api-sdk-php Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( OAuthTokenCredential $credential = null, string | null $requestId = null ) Construct
addRequestHeader ( $name, $value )
get ( $searchKey ) : mixed Gets a specific configuration from key
getConfig ( ) : array Gets Configurations
getCredential ( ) : OAuthTokenCredential Get Credential
getRequestHeaders ( )
getRequestId ( ) : string Get Request ID
resetRequestId ( ) : string Resets the requestId that can be used to set the PayPal-request-id header used for idempotency. In cases where you need to make multiple create calls using the same ApiContext object, you need to reset request Id.
setConfig ( array $config ) Sets Config

Private Methods

Méthode Description
generateRequestId ( ) : string Generates a unique per request id that can be used to set the PayPal-Request-Id header that is used for idempotency

Method Details

__construct() public méthode

Construct
public __construct ( OAuthTokenCredential $credential = null, string | null $requestId = null )
$credential PayPal\Auth\OAuthTokenCredential
$requestId string | null

addRequestHeader() public méthode

public addRequestHeader ( $name, $value )

get() public méthode

Gets a specific configuration from key
public get ( $searchKey ) : mixed
$searchKey
Résultat mixed

getConfig() public méthode

Gets Configurations
public getConfig ( ) : array
Résultat array

getCredential() public méthode

Get Credential
public getCredential ( ) : OAuthTokenCredential
Résultat PayPal\Auth\OAuthTokenCredential

getRequestHeaders() public méthode

public getRequestHeaders ( )

getRequestId() public méthode

Get Request ID
public getRequestId ( ) : string
Résultat string

resetRequestId() public méthode

Resets the requestId that can be used to set the PayPal-request-id header used for idempotency. In cases where you need to make multiple create calls using the same ApiContext object, you need to reset request Id.
public resetRequestId ( ) : string
Résultat string

setConfig() public méthode

Sets Config
public setConfig ( array $config )
$config array SDK configuration parameters