Payments
in package
Payments class.
Table of Contents
- LOG_TABLE_NAME = 'l_#__payments'
- TABLE_NAME = 'i_#__payments'
- DEFAULT_GATEWAY_ID = 0
- $config : array<string|int, mixed>
- $paymentGateway : PaymentGateway
- __construct() : mixed
- PayU instance constructor.
- clearCache() : void
- Clears cache used by payments integration.
- getAll() : Generator<string|int, Payments>
- Returns all payments instances.
- getAllActive() : Generator<string|int, Payments>
- Returns all active Payments instances.
- getAssignedGatewayIds() : array<string|int, mixed>
- Returns gateway id and also if gateway is default - default gateway id.
- getById() : array<string|int, mixed>
- Returns PayU configuration values.
- getDefault() : self
- Returns default payment gateway.
- getGateway() : PaymentGateway
- Returns payment gateway driver.
- getGatewayClass() : class-string<\App\Integrations\Payments\Contract\PaymentGateway>
- Returns payment gateway FQN class.
- getGateways() : array<string, class-string<\App\Integrations\Payments\Contract\PaymentGateway>>
- Get Payment gateways.
- getId() : int
- Returns gateway config id.
- getNotificationUrl() : string
- Returns payment gateway notification url.
- initialize() : void
- Initialize payment gateway.
- logError() : void
- Log error related to payments.
- getCachedCollection() : Generator<string|int, Payments>
- Returns cached collection.
Constants
LOG_TABLE_NAME
public
string
LOG_TABLE_NAME
= 'l_#__payments'
Basic table name
TABLE_NAME
public
string
TABLE_NAME
= 'i_#__payments'
Basic table name
DEFAULT_GATEWAY_ID
private
int
DEFAULT_GATEWAY_ID
= 0
default gateway id
Properties
$config
private
array<string|int, mixed>
$config
Database config.
$paymentGateway
private
PaymentGateway
$paymentGateway
Methods
__construct()
PayU instance constructor.
public
__construct(int $apiId) : mixed
Parameters
- $apiId : int
Tags
Return values
mixed —clearCache()
Clears cache used by payments integration.
public
static clearCache(string|int $gatewayId) : void
Parameters
- $gatewayId : string|int
Return values
void —getAll()
Returns all payments instances.
public
static getAll() : Generator<string|int, Payments>
Tags
Return values
Generator<string|int, Payments> —getAllActive()
Returns all active Payments instances.
public
static getAllActive() : Generator<string|int, Payments>
Tags
Return values
Generator<string|int, Payments> —getAssignedGatewayIds()
Returns gateway id and also if gateway is default - default gateway id.
public
getAssignedGatewayIds() : array<string|int, mixed>
Return values
array<string|int, mixed> —getById()
Returns PayU configuration values.
public
static getById(int $id) : array<string|int, mixed>
Parameters
- $id : int
Tags
Return values
array<string|int, mixed> —getDefault()
Returns default payment gateway.
public
static getDefault() : self
Return values
self —getGateway()
Returns payment gateway driver.
public
getGateway() : PaymentGateway
Return values
PaymentGateway —getGatewayClass()
Returns payment gateway FQN class.
public
static getGatewayClass(string $name) : class-string<\App\Integrations\Payments\Contract\PaymentGateway>
Parameters
- $name : string
Return values
class-string<\App\Integrations\Payments\Contract\PaymentGateway> —getGateways()
Get Payment gateways.
public
static getGateways() : array<string, class-string<\App\Integrations\Payments\Contract\PaymentGateway>>
Return values
array<string, class-string<\App\Integrations\Payments\Contract\PaymentGateway>> —getId()
Returns gateway config id.
public
getId() : int
Return values
int —getNotificationUrl()
Returns payment gateway notification url.
public
getNotificationUrl() : string
Tags
Return values
string —initialize()
Initialize payment gateway.
public
initialize() : void
Return values
void —logError()
Log error related to payments.
public
logError(string $category, string $message, Throwable $ex) : void
Parameters
- $category : string
- $message : string
- $ex : Throwable
Tags
Return values
void —getCachedCollection()
Returns cached collection.
private
static getCachedCollection(string $name, Query $query) : Generator<string|int, Payments>
Parameters
- $name : string
-
Cache name
- $query : Query
-
Query for collection generation