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
    • Fatzebra
      • Message
  • PHP

Classes

  • AbstractRequest
  • AbstractResponse

Interfaces

  • FetchIssuersResponseInterface
  • FetchPaymentMethodsResponseInterface
  • MessageInterface
  • NotificationInterface
  • RedirectResponseInterface
  • RequestInterface
  • ResponseInterface
  • Overview
  • Namespace
  • Class
  • Tree

Class AbstractRequest

Abstract Request

This abstract class implements RequestInterface and defines a basic set of functions that all Omnipay Requests are intended to include.

Requests of this class are usually created using the createRequest function of the gateway and then actioned using methods within this class or a class that extends this class.

Example -- creating a request:

class MyRequest extends \Omnipay\Common\Message\AbstractRequest {};

  class MyGateway extends \Omnipay\Common\AbstractGateway {
    function myRequest($parameters) {
      $this->createRequest('MyRequest', $parameters);
    }
  }

  // Create the gateway object
  $gw = Omnipay::create('MyGateway');

  // Create the request object
  $myRequest = $gw->myRequest($someParameters);

Example -- validating and sending a request:

try {
    $myRequest->validate();
    $myResponse = $myRequest->send();
  } catch (InvalidRequestException $e) {
    print "Something went wrong: " . $e->getMessage() . "\n";
  }
  // now do something with the $myResponse object, test for success, etc.
Omnipay\Common\Message\AbstractRequest implements Omnipay\Common\Message\RequestInterface

Direct known subclasses

Omnipay\Dummy\Message\AuthorizeRequest, Omnipay\Fatzebra\Message\AbstractRestRequest

Indirect known subclasses

Omnipay\Fatzebra\Message\CreateCardRequest, Omnipay\Fatzebra\Message\CreateCustomerRequest, Omnipay\Fatzebra\Message\PurchaseRequest, Omnipay\Fatzebra\Message\RefundRequest, Omnipay\Fatzebra\Message\CreatePlanRequest, Omnipay\Fatzebra\Message\CreateSubscriptionRequest, Omnipay\Fatzebra\Message\DeleteCustomerRequest, Omnipay\Fatzebra\Message\FetchAllPlansRequest, Omnipay\Fatzebra\Message\FetchCustomerRequest, Omnipay\Fatzebra\Message\FetchPlanRequest, Omnipay\Fatzebra\Message\FetchSubscriptionRequest, Omnipay\Fatzebra\Message\FetchTransactionRequest
Abstract
Namespace: Omnipay\Common\Message
See: Omnipay\Common\Message\RequestInterface
See: Omnipay\Common\Message\AbstractResponse
Located at Common/Message/AbstractRequest.php
Methods summary
public
# __construct( Guzzle\Http\ClientInterface $httpClient, Symfony\Component\HttpFoundation\Request $httpRequest )

Create a new Request

Create a new Request

Parameters

$httpClient
A Guzzle client to make API calls with
$httpRequest
A Symfony HTTP request object
public
# initialize( array $parameters = array() )

Initialize the object with parameters.

Initialize the object with parameters.

If any unknown parameters passed, they will be ignored.

Parameters

$parameters
An associative array of parameters

Returns


$this

Throws

RuntimeException

Implementation of

Omnipay\Common\Message\RequestInterface::initialize()
public array
# getParameters( )

Get all parameters as an associative array.

Get all parameters as an associative array.

Returns

array

Implementation of

Omnipay\Common\Message\RequestInterface::getParameters()
protected mixed
# getParameter( string $key )

Get a single parameter.

Get a single parameter.

Parameters

$key
The parameter key

Returns

mixed
protected Omnipay\Common\Message\AbstractRequest
# setParameter( string $key, mixed $value )

Set a single parameter

Set a single parameter

Parameters

$key
The parameter key
$value
The value to set

Returns

Omnipay\Common\Message\AbstractRequest
Provides a fluent interface

Throws

RuntimeException
if a request parameter is modified after the request has been sent.
public boolean
# getTestMode( )

Gets the test mode of the request from the gateway.

Gets the test mode of the request from the gateway.

Returns

