fix(billing): handle customer.subscription.created webhook + test isolation
- Add customer.subscription.created → subscription.activated mapping in stripe.parse_webhook so direct API subscription creation also creates DB rows - Add customer.subscription.created to setup_stripe.py enabled_events - Pin PAYMENT_PROVIDER=paddle and STRIPE_WEBHOOK_SECRET="" in test conftest so billing tests don't hit real Stripe API when env has Stripe keys - Add 8 unit tests for stripe.parse_webhook covering all event types Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -213,8 +213,10 @@ def patch_config():
|
||||
"""Set test Paddle config values."""
|
||||
original_values = {}
|
||||
test_values = {
|
||||
"PAYMENT_PROVIDER": "paddle", # default to Paddle so mocks work
|
||||
"PADDLE_API_KEY": "test_api_key_123",
|
||||
"PADDLE_WEBHOOK_SECRET": "whsec_test_secret",
|
||||
"STRIPE_WEBHOOK_SECRET": "", # no Stripe in default tests
|
||||
"RESEND_API_KEY": "", # never send real emails in tests
|
||||
"BASE_URL": "http://localhost:5000",
|
||||
"DEBUG": True,
|
||||
|
||||
Reference in New Issue
Block a user