flexext / craft-stripe-payments
Lightweight Stripe Checkout payment forms, custom-amount donations, recurring plans, and shareable paid links for Craft CMS 4 & 5 — without Craft Commerce.
Package info
github.com/flexext-dev/craft-stripe-payments
Type:craft-plugin
pkg:composer/flexext/craft-stripe-payments
Requires
- php: ^8.1
- craftcms/cms: ^4.5.0 || ^5.0.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Accept one-time payments, custom-amount donations, recurring subscriptions, and shareable paid links directly in Craft CMS 4.5+ and Craft CMS 5.x using Stripe Checkout — without Craft Commerce and with zero external Composer SDK bloat.
Built for Craft agencies, non-profits, consultants, SaaS landing pages, and editorial sites that need fast, secure Stripe payments (Cards, Apple Pay, Google Pay, Link, SEPA, BLIK, Klarna via Stripe Checkout) without maintaining a full e-commerce stack.
Key Features
- No Craft Commerce Required: Lightweight pure-PHP cURL Stripe REST API client — zero vendor conflicts, works smoothly on PHP 8.1–8.4 and Craft Cloud.
- Three Payment Flows Out of the Box:
- Fixed-Price Payment Forms: Services, invoices, retainers, event tickets, or digital downloads.
- Custom-Amount Donation Forms: Configurable preset amount pills (e.g. 10, 25, 50, 100), minimum threshold, and optional donor note.
- Recurring Subscriptions: Monthly or annual recurring plans powered natively by Stripe Checkout.
- Shareable Paid Links & Twig Embeds:
- Every form gets an instant standalone URL at
/stripe-pay/<slug>ready to share via email, QR code, or social post. - Embed anywhere inside your Craft templates with
{{ craft.stripePay.form('your-slug') }}or{{ craft.stripePay.button('your-slug') }}.
- Every form gets an instant standalone URL at
- Bank-Grade Security & Zero-Trust Verification:
- Environment variable support (
$STRIPE_SECRET_KEY,$STRIPE_WEBHOOK_SECRET) viaApp::parseEnv(). - Official HMAC-SHA256
Stripe-Signatureverification with 5-minute replay protection and rotated signing secret support. - Zero-Trust server-side
GET /v1/checkout/sessions/{id}verification on both return callbacks and webhooks with strict idempotency.
- Environment variable support (
- Control Panel Transactions, 1-Click Refunds & CSV Export:
- View paid, pending, and refunded transactions right inside the Craft Control Panel.
- Issue Full or Partial Refunds or sync live Stripe session status with 1 click.
- Export clean CSV reports with spreadsheet formula injection protection.
- Developer Extensibility:
- Hook into
flexext\stripepayments\services\PayService::EVENT_AFTER_PAYMENT_PAIDto automate Craft user roles, CRM webhooks, or entry updates.
- Hook into
- WCAG 2.2 AA Light & Dark Contrast:
- Accessible embedded forms and standalone paid pages with automatic Light/Dark theme support and zero jQuery.
Requirements
- Craft CMS 4.5.0+ or Craft CMS 5.0.0+
- PHP 8.1+ with cURL extension enabled
- A Stripe account (Test or Live API keys)
Installation
composer require flexext/craft-stripe-payments php craft plugin/install stripe-payment-forms
Configuration
- Open Settings → Stripe Payment Forms & Paid Links in the Craft Control Panel.
- Add your Stripe Secret API Keys (or
.envaliases such as$STRIPE_TEST_SECRET_KEY/$STRIPE_LIVE_SECRET_KEY) and click Test Stripe API. - Register the displayed Webhook Endpoint (
/stripe-pay/webhook) in your Stripe Dashboard forcheckout.session.completed,checkout.session.expired, andcharge.refunded, then paste the Webhook Signing Secret (whsec_...). - Navigate to Stripe Payments → Payment Forms in the Control Panel to create your first payment form, donation campaign, or paid link.
Twig Usage
Embed a full payment or donation form
{{ craft.stripePay.form('community-donation') }}
Render a compact direct checkout button
{{ craft.stripePay.button('strategy-call', { label: 'Book Strategy Call ($150)' }) }}
Share a standalone paid link
Every enabled form is automatically accessible at:
https://yoursite.com/stripe-pay/your-form-slug
Developer Event Hook
use flexext\stripepayments\events\PaymentPaidEvent; use flexext\stripepayments\services\PayService; use yii\base\Event; Event::on( PayService::class, PayService::EVENT_AFTER_PAYMENT_PAID, function (PaymentPaidEvent $event) { // $event->transaction (array), $event->form (array), $event->stripeSession (array) } );
Support & License
Commercial plugin licensed under the Craft License (LICENSE.md). For support, email contact@flexext.dev or open an issue on GitHub.