Repository navigation
Add payment-first Stripe membership and browser onboarding - #68
Merged
Merged
Conversation
Connect the browser welcome page and Settings to authenticated Duel billing. Add owner-only Checkout and customer portal sessions, signed webhook reconciliation, and durable database leases to prevent duplicate purchases. Keep existing offline access available during rollout and document Stripe, Supabase, and webhook configuration required before activation.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Retain the newer PGlite dependency used by the billing lease tests while including the merged Supabase egress changes and database checks.
Record the owner-selected live Stripe account and USD 15 monthly membership price for both Players. Document that the configured live product is separate from the account's basketball analytics product and requires matching deployment credentials.
Present one confirmed monthly plan and launch public Stripe Checkout before requesting account or habit data. Bind the paid receipt to a verified matching email after Duel creation using atomic fenced purchase claims. Add durable anonymous purchase retries, canonical Stripe payment validation, signed webhook recovery, and security tests. Preserve existing data access during rollout and document activation requirements.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Refs #67. Deployment credentials and real Stripe payment testing remain activation steps.
Change
New Players now see one $15/month membership for both people and pay through Stripe before entering account or habit data. After Stripe confirms the payment, they sign up with the same verified email, create a Duel, and connect their membership. Existing Duel owners retain subscription management in Settings and
/billing.The browser membership section uses the confirmed live Do It Standard plan with a clear monthly price, one payment button, and no pre-purchase account form or trial promise. Public Checkout uses a random HttpOnly cookie (only its hash is stored), durable Stripe idempotency, canonical payment validation and fenced database leases. Claims require both the original browser token and a verified Supabase email matching Checkout. An arbitrary success URL or email cannot activate membership.
Verification
npm run check: typecheck/lint passed, 191 tests passed, plus Supabase database checks.npm run build: production build passed, including public purchase and claim routes./welcomeHTML, styles and local fonts were rendered at 1440px and visually inspected; the payment CTA's contrast was corrected. No form precedes purchase.Risks or follow-up
Apply
supabase/billing.sql, thensupabase/billing-purchase.sql. Configure Stripe/Supabase server credentials, webhook signing secret, customer portal and HTTPS app origin, then run sandbox end-to-end payment tests before live activation.docs/billing/stripe-setup.mdlists exact steps. No secrets are committed.The owner confirmed
price_1Sr6z31NPX0knP17OFmNZKMjon accountacct_1SoBvQ1NPX0knP17: USD 15/month for both Players, no trial. The Do It product is taggedapp=do-it; the account and price IDs are in.env.example. No unrelated product was used. Live Checkout requiresBILLING_LIVE_ENABLED=true.Payment-first purchase order is implemented; universal hard-paywall enforcement on existing habit/Duel APIs is not included. Existing offline access remains available. Subscription-only access needs a separate authoritative policy rollout.
A purchase must be activated in its original browser within the cookie's 30-day lifetime. Lost cookies require support recovery from the Stripe receipt. Do not tell the Player to repurchase. Financial records intentionally prevent silent Duel deletion; future deletion needs a cancellation/retention policy.
Summary
Evidence
Merge Danger
Door: two-way for UI/API code; SQL migrations are additive and retain financial records.
Blast Radius: billing.
Existing habit data policies are unchanged. Current main has been merged and its dependency conflict resolved.