Search by

flexext / craft-stripe-payments

flexext-dev

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

Documentation

Type:craft-plugin

pkg:composer/flexext/craft-stripe-payments

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2026-12-02 11:35 UTC

This package is auto-updated.

Last update: 2026-12-02 11:49:10 UTC


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') }}.
  • Bank-Grade Security & Zero-Trust Verification:
    • Environment variable support ($STRIPE_SECRET_KEY, $STRIPE_WEBHOOK_SECRET) via App::parseEnv().
    • Official HMAC-SHA256 Stripe-Signature verification 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.
  • 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_PAID to automate Craft user roles, CRM webhooks, or entry updates.
  • 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

  1. Open Settings → Stripe Payment Forms & Paid Links in the Craft Control Panel.
  2. Add your Stripe Secret API Keys (or .env aliases such as $STRIPE_TEST_SECRET_KEY / $STRIPE_LIVE_SECRET_KEY) and click Test Stripe API.
  3. Register the displayed Webhook Endpoint (/stripe-pay/webhook) in your Stripe Dashboard for checkout.session.completed, checkout.session.expired, and charge.refunded, then paste the Webhook Signing Secret (whsec_...).
  4. 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.