Open Journal Systems  3.3.0
Omnipay\Common\AbstractGateway Class Reference
Inheritance diagram for Omnipay\Common\AbstractGateway:
Omnipay\Common\GatewayInterface Omnipay\Common\AbstractGatewayTest_MockAbstractGateway Omnipay\PayPal\ProGateway Omnipay\PayPal\RestGateway Omnipay\PayPal\ExpressGateway Omnipay\PayPal\ExpressInContextGateway

Public Member Functions

 __construct (ClientInterface $httpClient=null, HttpRequest $httpRequest=null)
 
 __construct (ClientInterface $httpClient=null, HttpRequest $httpRequest=null)
 
 getCurrency ()
 
 getCurrency ()
 
 getDefaultParameters ()
 
 getDefaultParameters ()
 
 getParameter ($key)
 
 getParameter ($key)
 
 getParameters ()
 
 getShortName ()
 
 getShortName ()
 
 getTestMode ()
 
 getTestMode ()
 
 initialize (array $parameters=array())
 
 initialize (array $parameters=array())
 
 setCurrency ($value)
 
 setCurrency ($value)
 
 setParameter ($key, $value)
 
 setParameter ($key, $value)
 
 setTestMode ($value)
 
 setTestMode ($value)
 
 supportsAcceptNotification ()
 
 supportsAcceptNotification ()
 
 supportsAuthorize ()
 
 supportsAuthorize ()
 
 supportsCapture ()
 
 supportsCapture ()
 
 supportsCompleteAuthorize ()
 
 supportsCompleteAuthorize ()
 
 supportsCompletePurchase ()
 
 supportsCompletePurchase ()
 
 supportsCreateCard ()
 
 supportsCreateCard ()
 
 supportsDeleteCard ()
 
 supportsDeleteCard ()
 
 supportsFetchTransaction ()
 
 supportsPurchase ()
 
 supportsPurchase ()
 
 supportsRefund ()
 
 supportsRefund ()
 
 supportsUpdateCard ()
 
 supportsUpdateCard ()
 
 supportsVoid ()
 
 supportsVoid ()
 
- Public Member Functions inherited from Omnipay\Common\GatewayInterface
 getName ()
 
 getName ()
 

Data Fields

getParameter as traitGetParameter
 

Protected Member Functions

 createRequest ($class, array $parameters)
 
 createRequest ($class, array $parameters)
 
 getDefaultHttpClient ()
 
 getDefaultHttpClient ()
 
 getDefaultHttpRequest ()
 
 getDefaultHttpRequest ()
 

Protected Attributes

 $httpClient
 
 $httpRequest
 
 $parameters
 

Detailed Description

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.

See also
GatewayInterface

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.

Definition at line 45 of file lib/vendor/omnipay/common/src/Omnipay/Common/AbstractGateway.php.

Constructor & Destructor Documentation

◆ __construct() [1/2]

Omnipay\Common\AbstractGateway::__construct ( ClientInterface  $httpClient = null,
HttpRequest  $httpRequest = null 
)

◆ __construct() [2/2]

Omnipay\Common\AbstractGateway::__construct ( ClientInterface  $httpClient = null,
HttpRequest  $httpRequest = null 
)

Create a new gateway instance

Parameters
ClientInterface$httpClientA HTTP client to make API calls with
HttpRequest$httpRequestA Symfony HTTP request object

Definition at line 73 of file vendor/omnipay/common/src/Common/AbstractGateway.php.

References Omnipay\Common\AbstractGateway\$httpClient, Omnipay\Common\AbstractGateway\$httpRequest, Omnipay\Common\AbstractGateway\getDefaultHttpClient(), Omnipay\Common\AbstractGateway\getDefaultHttpRequest(), and Omnipay\Common\AbstractGateway\initialize().

Member Function Documentation

◆ createRequest() [1/2]

Omnipay\Common\AbstractGateway::createRequest (   $class,
array  $parameters 
)
protected

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
string$classThe request class name
array$parameters
Returns
\Omnipay\Common\Message\AbstractRequest

Reimplemented in Omnipay\PayPal\RestGateway, and Omnipay\PayPal\RestGateway.

