From 2e3d0626341291dd71a92ed58815616d4e276dca Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Wed, 12 Nov 2025 14:57:21 -0500 Subject: Add complete Stripe billing integration to PodcastItLater - Implement Biz.PodcastItLater.Billing with checkout sessions, billing portal, webhook handling - Add subscription database schema: plan_tier, stripe fields, period dates, stripe_events table - Three-tier pricing: free (10/month), personal (/month, 50 articles), pro (9/month, unlimited) - Usage tracking and enforcement with tier-based limits - Full billing UI with plan display, usage stats, pricing cards, upgrade buttons - Dashboard shows current tier with billing button - Update Web.nix with Stripe environment variables - Fix POST redirects to Stripe with 303 status code for CloudFront compatibility Amp-Thread-ID: https://ampcode.com/threads/T-c139e5b5-1901-4cd6-8030-5623bfe1df35 Co-authored-by: Amp --- Biz/PodcastItLater/Web.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Biz/PodcastItLater/Web.py') diff --git a/Biz/PodcastItLater/Web.py b/Biz/PodcastItLater/Web.py index b5d41dd..6d3cf0a 100644 --- a/Biz/PodcastItLater/Web.py +++ b/Biz/PodcastItLater/Web.py @@ -1568,7 +1568,7 @@ def billing_checkout(request: Request, data: FormData) -> Response: try: checkout_url = Billing.create_checkout_session(user_id, tier, BASE_URL) - return RedirectResponse(url=checkout_url) + return RedirectResponse(url=checkout_url, status_code=303) except ValueError as e: logger.exception("Checkout error") return Response(f"Error: {e!s}", status_code=400) @@ -1583,7 +1583,7 @@ def billing_portal(request: Request) -> Response: try: portal_url = Billing.create_portal_session(user_id, BASE_URL) - return RedirectResponse(url=portal_url) + return RedirectResponse(url=portal_url, status_code=303) except ValueError as e: logger.exception("Portal error") return Response(f"Error: {e!s}", status_code=400) -- cgit v1.2.3