Payments & Integrations
Packages works standalone with manual/CLI licensing, and unlocks full commercial automation when optional sibling modules are installed. Every integration is strictly isolated under src/Integration/<Module>/.
Payments Integration (PackagesPayments)
Section titled “Payments Integration (PackagesPayments)”When Payments is installed, Packages declares 'paymentsWebhookListener' => true and 'paymentsHooks' => true so settled charges and subscription events automatically provision, renew, suspend, or revoke licenses without polling.
<?php namespace ProcessWire;
use Totoglu\Packages\Integration\Payments\PackagesPayments;
$packages = Packages::requireInstance($wire);
// 1. Create a hosted /pay/{token} checkout link for a one-time or renewal tier$checkout = PackagesPayments::createCheckoutLink($packages, [ 'package_slug' => 'booking-kit', 'tier_key' => 'pro', 'quantity' => 1,]);
// 2. Or start a recurring subscription tied to a subscription-model tier$subscription = PackagesPayments::createSubscription($packages, [ 'package_slug' => 'booking-kit', 'tier_key' => 'pro-monthly', 'user_id' => (int) $user->id,]);Inside /portal/billing, the portalBillingResolver surfaces active Payments subscriptions, downloadable PDF invoices, and customer portal links automatically.
Account, Currency & Headless Integrations
Section titled “Account, Currency & Headless Integrations”Account: Provides customer authentication for/portal/*, dispatches purchase/renewal/license emails through Account’sNotificationServicetemplates (order-confirmation,payment-receipt,subscription-activated), and includes license ownership in member profiles.Currency: Formats tier prices and multi-currency storefront matrices according to your configured store currency and locale rules.Headless: Exposes catalog and license resources through ProcessWire’s versioned REST API whenHeadlessis installed.