Definition at line 324 of file vendor/omnipay/common/src/Common/AbstractGateway.php.

References Omnipay\Common\AbstractGateway\getParameters().

◆ createRequest() [2/2]

Omnipay\Common\AbstractGateway::createRequest (   $class,
array  $parameters 
)
protected

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

See also
\Omnipay\Common\Message\AbstractRequest
Parameters
string$classThe request class name
array$parameters
Returns
\Omnipay\Common\Message\AbstractRequest

Reimplemented in Omnipay\PayPal\RestGateway, and Omnipay\PayPal\RestGateway.

Definition at line 329 of file lib/vendor/omnipay/common/src/Omnipay/Common/AbstractGateway.php.

References Omnipay\Common\AbstractGateway\getParameters().

Referenced by Omnipay\PayPal\ExpressInContextGateway\authorize(), Omnipay\PayPal\ProGateway\authorize(), Omnipay\PayPal\ExpressGateway\authorize(), Omnipay\Common\AbstractGatewayTest_MockAbstractGateway\callCreateRequest(), Omnipay\PayPal\ProGateway\capture(), Omnipay\PayPal\ExpressGateway\completeAuthorize(), Omnipay\PayPal\ExpressGateway\completeOrder(), Omnipay\PayPal\ExpressGateway\completePurchase(), Omnipay\PayPal\ExpressGateway\fetchCheckout(), Omnipay\PayPal\ProGateway\fetchTransaction(), Omnipay\PayPal\ExpressInContextGateway\order(), Omnipay\PayPal\ExpressGateway\order(), Omnipay\PayPal\ProGateway\purchase(), Omnipay\PayPal\ProGateway\refund(), Omnipay\PayPal\ExpressGateway\transactionSearch(), and Omnipay\PayPal\ExpressGateway\void().

◆ getCurrency() [1/2]

Omnipay\Common\AbstractGateway::getCurrency ( )

◆ getCurrency() [2/2]

Omnipay\Common\AbstractGateway::getCurrency ( )

◆ getDefaultHttpClient() [1/2]

Omnipay\Common\AbstractGateway::getDefaultHttpClient ( )
protected

Get the global default HTTP client.

Returns
ClientInterface

Definition at line 336 of file vendor/omnipay/common/src/Common/AbstractGateway.php.

◆ getDefaultHttpClient() [2/2]

Omnipay\Common\AbstractGateway::getDefaultHttpClient ( )
protected

Get the global default HTTP client.

Returns
HttpClient

Definition at line 341 of file lib/vendor/omnipay/common/src/Omnipay/Common/AbstractGateway.php.

Referenced by Omnipay\Common\AbstractGateway\__construct().

◆ getDefaultHttpRequest() [1/2]

Omnipay\Common\AbstractGateway::getDefaultHttpRequest ( )
protected

Get the global default HTTP request.

Returns
HttpRequest

Definition at line 346 of file vendor/omnipay/common/src/Common/AbstractGateway.php.

◆ getDefaultHttpRequest() [2/2]

Omnipay\Common\AbstractGateway::getDefaultHttpRequest ( )
protected

Get the global default HTTP request.

Returns
HttpRequest

Definition at line 356 of file lib/vendor/omnipay/common/src/Omnipay/Common/AbstractGateway.php.

Referenced by Omnipay\Common\AbstractGateway\__construct().

◆ getDefaultParameters() [1/2]

◆ getDefaultParameters() [2/2]

◆ getParameter() [1/2]

Omnipay\Common\AbstractGateway::getParameter (   $key)
Parameters
string$key
Returns
mixed

Definition at line 126 of file vendor/omnipay/common/src/Common/AbstractGateway.php.

References Omnipay\Common\AbstractGateway\traitGetParameter.

◆ getParameter() [2/2]

◆ getParameters()

Omnipay\Common\AbstractGateway::getParameters ( )

◆ getShortName() [1/2]

Omnipay\Common\AbstractGateway::getShortName ( )

Get the short name of the Gateway

Returns
string

Implements Omnipay\Common\GatewayInterface.

Definition at line 85 of file vendor/omnipay/common/src/Common/AbstractGateway.php.

