PHP Class PayPal\Auth\Oauth\OAuthRequest

Show file Open project: paypal/sdk-core-php Class Usage Examples

Public Properties

Property Type Description
$POST_INPUT
$base_string for debug purposes
$parameters
$version

Protected Properties

Property Type Description
$http_method
$http_url

Public Methods

Method Description
__construct ( $http_method, $http_url, $parameters = null )
__toString ( )
build_signature ( $signature_method, $consumer, $token )
from_consumer_and_token ( $consumer, $token, $http_method, $http_url, $parameters = null ) pretty much a helper function to set up the request
from_request ( $http_method = null, $http_url = null, $parameters = null ) attempt to build up a request from what was passed to the server
get_normalized_http_method ( ) just uppercases the http method
get_normalized_http_url ( ) parses the url and rebuilds it to be scheme://host/path
get_parameter ( $name )
get_parameters ( )
get_signable_parameters ( ) : string The request parameters, sorted and concatenated into a normalized string.
get_signature_base_string ( ) Returns the base string of this request
set_parameter ( $name, $value, $allow_duplicates = true )
sign_request ( $signature_method, $consumer, $token )
to_header ( $realm = null ) builds the Authorization: header
to_postdata ( ) builds the data one would send in a POST request
to_url ( ) builds a url usable for a GET request
unset_parameter ( $name )

Private Methods

Method Description
generate_nonce ( ) util function: current nonce
generate_timestamp ( ) util function: current timestamp

Method Details

__construct() public method

public __construct ( $http_method, $http_url, $parameters = null )

__toString() public method

public __toString ( )

build_signature() public method

public build_signature ( $signature_method, $consumer, $token )

from_consumer_and_token() public static method

pretty much a helper function to set up the request
public static from_consumer_and_token ( $consumer, $token, $http_method, $http_url, $parameters = null )

from_request() public static method

attempt to build up a request from what was passed to the server
public static from_request ( $http_method = null, $http_url = null, $parameters = null )

get_normalized_http_method() public method

just uppercases the http method

get_normalized_http_url() public method

parses the url and rebuilds it to be scheme://host/path

get_parameter() public method

public get_parameter ( $name )

get_parameters() public method

public get_parameters ( )

get_signable_parameters() public method

The request parameters, sorted and concatenated into a normalized string.
public get_signable_parameters ( ) : string
return string

get_signature_base_string() public method

The base string defined as the method, the url and the parameters (normalized), each urlencoded and the concated with &.

set_parameter() public method

public set_parameter ( $name, $value, $allow_duplicates = true )

sign_request() public method

public sign_request ( $signature_method, $consumer, $token )

to_header() public method

builds the Authorization: header
public to_header ( $realm = null )

to_postdata() public method

builds the data one would send in a POST request
public to_postdata ( )

to_url() public method

builds a url usable for a GET request
public to_url ( )

unset_parameter() public method

public unset_parameter ( $name )

Property Details

$POST_INPUT public static property

public static $POST_INPUT

$base_string public property

for debug purposes
public $base_string

$http_method protected property

protected $http_method

$http_url protected property

protected $http_url

$parameters public property

public $parameters

$version public static property

public static $version