Overview

Namespaces

  • Guzzle
    • Batch
      • Exception
    • Cache
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
        • Header
      • QueryAggregator
    • Inflection
    • Iterator
    • Log
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Async
      • Backoff
      • Cache
      • Cookie
        • CookieJar
        • Exception
      • CurlAuth
      • ErrorResponse
        • Exception
      • History
      • Log
      • Md5
      • Mock
      • Oauth
    • Service
      • Builder
      • Command
        • Factory
        • LocationVisitor
          • Request
          • Response
      • Description
      • Exception
      • Resource
    • Stream
    • Tests
      • Batch
      • Cache
      • Common
        • Cache
        • Exception
      • Http
        • Curl
        • Exception
        • Message
          • Header
      • Inflection
      • Iterator
      • Log
      • Message
      • Mock
      • Parser
        • Cookie
        • Message
      • Parsers
        • UriTemplate
      • Plugin
        • Async
        • Backoff
        • Cache
        • Cookie
          • CookieJar
        • CurlAuth
        • ErrorResponse
        • History
        • Log
        • Md5
        • Mock
        • Oauth
        • Redirect
      • Service
        • Builder
        • Command
          • LocationVisitor
            • Request
            • Response
        • Description
        • Exception
        • Mock
          • Command
            • Sub
          • Model
        • Resource
      • Stream
  • None
  • Omnipay
    • Common
      • Exception
      • Message
    • Dummy
      • Message
    • VivaPayments
      • Message
  • PHP

Classes

  • OauthPlugin
  • Overview
  • Namespace
  • Class
  • Tree

Class OauthPlugin

OAuth signing plugin

Guzzle\Plugin\Oauth\OauthPlugin implements Symfony\Component\EventDispatcher\EventSubscriberInterface
Namespace: Guzzle\Plugin\Oauth
Link: http://oauth.net/core/1.0/#rfc.section.9.1.1
Located at src/Guzzle/Plugin/Oauth/OauthPlugin.php
Methods summary
public
# __construct( array $config )

Create a new OAuth 1.0 plugin

Create a new OAuth 1.0 plugin

Parameters

$config

Configuration array containing these parameters: - string 'request_method' Consumer request method. Use the class constants. - string 'callback' OAuth callback - string 'consumer_key' Consumer key - string 'consumer_secret' Consumer secret - string 'token' Token - string 'token_secret' Token secret - string 'verifier' OAuth verifier. - string 'version' OAuth version. Defaults to 1.0 - string 'signature_method' Custom signature method - bool 'disable_post_params' Set to true to prevent POST parameters from being signed - array|Closure 'signature_callback' Custom signature callback that accepts a string to sign and a signing key

public static
# getSubscribedEvents( )
public array
# onRequestBeforeSend( Guzzle\Common\Event $event )

Request before-send event handler

Request before-send event handler

Parameters

$event
Event received

Returns

array

Throws

InvalidArgumentException
public string
# getSignature( Guzzle\Http\Message\RequestInterface $request, integer $timestamp, string $nonce )

Calculate signature for request

Calculate signature for request

Parameters

$request
Request to generate a signature for
$timestamp
Timestamp to use for nonce
$nonce

Returns

string
public string
# getStringToSign( Guzzle\Http\Message\RequestInterface $request, integer $timestamp, string $nonce )

Calculate string to sign

Calculate string to sign

Parameters

$request
Request to generate a signature for
$timestamp
Timestamp to use for nonce
$nonce

Returns

string
protected Guzzle\Common\Collection
# getOauthParams( $timestamp, $nonce )

Get the oauth parameters as named by the oauth spec

Get the oauth parameters as named by the oauth spec

Parameters

$timestamp
$nonce

Returns

Guzzle\Common\Collection
public array
# getParamsToSign( Guzzle\Http\Message\RequestInterface $request, integer $timestamp, string $nonce )

Get all of the parameters required to sign a request including: * The oauth params * The request GET params * The params passed in the POST body (with a content-type of application/x-www-form-urlencoded)

Get all of the parameters required to sign a request including: * The oauth params * The request GET params * The params passed in the POST body (with a content-type of application/x-www-form-urlencoded)

Parameters

$request
Request to generate a signature for
$timestamp
Timestamp to use for nonce
$nonce

Returns

array
public boolean
# shouldPostFieldsBeSigned( $request )

Decide whether the post fields should be added to the base string that Oauth signs. This implementation is correct. Non-conformant APIs may require that this method be overwritten e.g. the Flickr API incorrectly adds the post fields when the Content-Type is 'application/x-www-form-urlencoded'

Decide whether the post fields should be added to the base string that Oauth signs. This implementation is correct. Non-conformant APIs may require that this method be overwritten e.g. the Flickr API incorrectly adds the post fields when the Content-Type is 'application/x-www-form-urlencoded'

Parameters

$request

Returns

boolean
Whether the post fields should be signed or not
public string
# generateNonce( Guzzle\Http\Message\RequestInterface $request )

Returns a Nonce Based on the unique id and URL. This will allow for multiple requests in parallel with the same exact timestamp to use separate nonce's.

Returns a Nonce Based on the unique id and URL. This will allow for multiple requests in parallel with the same exact timestamp to use separate nonce's.

Parameters

$request
Request to generate a nonce for

Returns

string
public integer
# getTimestamp( Guzzle\Common\Event $event )

Gets timestamp from event or create new timestamp

Gets timestamp from event or create new timestamp

Parameters

$event
Event containing contextual information

Returns

integer
protected array
# prepareParameters( array $data )

Convert booleans to strings, removed unset parameters, and sorts the array

Convert booleans to strings, removed unset parameters, and sorts the array

Parameters

$data
Data array

Returns

array
Constants summary
string REQUEST_METHOD_HEADER

Consumer request method constants. See http://oauth.net/core/1.0/#consumer_req_param

Consumer request method constants. See http://oauth.net/core/1.0/#consumer_req_param

# 'header'
string REQUEST_METHOD_QUERY
# 'query'
Properties summary
protected Guzzle\Common\Collection $config

Configuration settings

Configuration settings

#
Omnipay Viva Payments Gateway Module API Documentation API documentation generated by ApiGen