summaryrefslogtreecommitdiff
path: root/Biz/PodcastItLater/Billing.py
AgeCommit message (Collapse)Author
2 daysAdd Stripe webhook tests and testing documentationBen Sima
- Add TestWebhookHandling class with tests for subscription webhooks - Test normal subscription creation flow with mock data - Test handling of incomplete webhook data (missing fields) - Add STRIPE_TESTING.md with comprehensive testing guide: - How to use Stripe test mode and test cards - How to use Stripe CLI to trigger test webhooks - Instructions for running unit tests - Database migration instructions for production - End-to-end testing workflow - Common troubleshooting issues Tests verify webhook handling works without calling real Stripe API.
2 daysFix Stripe webhook KeyError by using safe dict accessBen Sima
- Replace direct dict key access with .get() for all subscription fields - Add validation and early return for missing required fields - Add logging warnings when subscription data is incomplete - Handles both dict and Stripe object access patterns safely - Fixes KeyError: 'current_period_start' when processing webhooks
2 daysRemove personal tier, keep only free and proBen Sima
Simplified pricing to two tiers: - Free: 10 articles total (lifetime) - Pro: $29/month unlimited articles Removed STRIPE_PRICE_ID_PERSONAL from configuration.
2 daysChange free plan from monthly to lifetime limitBen Sima
Free tier now has 10 articles total (lifetime) instead of 10 per month. Period boundaries for free users now span from account creation to far future.
5 daysfeat: Add stripe to Python deps and document dependency processBen Sima
- Add stripe to Omni/Bild/Deps/Python.nix (alphabetically sorted) - Fix all type annotations in Billing.py for mypy - Document how to add Python packages in AGENTS.md - Add billing routes to Web.py (checkout, portal, webhook) This enables Stripe integration in PodcastItLater. Related to task t-144e7lF
5 daysfeat(PodcastItLater): Add Stripe billing infrastructureBen Sima
Add complete Stripe integration backend ready for testing once stripe package is available in Nix environment. Components: - Billing.py: Stripe Checkout, Billing Portal, webhook handling - Database migrations for subscription tracking - Usage tracking with tier-based limits - Idempotent webhook processing with stripe_events table Tier limits: free (10/mo), personal (50/mo), pro (unlimited) Webhook events handled: - checkout.session.completed (link customer to user) - customer.subscription.{created,updated,deleted} (sync state) - invoice.payment_failed (mark past_due) Requires: Stripe Python package in Nix, Web.py routes (next commit) Related to task t-144e7lF Amp-Thread-ID: https://ampcode.com/threads/T-8feaca83-dcc2-46cb-8f71-d0785960a2f7 Co-authored-by: Amp <amp@ampcode.com>