CoolCMS API

ComcatExpressServiceProvider extends AbstractQuickPriceExpressServiceProvider
in package

FinalYes

Express SMS services of the company catalogue: `<KEYWORD> FIRMA <SERVICE> <entry id>`, services = Comcat tariffs with an active quick price. Activation = callback `COMCAT_PAYMENT` ({@see PaymentItemManager::updateStatusForPayment()}), same as a payment from the payment form.

Table of Contents

Properties

$advertManager  : AdvertManager
$paymentItemManager  : PaymentItemManager
$tariffManager  : TariffManager

Methods

__construct()  : mixed
createPaymentItems()  : bool
Create the module payment items (inactive) for a payment the System layer just created.
describe()  : array<int, ExpressServiceDescription>
Every express service the module offers right now through the gateway, for the administration overview and the Front offers.
getModuleCode()  : string
Module word of the SMS text, one of {@see ExpressModuleCode}.
hasPaymentItems()  : bool
Does the payment already have the module payment items? Read straight from the DB. The resumed processing of a redelivered SMS (the first run crashed after the payment was saved) asks before {@see createPaymentItems()} — a second set of items would activate twice.
resolve()  : ExpressResolution
Validate the untrusted SMS data: the service must be one the module offers right now (an active quick price, or a tariff price for the gateway), the object must exist and be active.
bindPaymentItemObject()  : bool
Point the new payment item at the object. Advert default: `setAdvertId()`.
buildObjectLabel()  : string
Short label of the object for the customer reply, e.g. `inzerat 956` (SMS = `ASCII`).
createPaymentItemEntity()  : BaseEntity
New, empty module payment item entity.
findActiveTariffs()  : iterable<string|int, BaseEntity>
Active tariffs with `translations` and `quickPrices` loaded.
findObject()  : BaseEntity|null
Object by id (module Api manager), null = does not exist.
findPaymentItemByPayment()  : BaseEntity|null
Any module payment item of the payment (module Api manager), null = none yet.
getCallbackKey()  : string
`cms_system_payment_callbacks.callback_key` of the module (activates its payment items).
isObjectActive()  : bool
Can the object still be paid for? Advert default: `active = 1` (approved, paid, not banned, deactivated nor sold — the advert entity folds that into one column).
savePaymentItem()  : bool
Persist a new module payment item through the module manager (its save hooks included).

Properties

Methods

createPaymentItems()

Create the module payment items (inactive) for a payment the System layer just created.

public createPaymentItems(ExpressTarget $target, int $paymentId) : bool

The payment callback activates them once the payment is completed.

Parameters
$target : ExpressTarget
$paymentId : int
Return values
bool

getModuleCode()

Module word of the SMS text, one of {@see ExpressModuleCode}.

public getModuleCode() : string
Return values
string

hasPaymentItems()

Does the payment already have the module payment items? Read straight from the DB. The resumed processing of a redelivered SMS (the first run crashed after the payment was saved) asks before {@see createPaymentItems()} — a second set of items would activate twice.

public hasPaymentItems(int $paymentId) : bool
Parameters
$paymentId : int
Return values
bool

resolve()

Validate the untrusted SMS data: the service must be one the module offers right now (an active quick price, or a tariff price for the gateway), the object must exist and be active.

public resolve(string $serviceCode, int $objectId, int $paymentGateId) : ExpressResolution

Returns one target per payment region / tariff offering it — the System layer then picks the one whose price and currency equal the number the SMS was sent to.

$paymentGateId = the SMS gateway that received the message; modules whose prices differ per gateway (user tariffs) read their price for it, quick price modules ignore it.

Parameters
$serviceCode : string
$objectId : int
$paymentGateId : int
Return values
ExpressResolution

bindPaymentItemObject()

Point the new payment item at the object. Advert default: `setAdvertId()`.

protected bindPaymentItemObject(BaseEntity $paymentItem, int $objectId) : bool

False = the item entity has no such setter (wrong wiring) → the SMS fails with a claim code.

Parameters
$paymentItem : BaseEntity
$objectId : int
Return values
bool

buildObjectLabel()

Short label of the object for the customer reply, e.g. `inzerat 956` (SMS = `ASCII`).

protected buildObjectLabel(int $objectId) : string
Parameters
$objectId : int
Return values
string

findPaymentItemByPayment()

Any module payment item of the payment (module Api manager), null = none yet.

protected findPaymentItemByPayment(int $paymentId) : BaseEntity|null
Parameters
$paymentId : int
Return values
BaseEntity|null

getCallbackKey()

`cms_system_payment_callbacks.callback_key` of the module (activates its payment items).

protected getCallbackKey() : string
Return values
string

isObjectActive()

Can the object still be paid for? Advert default: `active = 1` (approved, paid, not banned, deactivated nor sold — the advert entity folds that into one column).

protected isObjectActive(BaseEntity $object) : bool
Parameters
$object : BaseEntity
Return values
bool

savePaymentItem()

Persist a new module payment item through the module manager (its save hooks included).

protected savePaymentItem(BaseEntity $paymentItem) : bool
Parameters
$paymentItem : BaseEntity
Return values
bool
On this page

Search results