Custom Drivers & Integrations
Payments discovers custom gateway drivers lazily so adding a regional bank or PSP module never slows down normal ProcessWire requests.
Official Gateway Drivers
Section titled “Official Gateway Drivers”Payments ships four official, lazily loaded driver modules that integrate directly into Setup -> Payments -> Gateways:
- Stripe (
PaymentsStripe): PaymentIntents, Checkout Sessions, saved cards, metered billing, Connect marketplace, and invoices. - Paddle (
PaymentsPaddle): Merchant of Record checkout, global tax and invoicing, adjustments, and subscriptions. - PayPal (
PaymentsPayPal): Orders v2, partial captures, subscriptions, Partner Referrals, and Payouts. - iyzico (
PaymentsIyzico): 3DS and Checkout Form, BIN installments, card storage, subscriptions, and sub-merchant splits.
Building a Custom Gateway Driver
Section titled “Building a Custom Gateway Driver”Declare 'paymentsDriver' => true in your module’s getModuleInfo(), hook Payments::registerDrivers inside init(), and register a driver implementing PaymentGatewayInterface plus any applicable optional capability interfaces.
<?php namespace ProcessWire;
use Totoglu\Payments\Contracts\PaymentGatewayInterface;use Totoglu\Payments\Domain\GatewayCapabilities;
class PaymentsDriverAegeanBank extends WireData implements Module{ public static function getModuleInfo(): array { return [ 'title' => 'Aegean Bank Payment Driver', 'version' => 100, 'autoload' => false, 'requires' => ['Payments'], 'paymentsDriver' => true, ]; }
public function init(): void { $this->addHookAfter('Payments::registerDrivers', function (HookEvent $event): void { $registry = $event->arguments(0); $registry->register('aegean-bank', new AegeanBankGateway($this->wire())); }); }}Capability Interfaces
Section titled “Capability Interfaces”Return a GatewayCapabilities object from capabilities() and implement only the optional interfaces your provider supports:
| Interface | Unlocks |
|---|---|
SavedSourceGatewayInterface |
Vaulting and charging customer payment methods. |
InstallmentGatewayInterface |
Regional card installment matrices. |
SubscriptionGatewayInterface |
Recurring plan creation, cancellation, pause, and resume. |
QuantitySubscriptionGatewayInterface |
Seat-based subscription quantity updates. |
MeteredSubscriptionGatewayInterface |
Usage reporting (recordUsage()) and period summaries. |
MarketplaceGatewayInterface |
Sub-merchant onboarding, platformFeeMinor, splits, and transfers. |
WebhookGatewayInterface |
Inbound webhook signature verification and event normalization. |
InvoiceGatewayInterface |
Customer invoice listing and PDF URL resolution. |
TransactionStatusGatewayInterface |
Active status polling during payments:transactions:reconcile. |
Use Payments’ WireHttpTransport inside custom drivers for consistent timeouts, TLS verification, and SSRF protection. See site/modules/Payments/examples/real-world/custom-gateway-driver.php for a complete driver blueprint.
Sibling Module Integrations
Section titled “Sibling Module Integrations”Account: Automatically dispatches 7 transactional notification templates (payment-receipt,payment-refund,payment-failed,subscription-activated,subscription-invoice-paid,subscription-payment-failed,subscription-canceled) and powers/account/billing+ GDPRprivacy_export.Headless: Exposes/api/v1/payments/*and/api/v1/subscriptions/*endpoints protected bypayments:*andsubscriptions:*token scopes.Contacts& User Erasure (contactsParticipant => true,entriesUserDeleteListener => true): When a contact or ProcessWire user is erased under GDPR, Payments runsanonymizeForContact()andanonymizeForUser()to scrub customer names and emails while preserving financial ledger amounts and tax history.