⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@level09
Copy link
Owner

@level09 level09 commented Jan 22, 2026

Adds Chargebee support alongside Stripe. Provider selected via BILLING_PROVIDER env var.

Changes:

  • HostedBilling class with identical interface for both providers
  • Webhook handlers with provider-specific auth (HMAC for Stripe, Basic Auth for Chargebee)
  • Renamed stripe_customer_idbilling_customer_id, StripeEventBillingEvent
  • Updated docs with setup instructions for both providers

Note: Choose provider before production—switching requires manual customer migration.

- Add BILLING_PROVIDER env var (defaults to 'stripe')
- Add Chargebee config: SITE, API_KEY, PRO_ITEM_PRICE_ID
- Add Chargebee webhook Basic Auth: USERNAME, PASSWORD
- Rename class for provider-agnostic billing
- Add provider column to track event source
- Update webhooks.py import and usage
- Provider-agnostic field name for multi-provider support
- Updated all references in models, billing, portal, webhooks
- Provider conditional in billing.py (Stripe or Chargebee)
- Chargebee: HostedPage checkout, PortalSession, webhook handling
- Success handler accepts both session_id (Stripe) and id (Chargebee)
- Add chargebee>=3.0.0 dependency
- Stripe: /stripe/webhook with signature verification
- Chargebee: /chargebee/webhook with Basic Auth
- Events: subscription_created/cancelled, payment_failed
- Remove subscription_created handler (upgrades handled via redirect flow)
- Require Basic Auth credentials in production (reject if missing)
- Allow unauthenticated webhooks only in debug mode for local testing
- Clean up imports, move Workspace import to module level
- Add PortalSessionWrapper for consistent .url interface with Stripe
- Add warning about choosing provider before production
- Document Chargebee setup and configuration
- Update field names (billing_customer_id, BillingEvent)
- Add provider comparison table
- Document webhook differences between providers
- Remove verbose debug logging from upgrade flow
- Update docstrings and comments to be provider-neutral
- Simplify billing portal error handling
- Update uv.lock with chargebee dependency
@level09 level09 force-pushed the chargebee-integration branch from 737b44f to 2776e84 Compare January 22, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants