Mollie
Mollie supports subscriptions and one-time payments through the shared provider interface. Use this page if you prefer Mollie and do not need portal or invoice previews.
Configuration
<?php
return [
'bnomei.klub.provider.handler' => \Bnomei\Klub\Provider\MollieProvider::class,
'bnomei.klub.providers.mollie' => [
'secret' => fn() => env('MOLLIE_SECRET_KEY'),
'webhook_secret' => fn() => env('MOLLIE_WEBHOOK_SECRET'),
'field' => 'mollie',
],
];
Environment variables:
MOLLIE_SECRET_KEY(orMOLLIE_API_KEY)MOLLIE_WEBHOOK_SECRET(optional, enables signature checks for JSON webhooks)
Optional provider keys:
checkoutfor provider-specific payment/subscription payload overrides
Webhooks
Configure Mollie webhooks to POST /klub/webhooks/mollie.
Mollie classic webhooks post form data (id=...) without a signature. JSON webhooks can include X-Mollie-Signature.
If you set MOLLIE_WEBHOOK_SECRET, Klub verifies X-Mollie-Signature on JSON webhook payloads.
Checkout and webhook URL
By default, Klub sends webhookUrl as https://your-site/klub/webhooks/mollie. For local hosts (localhost, .test, .local), it omits webhookUrl unless you explicitly pass one through checkout options (bnomei.klub.providers.mollie.checkout).
Plan data (local)
Mollie uses local plans (providers.mollie.plans or site plans YAML). Use:
id(price id)unit_amount(minor units)currency(ISO 4217)type(recurringorone_time)interval(required for recurring subscriptions, e.g.1 month)
Optional for subscriptions: times, startDate, method.
Portal and invoices
- Portal: not supported (defaults to the return URL).
- Invoice preview: not supported.
Gotchas
- Subscription plans must include an
interval; missing intervals throw an exception before checkout. - Plan amounts and currencies are required for subscription changes.
- Mollie cancellations are immediate; “cancel at period end” is emulated.
See Purchases for flow details.