PHP Class PayPal\Core\PayPalHttpConfig

Mostra file Open project: paypal/rest-api-sdk-php Class Usage Examples

Public Properties

Property Type Description
$defaultCurlOptions array Some default options for curl These are typically overridden by PayPalConnectionManager

Public Methods

Method Description
__construct ( string $url = null, string $method = self::HTTP_POST, array $configs = [] ) Default Constructor
addCurlOption ( string $name, mixed $value ) Add Curl Option
addHeader ( $name, $value, boolean $overWrite = true ) Adds a Header
getCurlOptions ( ) : array Gets all curl options
getHeader ( $name ) : string | null Get Header by Name
getHeaders ( ) : array Gets all Headers
getHttpConstantsFromConfigs ( array $configs = [], $prefix ) : array Retrieves an array of constant key, and value based on Prefix
getHttpRetryCount ( ) : integer Get Http Retry Counts
getMethod ( ) : string Gets Method
getUrl ( ) : null | string Gets Url
removeCurlOption ( $name ) Removes a curl option from the list
removeHeader ( $name ) Removes a Header
setCurlOptions ( $options ) Set Curl Options. Overrides all curl options
setHeaders ( array $headers = [] ) Set Headers
setHttpProxy ( string $proxy ) Set HTTP proxy information
setHttpRetryCount ( integer $retryCount ) Set Http Retry Counts
setHttpTimeout ( integer $timeout ) Set connection timeout in seconds
setSSLCert ( $certPath, null $passPhrase = null ) Set ssl parameters for certificate based client authentication
setUrl ( $url ) Sets Url
setUserAgent ( string $userAgentString ) Sets the User-Agent string on the HTTP request

Method Details

__construct() public method

Default Constructor
public __construct ( string $url = null, string $method = self::HTTP_POST, array $configs = [] )
$url string
$method string HTTP method (GET, POST etc) defaults to POST
$configs array All Configurations

addCurlOption() public method

Add Curl Option
public addCurlOption ( string $name, mixed $value )
$name string
$value mixed

addHeader() public method

Adds a Header
public addHeader ( $name, $value, boolean $overWrite = true )
$name
$value
$overWrite boolean allows you to override header value

getCurlOptions() public method

Gets all curl options
public getCurlOptions ( ) : array
return array

getHeader() public method

Get Header by Name
public getHeader ( $name ) : string | null
$name
return string | null

getHeaders() public method

Gets all Headers
public getHeaders ( ) : array
return array

getHttpConstantsFromConfigs() public method

Retrieves an array of constant key, and value based on Prefix
public getHttpConstantsFromConfigs ( array $configs = [], $prefix ) : array
$configs array
$prefix
return array

getHttpRetryCount() public method

Get Http Retry Counts
public getHttpRetryCount ( ) : integer
return integer

getMethod() public method

Gets Method
public getMethod ( ) : string
return string

getUrl() public method

Gets Url
public getUrl ( ) : null | string
return null | string

removeCurlOption() public method

Removes a curl option from the list
public removeCurlOption ( $name )
$name

removeHeader() public method

Removes a Header
public removeHeader ( $name )
$name

setCurlOptions() public method

Set Curl Options. Overrides all curl options
public setCurlOptions ( $options )
$options

setHeaders() public method

Set Headers
public setHeaders ( array $headers = [] )
$headers array

setHttpProxy() public method

Set HTTP proxy information
public setHttpProxy ( string $proxy )
$proxy string

setHttpRetryCount() public method

Set Http Retry Counts
public setHttpRetryCount ( integer $retryCount )
$retryCount integer

setHttpTimeout() public method

Set connection timeout in seconds
public setHttpTimeout ( integer $timeout )
$timeout integer

setSSLCert() public method

Set ssl parameters for certificate based client authentication
public setSSLCert ( $certPath, null $passPhrase = null )
$certPath
$passPhrase null

setUrl() public method

Sets Url
public setUrl ( $url )
$url

setUserAgent() public method

Sets the User-Agent string on the HTTP request
public setUserAgent ( string $userAgentString )
$userAgentString string

Property Details

$defaultCurlOptions public_oe static_oe property

Some default options for curl These are typically overridden by PayPalConnectionManager
public static array $defaultCurlOptions
return array