References Omnipay\Common\Helper\getGatewayShortName().

◆ getShortName() [2/2]

Omnipay\Common\AbstractGateway::getShortName ( )

Get the short name of the Gateway

Returns
string

Implements Omnipay\Common\GatewayInterface.

Definition at line 89 of file lib/vendor/omnipay/common/src/Omnipay/Common/AbstractGateway.php.

References Omnipay\Common\Helper\getGatewayShortName().

◆ getTestMode() [1/2]

Omnipay\Common\AbstractGateway::getTestMode ( )

◆ getTestMode() [2/2]

Omnipay\Common\AbstractGateway::getTestMode ( )

◆ initialize() [1/2]

Omnipay\Common\AbstractGateway::initialize ( array  $parameters = array())

◆ initialize() [2/2]

Omnipay\Common\AbstractGateway::initialize ( array  $parameters = array())

◆ setCurrency() [1/2]

Omnipay\Common\AbstractGateway::setCurrency (   $value)
Parameters
string$value
Returns
$this

Definition at line 170 of file vendor/omnipay/common/src/Common/AbstractGateway.php.

References Omnipay\Common\AbstractGateway\setParameter().

◆ setCurrency() [2/2]

Omnipay\Common\AbstractGateway::setCurrency (   $value)
Parameters
string$value
Returns
$this

Definition at line 184 of file lib/vendor/omnipay/common/src/Omnipay/Common/AbstractGateway.php.

References Omnipay\Common\AbstractGateway\setParameter().

◆ setParameter() [1/2]

Omnipay\Common\AbstractGateway::setParameter (   $key,
  $value 
)
Parameters
string$key
mixed$value
Returns
$this

Definition at line 136 of file vendor/omnipay/common/src/Common/AbstractGateway.php.

◆ setParameter() [2/2]

◆ setTestMode() [1/2]

Omnipay\Common\AbstractGateway::setTestMode (   $value)
Parameters
boolean$value
Returns
$this

Definition at line 153 of file vendor/omnipay/common/src/Common/AbstractGateway.php.

References Omnipay\Common\AbstractGateway\setParameter().

◆ setTestMode() [2/2]

Omnipay\Common\AbstractGateway::setTestMode (   $value)
Parameters
boolean$value
Returns
$this

Definition at line 167 of file lib/vendor/omnipay/common/src/Omnipay/Common/AbstractGateway.php.

References Omnipay\Common\AbstractGateway\setParameter().

◆ supportsAcceptNotification() [1/2]

Omnipay\Common\AbstractGateway::supportsAcceptNotification ( )

Supports AcceptNotification

Returns
boolean True if this gateway supports the acceptNotification() method

Definition at line 260 of file vendor/omnipay/common/src/Common/AbstractGateway.php.

◆ supportsAcceptNotification() [2/2]

Omnipay\Common\AbstractGateway::supportsAcceptNotification ( )

Supports AcceptNotification

Returns
boolean True if this gateway supports the acceptNotification() method

Definition at line 264 of file lib/vendor/omnipay/common/src/Omnipay/Common/AbstractGateway.php.

◆ supportsAuthorize() [1/2]

Omnipay\Common\AbstractGateway::supportsAuthorize ( )

Supports Authorize

Returns
boolean True if this gateway supports the authorize() method

Definition at line 180 of file vendor/omnipay/common/src/Common/AbstractGateway.php.

◆ supportsAuthorize() [2/2]

Omnipay\Common\AbstractGateway::supportsAuthorize ( )

Supports Authorize

Returns
boolean True if this gateway supports the authorize() method

Definition at line 194 of file lib/vendor/omnipay/common/src/Omnipay/Common/AbstractGateway.php.

◆ supportsCapture() [1/2]

Omnipay\Common\AbstractGateway::supportsCapture ( )

Supports Capture

Returns
boolean True if this gateway supports the capture() method

Definition at line 200 of file vendor/omnipay/common/src/Common/AbstractGateway.php.

◆ supportsCapture() [2/2]

Omnipay\Common\AbstractGateway::supportsCapture ( )

Supports Capture

Returns
boolean True if this gateway supports the capture() method

