Skip to content

Phase 6 — Commerce foundation (without licence enforcement) #36

Description

@b5463

Part of Milestone D — Paid Products. Ref: #27

Add offers, customers, orders and subscriptions with Stripe, but do not yet enforce access in apps. Money flow must be stable before access revocation and product keys are automated.


Alex tasks

Tables

  • offers
  • customers
  • orders
  • subscriptions
  • payment_webhook_events
  • checkout_disclosures

Stripe integration

  • Stripe Checkout
  • Stripe Customer Portal
  • Signed webhook endpoint
  • Webhook idempotency (duplicate webhook must not duplicate order)
  • Manual order creation
  • Complimentary order creation

Checkout flow

product page → create checkout session → Stripe Checkout → signed webhook → order/subscription record → confirmation page

Rule: success redirect must never grant access.

Subscription states

Mirror from Stripe: trialing, active, past_due, cancel_at_period_end, cancelled, expired. Record correctly — do not enforce in apps yet.

Legal/compliance capture per checkout

  • Terms version
  • Privacy version
  • Withdrawal consent (if needed)
  • Marketing consent (if used)
  • Locale
  • Billing country
  • Tax/VAT evidence fields

Reconciliation jobs

Add before any live billing:

  • stripe.reconcile.checkout_sessions
  • stripe.reconcile.subscriptions
  • stripe.reconcile.invoices
  • stripe.reconcile.entitlements

Tests

  • Checkout session creation
  • Webhook signature verification
  • Duplicate webhook does not duplicate order
  • Subscription created
  • Subscription updated
  • Subscription deleted
  • Invoice payment failed recorded
  • Manual order audited
  • Checkout disclosure captured

Tomas tasks

  • Checkout flow UI (product page → confirmation page)
  • Legal/compliance capture UI (consent checkboxes, withdrawal consent, marketing consent display)
  • Orders dashboard view
  • Subscriptions dashboard view
  • Customer records view

Do not build yet

Automatic product-key delivery, entitlement-based app locking, licence revocation, subscription suspension logic.

Exit gate

  • Test-mode Stripe checkout works end to end
  • Webhooks are idempotent
  • Orders/subscriptions visible in dashboard
  • No access is granted from redirect
  • Backup/restore includes commerce tables

Rollback

Disable checkout creation. Keep recorded test data or purge in non-production.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions