PHP Класс PayPal\Rest\ApiContext

Call level parameters such as request id, credentials etc
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__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

Приватные методы

Метод Описание
generateRequestId ( ) : string Generates a unique per request id that can be used to set the PayPal-Request-Id header that is used for idempotency

Описание методов

__construct() публичный Метод

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

addRequestHeader() публичный Метод

public addRequestHeader ( $name, $value )

get() публичный Метод

Gets a specific configuration from key
public get ( $searchKey ) : mixed
$searchKey
Результат mixed

getConfig() публичный Метод

Gets Configurations
public getConfig ( ) : array
Результат array

getCredential() публичный Метод

Get Credential
public getCredential ( ) : OAuthTokenCredential
Результат PayPal\Auth\OAuthTokenCredential

getRequestHeaders() публичный Метод

public getRequestHeaders ( )

getRequestId() публичный Метод

Get Request ID
public getRequestId ( ) : string
Результат string

resetRequestId() публичный Метод

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
Результат string

setConfig() публичный Метод

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