PaymentGateFormTrait
Add/edit form of a payment gateway.
The skeleton comes from BasePresenter::createForm(). Fields:
translations (name, description), scriptName, settings (JSON configuration),
feePercents, forUnlogged, finalPrices, intermediarySupply and activated.
Per-region price relations (PaymentGateRegionRel) are not edited here.
Table of Contents
Methods
- createComponentEditForm() : Form
- buildPaymentGateExpressServices() : array<int, array{module: string, service: string, smsExample: string, tariffId: int, tariffName: string, price: float, currency: string, regionId: int|null, shortcode: string|null, level: int|null, payable: bool}>
- Returns the "express services" overview of an SMS gateway: what can be paid by one SMS `KEYWORD MODULE SERVICE ID`. Services are not a table of their own: they are the active quick prices of module tariffs and the membership tariff prices for this gateway ({@see ExpressServiceRegistry::describe()}). A service is active only when the gateway has a number for exactly its price; otherwise the SMS would never activate it.
- buildPaymentGateIntegrationUrls() : array<int, array{key: string, url: string|null, level: string}>
- Returns integration URLs to copy into the payment gateway admin.
- savePaymentGateForm() : bool
- setPaymentGateFormDefaults() : void
Methods
createComponentEditForm()
protected
createComponentEditForm() : Form
Return values
FormbuildPaymentGateExpressServices()
Returns the "express services" overview of an SMS gateway: what can be paid by one SMS `KEYWORD MODULE SERVICE ID`. Services are not a table of their own: they are the active quick prices of module tariffs and the membership tariff prices for this gateway ({@see ExpressServiceRegistry::describe()}). A service is active only when the gateway has a number for exactly its price; otherwise the SMS would never activate it.
private
buildPaymentGateExpressServices() : array<int, array{module: string, service: string, smsExample: string, tariffId: int, tariffName: string, price: float, currency: string, regionId: int|null, shortcode: string|null, level: int|null, payable: bool}>
Return values
array<int, array{module: string, service: string, smsExample: string, tariffId: int, tariffName: string, price: float, currency: string, regionId: int|null, shortcode: string|null, level: int|null, payable: bool}>buildPaymentGateIntegrationUrls()
Returns integration URLs to copy into the payment gateway admin.
private
buildPaymentGateIntegrationUrls() : array<int, array{key: string, url: string|null, level: string}>
Lists only what this implementation really serves. Most gateways (GoPay, Stripe, PayU,
PayPal) receive the return and notification address with each payment in the API request,
so nothing is copied into their portal; that is correct, not a missing feature. Gateways
that send notifications to one fixed URL from their own portal must get the address:
mobilniplatby (one-way delivery report) and comgate.
The level controls only the row look:
required- the gateway does not work without the setting,optional- recommended, not necessary,info- explanation only, no address to copy,missing- the endpoint is not implemented yet, do not enter the address anywhere.
Return values
array<int, array{key: string, url: string|null, level: string}>savePaymentGateForm()
private
savePaymentGateForm(ArrayHash<string|int, mixed> $values) : bool
Parameters
- $values : ArrayHash<string|int, mixed>
Return values
boolsetPaymentGateFormDefaults()
private
setPaymentGateFormDefaults(Form $form) : void
Parameters
- $form : Form