boolean
public Omnipay\Common\Message\AbstractRequest
# setTestMode( boolean $value )

Sets the test mode of the request.

Sets the test mode of the request.

Parameters

$value
True for test mode on.

Returns

Omnipay\Common\Message\AbstractRequest
public
# validate( )

Validate the request.

Validate the request.

This method is called internally by gateways to avoid wasting time with an API call when the request is clearly invalid.

Throws

Omnipay\Common\Exception\InvalidRequestException
public Omnipay\Common\CreditCard
# getCard( )

Get the card.

Get the card.

Returns

Omnipay\Common\CreditCard
public Omnipay\Common\Message\AbstractRequest
# setCard( Omnipay\Common\CreditCard $value )

Sets the card.

Sets the card.

Parameters

$value

Returns

Omnipay\Common\Message\AbstractRequest
Provides a fluent interface
public string
# getToken( )

Get the card token.

Get the card token.

Returns

string
public Omnipay\Common\Message\AbstractRequest
# setToken( string $value )

Sets the card token.

Sets the card token.

Parameters

$value

Returns

Omnipay\Common\Message\AbstractRequest
Provides a fluent interface
public string
# getCardReference( )

Get the card reference.

Get the card reference.

Returns

string
public Omnipay\Common\Message\AbstractRequest
# setCardReference( string $value )

Sets the card reference.

Sets the card reference.

Parameters

$value

Returns

Omnipay\Common\Message\AbstractRequest
Provides a fluent interface
public float
# toFloat( $value )

Convert an amount into a float.

Convert an amount into a float.

Returns

float
The amount converted to a float.

Throws

Omnipay\Common\Exception\InvalidRequestException
on any validation failure.

Var

string|int|float $value The value to convert.
public string
# getAmount( )

Validates and returns the formated amount.

Validates and returns the formated amount.

Returns

string
The amount formatted to the correct number of decimal places for the selected currency.

Throws

Omnipay\Common\Exception\InvalidRequestException
on any validation failure.
public Omnipay\Common\Message\AbstractRequest
# setAmount( string $value )

Sets the payment amount.

Sets the payment amount.

Parameters

$value

Returns

Omnipay\Common\Message\AbstractRequest
Provides a fluent interface
public integer
# getAmountInteger( )

Get the payment amount as an integer.

Get the payment amount as an integer.

Returns

integer
public string
# getCurrency( )

Get the payment currency code.

Get the payment currency code.

Returns

string
public Omnipay\Common\Message\AbstractRequest
# setCurrency( string $value )

Sets the payment currency code.

Sets the payment currency code.

Parameters

$value

Returns

Omnipay\Common\Message\AbstractRequest
Provides a fluent interface
public integer
# getCurrencyNumeric( )

Get the payment currency number.

Get the payment currency number.

Returns

integer
public integer
# getCurrencyDecimalPlaces( )

Get the number of decimal places in the payment currency.

Get the number of decimal places in the payment currency.

Returns

integer
public string
# formatCurrency( $amount )

Format an amount for the payment currency.

Format an amount for the payment currency.

Returns

string
public string
# getDescription( )

Get the request description.

Get the request description.

Returns

string
public Omnipay\Common\Message\AbstractRequest
# setDescription( string $value )

Sets the request description.

Sets the request description.

Parameters

$value

Returns

Omnipay\Common\Message\AbstractRequest
Provides a fluent interface
public string
# getTransactionId( )

Get the transaction ID.

Get the transaction ID.

The transaction ID is the identifier generated by the merchant website.

Returns

string
public Omnipay\Common\Message\AbstractRequest
# setTransactionId( string $value )

Sets the transaction ID.

Sets the transaction ID.

Parameters

$value

Returns

Omnipay\Common\Message\AbstractRequest
Provides a fluent interface
public string
# getTransactionReference( )

Get the transaction reference.

Get the transaction reference.

The transaction reference is the identifier generated by the remote payment gateway.

Returns

string
public Omnipay\Common\Message\AbstractRequest
# setTransactionReference( string $value )

Sets the transaction reference.

Sets the transaction reference.

Parameters

$value

Returns

