class PaymentGateways

Manages payment gateways

Traits

Singleton trait.

Properties

static protected $instance from  Singleton
private array $callbacks
private array $gateways

Methods

static 
instance()

Create a new instance of this singleton.

static 
forgetInstance()

Forget this singleton's instance if it exists

__construct()

Constructor.

initialize()

Initialize the singleton free from constructor parameters.

__clone()

No description

__wakeup()

No description

mixed|null
findGateway($name)

Returns payment gateway details based on its name.

listGatewayObjects()

Returns a list of the payment gateway objects

array
listGateways()

Returns a list of registered payment gateways.

loadGateways()

No description

registerGateways(string $owner, array $classes)

Registers the payment gateways.

registerCallback(callable $callback)

Manually registers a payment gateways.

static Response
runEntryPoint(string $code = null, string $uri = null)

Executes an entry point for registered gateways, defined in routes.php file.

static void
createPartials()

Loops over each payment type and ensures the editing theme has a payment form partial, if the partial does not exist, it will create one.

static string
getFileContent(string $class)

No description

Details

in Singleton at line 18
final static instance()

Create a new instance of this singleton.

in Singleton at line 28
final static forgetInstance()

Forget this singleton's instance if it exists

in Singleton at line 36
final protected __construct()

Constructor.

in Singleton at line 44
protected initialize()

Initialize the singleton free from constructor parameters.

in Singleton at line 48
__clone()

No description

in Singleton at line 53
__wakeup()

No description

at line 36
mixed|null findGateway($name)

Returns payment gateway details based on its name.

Parameters

$name

Return Value

mixed|null

at line 50
BasePaymentGateway[] listGatewayObjects()

Returns a list of the payment gateway objects

Return Value

BasePaymentGateway[]

at line 66
array listGateways()

Returns a list of registered payment gateways.

Return Value

array

Array keys are codes, values are payment gateways meta array.

at line 90
protected loadGateways()

No description

at line 119
registerGateways(string $owner, array $classes)

Registers the payment gateways.

The argument is an array of the gateway classes.

Parameters

string $owner

Specifies the gateways owner extension in the format extension_code.

array $classes

An array of the payment gateway classes.

at line 146
registerCallback(callable $callback)

Manually registers a payment gateways.

Usage:

  PaymentGateways::registerCallback(function($manager){
      $manager->registerGateways([...]);
  });

Parameters

callable $callback

A callable function.

at line 159
static Response runEntryPoint(string $code = null, string $uri = null)

Executes an entry point for registered gateways, defined in routes.php file.

Parameters

string $code

Entry point code

string $uri

Remaining uri parts

Return Value

Response

at line 183
static void createPartials()

Loops over each payment type and ensures the editing theme has a payment form partial, if the partial does not exist, it will create one.

Return Value

void

at line 210
static protected string getFileContent(string $class)

No description

Parameters

string $class

Return Value

string