Definition at line 214 of file lib/vendor/omnipay/common/src/Omnipay/Common/AbstractGateway.php.

◆ supportsCompleteAuthorize() [1/2]

Omnipay\Common\AbstractGateway::supportsCompleteAuthorize ( )

Supports Complete Authorize

Returns
boolean True if this gateway supports the completeAuthorize() method

Definition at line 190 of file vendor/omnipay/common/src/Common/AbstractGateway.php.

◆ supportsCompleteAuthorize() [2/2]

Omnipay\Common\AbstractGateway::supportsCompleteAuthorize ( )

Supports Complete Authorize

Returns
boolean True if this gateway supports the completeAuthorize() method

Definition at line 204 of file lib/vendor/omnipay/common/src/Omnipay/Common/AbstractGateway.php.

◆ supportsCompletePurchase() [1/2]

Omnipay\Common\AbstractGateway::supportsCompletePurchase ( )

Supports Complete Purchase

Returns
boolean True if this gateway supports the completePurchase() method

Definition at line 220 of file vendor/omnipay/common/src/Common/AbstractGateway.php.

◆ supportsCompletePurchase() [2/2]

Omnipay\Common\AbstractGateway::supportsCompletePurchase ( )

Supports Complete Purchase

Returns
boolean True if this gateway supports the completePurchase() method

Definition at line 234 of file lib/vendor/omnipay/common/src/Omnipay/Common/AbstractGateway.php.

◆ supportsCreateCard() [1/2]

Omnipay\Common\AbstractGateway::supportsCreateCard ( )

Supports CreateCard

Returns
boolean True if this gateway supports the create() method

Definition at line 270 of file vendor/omnipay/common/src/Common/AbstractGateway.php.

◆ supportsCreateCard() [2/2]

Omnipay\Common\AbstractGateway::supportsCreateCard ( )

Supports CreateCard

Returns
boolean True if this gateway supports the create() method

Definition at line 274 of file lib/vendor/omnipay/common/src/Omnipay/Common/AbstractGateway.php.

◆ supportsDeleteCard() [1/2]

Omnipay\Common\AbstractGateway::supportsDeleteCard ( )

Supports DeleteCard

Returns
boolean True if this gateway supports the delete() method

Definition at line 280 of file vendor/omnipay/common/src/Common/AbstractGateway.php.

◆ supportsDeleteCard() [2/2]

Omnipay\Common\AbstractGateway::supportsDeleteCard ( )

Supports DeleteCard

Returns
boolean True if this gateway supports the delete() method

Definition at line 284 of file lib/vendor/omnipay/common/src/Omnipay/Common/AbstractGateway.php.

◆ supportsFetchTransaction()

Omnipay\Common\AbstractGateway::supportsFetchTransaction ( )

Supports Fetch Transaction

Returns
boolean True if this gateway supports the fetchTransaction() method

Definition at line 230 of file vendor/omnipay/common/src/Common/AbstractGateway.php.

◆ supportsPurchase() [1/2]

Omnipay\Common\AbstractGateway::supportsPurchase ( )

Supports Purchase

Returns
boolean True if this gateway supports the purchase() method

Definition at line 210 of file vendor/omnipay/common/src/Common/AbstractGateway.php.

◆ supportsPurchase() [2/2]

Omnipay\Common\AbstractGateway::supportsPurchase ( )

Supports Purchase

Returns
boolean True if this gateway supports the purchase() method

Definition at line 224 of file lib/vendor/omnipay/common/src/Omnipay/Common/AbstractGateway.php.

◆ supportsRefund() [1/2]

Omnipay\Common\AbstractGateway::supportsRefund ( )

Supports Refund

Returns
boolean True if this gateway supports the refund() method

Definition at line 240 of file vendor/omnipay/common/src/Common/AbstractGateway.php.

◆ supportsRefund() [2/2]

Omnipay\Common\AbstractGateway::supportsRefund ( )

Supports Refund

Returns
boolean True if this gateway supports the refund() method

Definition at line 244 of file lib/vendor/omnipay/common/src/Omnipay/Common/AbstractGateway.php.

◆ supportsUpdateCard() [1/2]

