Description
Implement Stripe subscription integration so that users can upgrade their account status from "free" to "pro" ($5/month) directly from the /plans page.
User Story
As a LexGuard Free user,
I want to upgrade my account to the Pro tier via a secure payment interface,
So that I can unlock unlimited analyses and full 3-agent worst-case scenarios.
Technical Tasks
Database Updates
ALTER TABLE users ADD COLUMN IF NOT EXISTS stripe_customer_id TEXT;
Description
Implement Stripe subscription integration so that users can upgrade their account status from "free" to "pro" ($5/month) directly from the
/planspage.User Story
Technical Tasks
@stripe/stripe-json the Next.js frontend andstripeSDK on the backend./api/billing/checkoutto generate a Stripe Checkout session./plansto redirect the user to the Stripe Checkout page./api/webhooks/stripeto handle events:checkout.session.completed-> Update userplanto"pro"in Supabase.customer.subscription.deleted-> Revert userplanto"free"in Supabase.userstable to maintain billing history.Database Updates