Skip to content

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>/.

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',
'customer_email' => '[email protected]',
'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,
'customer_email' => '[email protected]',
]);

Inside /portal/billing, the portalBillingResolver surfaces active Payments subscriptions, downloadable PDF invoices, and customer portal links automatically.

  • Account: Provides customer authentication for /portal/*, dispatches purchase/renewal/license emails through Account’s NotificationService templates (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 when Headless is installed.
Licenses issued via Payments checkout webhooks appear immediately in Setup -> Packages -> Licenses and in the customer's /portal/dashboard.

Next steps