Omnipay\Common\AbstractGateway::supportsUpdateCard ( )

Supports UpdateCard

Returns
boolean True if this gateway supports the update() method

Definition at line 290 of file vendor/omnipay/common/src/Common/AbstractGateway.php.

◆ supportsUpdateCard() [2/2]

Omnipay\Common\AbstractGateway::supportsUpdateCard ( )

Supports UpdateCard

Returns
boolean True if this gateway supports the update() method

Definition at line 294 of file lib/vendor/omnipay/common/src/Omnipay/Common/AbstractGateway.php.

◆ supportsVoid() [1/2]

Omnipay\Common\AbstractGateway::supportsVoid ( )

Supports Void

Returns
boolean True if this gateway supports the void() method

Definition at line 250 of file vendor/omnipay/common/src/Common/AbstractGateway.php.

◆ supportsVoid() [2/2]

Omnipay\Common\AbstractGateway::supportsVoid ( )

Supports Void

Returns
boolean True if this gateway supports the void() method

Definition at line 254 of file lib/vendor/omnipay/common/src/Omnipay/Common/AbstractGateway.php.

Field Documentation

◆ $httpClient

◆ $httpRequest

Symfony Component HttpFoundation Request Omnipay\Common\AbstractGateway::$httpRequest
protected

◆ $parameters

Symfony Component HttpFoundation ParameterBag Omnipay\Common\AbstractGateway::$parameters
protected

Definition at line 53 of file lib/vendor/omnipay/common/src/Omnipay/Common/AbstractGateway.php.

Referenced by Omnipay\PayPal\ExpressInContextGateway\authorize(), Omnipay\PayPal\ProGateway\authorize(), Omnipay\PayPal\ExpressGateway\authorize(), Omnipay\PayPal\RestGateway\authorize(), Omnipay\Common\AbstractGatewayTest_MockAbstractGateway\callCreateRequest(), Omnipay\PayPal\RestGateway\cancelSubscription(), Omnipay\PayPal\ProGateway\capture(), Omnipay\PayPal\RestGateway\capture(), Omnipay\PayPal\ExpressGateway\completeAuthorize(), Omnipay\PayPal\ExpressGateway\completeOrder(), Omnipay\PayPal\ExpressGateway\completePurchase(), Omnipay\PayPal\RestGateway\completePurchase(), Omnipay\PayPal\RestGateway\completeSubscription(), Omnipay\PayPal\RestGateway\createCard(), Omnipay\PayPal\RestGateway\createPlan(), Omnipay\PayPal\RestGateway\createRequest(), Omnipay\PayPal\RestGateway\createSubscription(), Omnipay\PayPal\RestGateway\deleteCard(), Omnipay\PayPal\ExpressGateway\fetchCheckout(), Omnipay\PayPal\RestGateway\fetchPurchase(), Omnipay\PayPal\ProGateway\fetchTransaction(), Omnipay\PayPal\RestGateway\fetchTransaction(), Omnipay\Common\AbstractGateway\initialize(), Omnipay\PayPal\RestGateway\listPlan(), Omnipay\PayPal\RestGateway\listPurchase(), Omnipay\PayPal\ExpressInContextGateway\order(), Omnipay\PayPal\ExpressGateway\order(), Omnipay\PayPal\ProGateway\purchase(), Omnipay\PayPal\ExpressGateway\purchase(), Omnipay\PayPal\RestGateway\purchase(), Omnipay\PayPal\RestGateway\reactivateSubscription(), Omnipay\PayPal\ProGateway\refund(), Omnipay\PayPal\RestGateway\refund(), Omnipay\PayPal\RestGateway\refundCapture(), Omnipay\PayPal\RestGateway\searchTransaction(), Omnipay\PayPal\RestGateway\suspendSubscription(), Omnipay\PayPal\ExpressGateway\transactionSearch(), Omnipay\PayPal\RestGateway\updatePlan(), Omnipay\PayPal\ExpressGateway\void(), and Omnipay\PayPal\RestGateway\void().

◆ traitGetParameter

getParameter as Omnipay\Common\AbstractGateway::traitGetParameter

The documentation for this class was generated from the following file: