Skip to content

Billing: Checkout trial, promotion codes, and verified purchase tracking #238

Description

@paulocastellano

Context

Split out of #204. Cashier/checkout slice — merge-safe without Onboarding.

Goal

Replace the $1 first-month coupon with a Stripe Checkout trial + optional promotion codes, and harden purchase tracking so only verified conversions fire.

In scope

  • ConfigureSubscriptionCheckout (trial days from CASHIER_TRIAL_DAYS, clamp to Stripe minimums; CASHIER_ALLOW_PROMOTION_CODES)
  • Remove FirstMonthCheckoutDiscount
  • Wire StartSubscriptionCheckout / cashier config / .env.example
  • /billing/processing purchase tracking:
    • Verify Checkout Session belongs to the account’s Stripe customer
    • Completed-session-only conversion data
    • Idempotent / ack-safe delivery (no pixel on foreign or invented session ids)
  • Billing i18n for processing copy as needed

Critical out of scope (independence)

  • Do not redirect owners to the post-subscription /onboarding checklist yet — keep processing → current main destination (e.g. app/calendar/accounts). The Onboarding module owns flipping that redirect when the checklist exists.
  • Welcome UI / ICP rename
  • MCP / residual banner

Independence

Safe to merge to main alone. Checkout behavior improves; post-checkout destination stays stable until Onboarding ships.

Suggested test plan

  • Trial length / promo flags respected; CASHIER_TRIAL_DAYS=0 charges immediately
  • qualifiesForCheckoutTrial edge cases (first-time, incomplete_expired, etc.)
  • Foreign / invalid / abandoned / transient Stripe sessions never fire purchase
  • Processing recovers across reload without double-firing
  • Post-checkout still lands on the current destination (not checklist)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions