CoolCMS API

OrderPaymentRegionService
in package

FinalYes

Fills the payment region of an order from its payment (fill-if-empty).

Shared by the two entry points that pair an order with a payment:

The region is filled only when the order has none yet (a value set by an admin is never overwritten) and the payment has one. The write itself is left to each caller, because their transaction contexts differ (updateColumn outside the transaction for the gateway callback, an intent inside the final transaction for the transition).

The class does no I/O: the caller manager reads the payment region through PaymentManager::getPaymentRegionId() and passes it in as a parameter, so the class holds only the decision rule. Moving it to Models/Helpers/ is a possible cleanup.

Table of Contents

Methods

resolveFillIfEmpty()  : int|null
Returns the region id to write, or `null` when nothing changes.

Methods

resolveFillIfEmpty()

Returns the region id to write, or `null` when nothing changes.

public resolveFillIfEmpty(int|null $orderPaymentRegionId, int|null $paymentRegionId) : int|null
Parameters
$orderPaymentRegionId : int|null
$paymentRegionId : int|null
Return values
int|null
On this page

Search results