Skip to content

DTOs and enums

Namespace Fomvasss\Billing\DTO, all final readonly.

receiptItems (array), customerEmail, customerIp, locale, description, saveCard (bool), successUrl, failUrl, webhookUrlParams (array), returnParams (array), initiation (?PaymentInitiation), raw (array). withReceiptItems(array) returns a copy. Meaning of each — Payments → ChargeOptions.

PropertyTypeMeaning
url?stringRedirect checkout
form?array['action' => ..., 'fields' => [...]] for a form-only gateway (LiqPay)
expiresAt?DateTimeInterfaceLifetime of this link
externalId?stringGateway reference
rawarrayGateway response
pendingboolrefund() only: accepted, awaiting approval (Paddle)

type (WebhookEventType), status (string), payment, subscription, paymentMethod, externalId, raw, snapshot. dedupKey() = {type}:{status}:{externalId} or null.

typestatus values
Paymentsucceeded, failed, refunded, canceled
Subscriptionsynced (applies snapshot); event-only created, renewed, payment_failed, canceled, trial_will_end
PaymentMethodattached, detached
Ignored—

externalId, status (SubscriptionStatus), currentPeriodEndsAt (end of the paid period), cancelsAt, trialEndsAt, pauseEndsAt, priceId, occurredAt. The whole state, not a delta: null cancelsAt/pauseEndsAt clear the columns; null currentPeriodEndsAt/trialEndsAt/priceId keep what’s there.

name, taxId, address, email, phone, iban, bank, logo, vatId, brand. fromArray() reads snake_case keys (tax_id, vat_id); toArray() drops empty values.

What a template gets as $document — see Invoices → Customizing the template.

ok (bool), message (?string), latencyMs (?float); GatewayHealth::up(), ::down().

money (Money, per unit), convertedFromCurrency, exchangeRate, exchangeRateAt — set only when a converter was used.

Namespace Fomvasss\Billing\Enums. String-backed ones are cast on the models, accept plain strings on write, and have label().

EnumColumnCases
PaymentStatuspayments.statuspending, paid, failed, canceled
PaymentTypepayments.typecharge, refund
PaymentInitiationpayments.initiationmanual, automatic
SubscriptionStatussubscriptions.statusincomplete, trialing, active, paused, past_due, canceled, ended
PricingTypeprices.pricing_typeflat, licensed, metered
Intervalprices.interval, prices.quota_intervalminute, hour, day, week, month, year
InvoiceTypeinvoices.typeinvoice, receipt (series(): INV, RCP)
InvoiceStatusinvoices.statusissued, paid, void
WebhookEventType— (pure enum)Payment, PaymentMethod, Subscription, Ignored

InvoiceType and InvoiceStatus have no label().

Fomvasss\Billing\Support\Rounding (string-backed): HalfUp, HalfDown, HalfEven, Up, Down, used by Money::multiply().