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

  • AbstractGateway
  • CreditCard
  • Currency
  • GatewayFactory
  • Helper
  • Issuer
  • Item
  • ItemBag
  • PaymentMethod

Interfaces

  • GatewayInterface
  • ItemInterface
  • Overview
  • Namespace
  • Class
  • Tree

Class AbstractGateway

Base payment gateway class

This abstract class should be extended by all payment gateways throughout the Omnipay system. It enforces implementation of the GatewayInterface interface and defines various common attibutes and methods that all gateways should have.

Example:

// Initialise the gateway
  $gateway->initialize(...);

  // Get the gateway parameters.
  $parameters = $gateway->getParameters();

  // Create a credit card object
  $card = new CreditCard(...);

  // Do an authorisation transaction on the gateway
  if ($gateway->supportsAuthorize()) {
      $gateway->authorize(...);
  } else {
      throw new \Exception('Gateway does not support authorize()');
  }

For further code examples see the omnipay-example repository on github.

Omnipay\Common\AbstractGateway implements Omnipay\Common\GatewayInterface

Direct known subclasses

Omnipay\Dummy\Gateway, Omnipay\VivaPayments\RestGateway

Indirect known subclasses

Omnipay\VivaPayments\NativeGateway, Omnipay\VivaPayments\RedirectGateway
Abstract
Namespace: Omnipay\Common
See: Omnipay\Common\GatewayInterface
Located at Common/AbstractGateway.php
Methods summary
public
# __construct( Guzzle\Http\ClientInterface $httpClient = null, Symfony\Component\HttpFoundation\Request $httpRequest = null )

Create a new gateway instance

Create a new gateway instance

Parameters

$httpClient
A Guzzle client to make API calls with
$httpRequest
A Symfony HTTP request object
public string
# getShortName( )

Get the short name of the Gateway

Get the short name of the Gateway

Returns

string

Implementation of

Omnipay\Common\GatewayInterface::getShortName()
public
# initialize( array $parameters = array() )

Initialize this gateway with default parameters

Initialize this gateway with default parameters

Parameters

$parameters

Returns


$this

Implementation of

Omnipay\Common\GatewayInterface::initialize()
public array
# getDefaultParameters( )

Returns

array

Implementation of

Omnipay\Common\GatewayInterface::getDefaultParameters()
public array
# getParameters( )

Returns

array

Implementation of

Omnipay\Common\GatewayInterface::getParameters()
public mixed
# getParameter( string $key )

Parameters

$key

Returns

mixed
public
# setParameter( string $key, mixed $value )

Parameters

$key
$value

Returns


$this
public boolean
# getTestMode( )

Returns

boolean
public
# setTestMode( boolean $value )

Parameters

$value

Returns


$this
public string
# getCurrency( )

Returns

string
public
# setCurrency( string $value )

Parameters

$value

Returns


$this
public boolean
# supportsAuthorize( )

Supports Authorize

Supports Authorize

Returns

boolean
True if this gateway supports the authorize() method
public boolean
# supportsCompleteAuthorize( )

Supports Complete Authorize

Supports Complete Authorize

Returns

boolean
True if this gateway supports the completeAuthorize() method
public boolean
# supportsCapture( )

Supports Capture

Supports Capture

Returns

boolean
True if this gateway supports the capture() method
public boolean
# supportsPurchase( )

Supports Purchase

Supports Purchase

Returns

boolean
True if this gateway supports the purchase() method
public boolean
# supportsCompletePurchase( )

Supports Complete Purchase

Supports Complete Purchase

Returns

boolean
True if this gateway supports the completePurchase() method
public boolean
# supportsRefund( )

Supports Refund

Supports Refund

Returns

boolean
True if this gateway supports the refund() method
public boolean
# supportsVoid( )

Supports Void

Supports Void

Returns

boolean
True if this gateway supports the void() method
public boolean
# supportsAcceptNotification( )

Supports AcceptNotification

Supports AcceptNotification

Returns

boolean
True if this gateway supports the acceptNotification() method
public boolean
# supportsCreateCard( )

Supports CreateCard

Supports CreateCard

Returns

boolean
True if this gateway supports the create() method
public boolean
# supportsDeleteCard( )

Supports DeleteCard

Supports DeleteCard

Returns

boolean
True if this gateway supports the delete() method
public boolean
# supportsUpdateCard( )

Supports UpdateCard

Supports UpdateCard

Returns

boolean
True if this gateway supports the update() method
protected Omnipay\Common\Message\AbstractRequest
# createRequest( string $class, array $parameters )

Create and initialize a request object

Create and initialize a request object

This function is usually used to create objects of type Omnipay\Common\Message\AbstractRequest (or a non-abstract subclass of it) and initialise them with using existing parameters from this gateway.

Example:

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);

Parameters

$class
The request class name
$parameters

Returns

Omnipay\Common\Message\AbstractRequest

See

Omnipay\Common\Message\AbstractRequest
protected Guzzle\Http\Client
# getDefaultHttpClient( )

Get the global default HTTP client.

Get the global default HTTP client.

Returns

Guzzle\Http\Client
protected Symfony\Component\HttpFoundation\Request
# getDefaultHttpRequest( )

Get the global default HTTP request.

Get the global default HTTP request.

Returns

Symfony\Component\HttpFoundation\Request
Methods inherited from Omnipay\Common\GatewayInterface
getName()
Magic methods inherited from Omnipay\Common\GatewayInterface
authorize(), capture(), completeAuthorize(), completePurchase(), createCard(), deleteCard(), purchase(), refund(), updateCard(), void()
Properties summary
protected Symfony\Component\HttpFoundation\ParameterBag $parameters
#
protected Guzzle\Http\ClientInterface $httpClient
#
protected Symfony\Component\HttpFoundation\Request $httpRequest
#
Omnipay Viva Payments Gateway Module API Documentation API documentation generated by ApiGen