ExpressServiceRegistry
in package
FinalYes
Module word → {@see ExpressServiceProviderInterface}, plus the overview for the administration.
Lazy over the container like PaymentGatewayRegistry: providers depend on module managers, and
resolving them eagerly would build half the Api layer for every payment request.
There is deliberately no DB table of express services — the services are the modules' quick prices; a second list would only drift away from them.
Table of Contents
Properties
- $container : Container
- $paymentGatePhoneManager : PaymentGatePhoneManager
- $providers : array<string, ExpressServiceProviderInterface>|null
Methods
- __construct() : mixed
- all() : array<string, ExpressServiceProviderInterface>
- describe() : array<int, ExpressServiceDescription>
- Every offered service with the gateway number for its price — a service without a number cannot be paid, which is exactly what the administrator needs to see.
- findGatewayPhones() : array<int, PaymentGatePhone>
- findPhoneForPrice() : PaymentGatePhone|null
- Number for an exact price. A one-off (MO, level 0) number wins over an MT level of the same price.
- get() : ExpressServiceProviderInterface|null
- loadProviders() : array<string, ExpressServiceProviderInterface>
Properties
$container read-only
private
Container
$container
$paymentGatePhoneManager read-only
private
PaymentGatePhoneManager
$paymentGatePhoneManager
$providers
private
array<string, ExpressServiceProviderInterface>|null
$providers
= null
Methods
__construct()
public
__construct(Container $container, PaymentGatePhoneManager $paymentGatePhoneManager) : mixed
Parameters
- $container : Container
- $paymentGatePhoneManager : PaymentGatePhoneManager
all()
public
all() : array<string, ExpressServiceProviderInterface>
Return values
array<string, ExpressServiceProviderInterface>describe()
Every offered service with the gateway number for its price — a service without a number cannot be paid, which is exactly what the administrator needs to see.
public
describe(int $paymentGateId) : array<int, ExpressServiceDescription>
Parameters
- $paymentGateId : int
Return values
array<int, ExpressServiceDescription>findGatewayPhones()
public
findGatewayPhones(int $paymentGateId) : array<int, PaymentGatePhone>
Parameters
- $paymentGateId : int
Return values
array<int, PaymentGatePhone>findPhoneForPrice()
Number for an exact price. A one-off (MO, level 0) number wins over an MT level of the same price.
public
static findPhoneForPrice(array<int, PaymentGatePhone> $phones, float $price, int $currencyId) : PaymentGatePhone|null
Parameters
- $phones : array<int, PaymentGatePhone>
-
sorted by level
- $price : float
- $currencyId : int
Return values
PaymentGatePhone|nullget()
public
get(string $moduleCode) : ExpressServiceProviderInterface|null
Parameters
- $moduleCode : string
Return values
ExpressServiceProviderInterface|nullloadProviders()
private
loadProviders() : array<string, ExpressServiceProviderInterface>