Omnipay\Common\Message\AbstractRequest
Provides a fluent interface
public Omnipay\Common\ItemBag|null
# getItems( )

A list of items in this order

A list of items in this order

Returns

Omnipay\Common\ItemBag|null
A bag containing items in this order
public Omnipay\Common\Message\AbstractRequest
# setItems( Omnipay\Common\ItemBag|array $items )

Set the items in this order

Set the items in this order

Parameters

$items
An array of items in this order

Returns

Omnipay\Common\Message\AbstractRequest
public string
# getClientIp( )

Get the client IP address.

Get the client IP address.

Returns

string
public Omnipay\Common\Message\AbstractRequest
# setClientIp( string $value )

Sets the client IP address.

Sets the client IP address.

Parameters

$value

Returns

Omnipay\Common\Message\AbstractRequest
Provides a fluent interface
public string
# getReturnUrl( )

Get the request return URL.

Get the request return URL.

Returns

string
public Omnipay\Common\Message\AbstractRequest
# setReturnUrl( string $value )

Sets the request return URL.

Sets the request return URL.

Parameters

$value

Returns

Omnipay\Common\Message\AbstractRequest
Provides a fluent interface
public string
# getCancelUrl( )

Get the request cancel URL.

Get the request cancel URL.

Returns

string
public Omnipay\Common\Message\AbstractRequest
# setCancelUrl( string $value )

Sets the request cancel URL.

Sets the request cancel URL.

Parameters

$value

Returns

Omnipay\Common\Message\AbstractRequest
Provides a fluent interface
public string
# getNotifyUrl( )

Get the request notify URL.

Get the request notify URL.

Returns

string
public Omnipay\Common\Message\AbstractRequest
# setNotifyUrl( string $value )

Sets the request notify URL.

Sets the request notify URL.

Parameters

$value

Returns

Omnipay\Common\Message\AbstractRequest
Provides a fluent interface
public string
# getIssuer( )

Get the payment issuer.

Get the payment issuer.

This field is used by some European gateways, and normally represents the bank where an account is held (separate from the card brand).

Returns

string
public Omnipay\Common\Message\AbstractRequest
# setIssuer( string $value )

Set the payment issuer.

Set the payment issuer.

This field is used by some European gateways, and normally represents the bank where an account is held (separate from the card brand).

Parameters

$value

Returns

Omnipay\Common\Message\AbstractRequest
Provides a fluent interface
public string
# getPaymentMethod( )

Get the payment issuer.

Get the payment issuer.

This field is used by some European gateways, which support multiple payment providers with a single API.

Returns

string
public Omnipay\Common\Message\AbstractRequest
# setPaymentMethod( string $value )

Set the payment method.

Set the payment method.

This field is used by some European gateways, which support multiple payment providers with a single API.

Parameters

$value

Returns

Omnipay\Common\Message\AbstractRequest
Provides a fluent interface
public Omnipay\Common\Message\ResponseInterface
# send( )

Send the request

Send the request

Returns

Omnipay\Common\Message\ResponseInterface

Implementation of

Omnipay\Common\Message\RequestInterface::send()
public Omnipay\Common\Message\ResponseInterface
# getResponse( )

Get the associated Response.

Get the associated Response.

Returns

Omnipay\Common\Message\ResponseInterface

Implementation of

Omnipay\Common\Message\RequestInterface::getResponse()
Methods inherited from Omnipay\Common\Message\RequestInterface
sendData()
Methods inherited from Omnipay\Common\Message\MessageInterface
getData()
Properties summary
protected Symfony\Component\HttpFoundation\ParameterBag $parameters

The request parameters

The request parameters

#
protected Guzzle\Http\ClientInterface $httpClient

The request client.

The request client.

#
protected Symfony\Component\HttpFoundation\Request $httpRequest

The HTTP request object.

The HTTP request object.

#
protected Omnipay\Common\Message\ResponseInterface $response

An associated ResponseInterface.

An associated ResponseInterface.

#
protected boolean $zeroAmountAllowed
# true
protected boolean $negativeAmountAllowed
# false
Omnipay Fat Zebra / Paystream Gateway Module API Documentation API documentation generated by ApiGen