Skip to content

Integrate Stripe billing: Checkout, customer portal, and webhooks #5

Description

@PAMulligan

Description

Add Stripe billing to the Optia backend so users can upgrade to Pro and manage their subscription. Reuse the same Stripe account already used for Bridleway.

Flow: the extension opens a Stripe Checkout session (hosted page) for the Pro plan; on success Stripe fires a webhook to the backend, which creates or updates the customer and issues a license. A Stripe customer portal link lets users manage or cancel.

Why

Chrome Web Store Payments no longer exists, so Stripe is how money actually changes hands. Checkout and the customer portal are hosted by Stripe, which keeps us out of scope for handling raw card data and offloads SCA, tax, and dunning. Webhooks are the source of truth for entitlement changes so the system stays correct even if the user closes the tab mid-flow.

Acceptance Criteria

  • Pro product and price configured in Stripe (monthly and/or annual)
  • POST /billing/checkout creates a Checkout session and returns the URL
  • POST /billing/portal returns a customer portal URL for an existing customer
  • POST /billing/webhook verifies the Stripe signature and handles checkout.session.completed, customer.subscription.updated, and customer.subscription.deleted
  • Webhook handlers create, update, or revoke the license and persist customer and subscription state
  • Idempotent webhook processing (safe on retries and duplicate events)
  • Test mode used end to end with Stripe CLI before any live keys
  • No card data ever touches the extension or our datastore
  • CI passes

Resources

Metadata

Metadata

Assignees

Fields

No fields configured for Feature.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions