5-Minute Quickstart
This quickstart follows the Aegean Voyages (aegeanvoyages.example) charter deposit and club membership examples in site/modules/Payments/examples/real-world/.
-
Configure a sandbox gateway
Open Setup -> Payments -> Gateways, click + Set Up Gateway on Dummy Test Gateway (or Manual / Bank Transfer / EFT), give it handle
aegean-sandbox, set mode tosandbox, and enable it. -
Authorize and capture a charter deposit
<?php namespace ProcessWire;use Totoglu\Payments\Domain\Money;use Totoglu\Payments\Domain\PaymentIntentRequest;$payments = Payments::requireInstance($wire);$intent = new PaymentIntentRequest(amount: Money::fromMajor('4900.00', 'EUR'),payableType: 'charter_booking',payableId: 'CHR-2026-104',idempotencyKey: 'charter:CHR-2026-104:deposit:v1',gatewayHandle: 'aegean-sandbox',customerName: 'Claire Beaumont',description: '30% charter deposit for Gulet Blue Horizon',);// Step A: Hold funds with authorize()$auth = $payments->authorize($intent);// Step B: Capture once yacht availability is confirmed$capture = $payments->capture($auth->transactionId);// Verify total paid for the booking$isPaid = $payments->isPaid('charter_booking', 'CHR-2026-104');$summary = $payments->summaryForPayable('charter_booking', 'CHR-2026-104'); -
Generate a hosted
/pay/{token}link for the final balance<?php namespace ProcessWire;use Totoglu\Payments\Domain\Money;$link = $payments->createPaymentLink(['title' => 'Final Balance: Gulet Blue Horizon (CHR-2026-104)','amount' => Money::fromMajor('9800.00', 'EUR'),'payable_type' => 'charter_invoice','payable_id' => 'INV-2026-104','expires_in_hours' => 72,]);// Share $link['url'] (uses $link['rawToken'], returned once at creation) -
Start a recurring subscription
Create a billing plan in Setup -> Payments -> Plans (for example
aegean-club-proat199.00 EUR / monthwith a 14-day trial), then subscribe a member:<?php namespace ProcessWire;$subscription = $payments->subscribe(['plan_handle' => 'aegean-club-pro','gateway_handle' => 'aegean-sandbox','user_id' => (int) $user->id,'customer_name' => 'Claire Beaumont',]); -
Inspect the ledger in Setup -> Payments
Open Setup -> Payments -> Transactions, Payment Links, and Subscriptions to confirm your authorization, capture, hosted link, and trialing subscription appear in real time.