Skip to content

Tokenized auto-pay: Stripe (SetupIntent + off_session) — reference implementation #35

Description

@Panelica

Reference implementation for the tokenized auto-pay epic #34. Maintainer-owned (the core lands here).

Deliver:

  1. Gateway-agnostic core described in Recurring auto-pay (tokenized subscriptions) — WHMCS-style #34: the Tokenizable capability contract, the real card-vault flow, the auto-pay step in the renewal path, dunning, and the one-click toggle.
  2. Stripe implementation:
    • Save card: SetupIntent -> create/reuse a Stripe Customer, attach the PaymentMethod, persist its id in payment_methods.remote_token (+ brand/last4/exp for display). Replaces the current last4-only PaymentMethodController::store for Stripe.
    • Off-session charge: a PaymentIntent with customer, payment_method, off_session=true, confirm=true for a renewal Invoice. Today StripeModule::capture() only creates an interactive intent (payment_method_types[]=card), so a new code path is needed.
    • Webhook: handle payment_intent.succeeded / payment_intent.payment_failed for off-session charges (extend processWebhook).
    • SCA / decline: on requires_action or decline, fall back to dunning (notify the customer to pay the invoice manually).

Files: modules/Gateways/Stripe/StripeModule.php, app/Http/Controllers/Client/PaymentMethodController.php, app/Services/InvoiceGenerationService.php, app/Services/PaymentService.php, app/Models/PaymentMethod.php.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:billingInvoices, orders, taxes, couponsarea:gatewayPayment gateways (Stripe, PayPal, Bank Transfer, Authorize.Net)enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions