add payment/billing#224
Conversation
Plan: land billing on a dedicated
|
| Area | main |
stripe |
|---|---|---|
stripe dep, billing routes/utils/models |
absent | full PR implementation |
main.py billing middleware, routers, webhook CSRF skip |
absent | present |
db.py billing permissions / role backfill |
absent | present |
organization.py Stripe cancel on delete |
absent | present |
Billing templates / tests / 07-billing.qmd |
absent | present |
.env.example |
core vars only | core + billing block |
Expected conflict-prone files during propagation: main.py, pyproject.toml, db.py, organization.py, header/org templates, tests/conftest.py, .env.example.
CI
test.yml: run onmainandstripe; Stripe dummy env onstripeonly.propagate.yml:matrix.branch: [modal, hetzner, stripe]with auto-resolver for dependency overlay conflicts.
main docs (separate PR)
- Overview/customization/deployment: pointer to
stripebranch + merge recipe (git merge upstream/stripe). - README: optional branches table (
stripe,modal,hetzner). - Contributing: note that core PRs may need conflict guidance for
stripe.
Fork paths
| Starting point | Action |
|---|---|
| New SaaS fork | Fork with default branch stripe, or git checkout stripe |
Existing main fork |
git merge upstream/stripe, resolve core-file conflicts |
| No billing | stay on main |
On stripe, billing is always on — no BILLING_ENABLED flag on main (code simply absent there).
Follow-up on this branch before stripe push
-
.env.exampleregression - Drop
BILLING_ENABLED(stripe branch is always-on) - Nav middleware: avoid extra DB round-trip on hot paths
- Webhook: don’t permanently claim ignored events as processed
- Footer redesign → separate PR to
main - Standardize permission checks on
has_permission - Narrow type hints (
set[str], etc.) - Custom exceptions for Stripe failures (not generic 503 / wrong 403)
- Review
load_dotenv()at import time inmain.py
Issue #3 will be resolved against stripe, not main.
Restore .env.example, drop BILLING_ENABLED, optimize nav middleware, fix webhook retry semantics, use custom Stripe exceptions, standardize has_permission checks, and revert unrelated footer redesign.
|
Follow-up commit pushed (
Footer split: #225 (or whatever number gh assigns) |
|
Footer split PR: #226 |
Resolve conflicts: keep stripe dep in pyproject.toml, combine Stripe test env with main's CSRF browser fixtures, adopt main's utc_naive helpers. Co-authored-by: Cursor <cursoragent@cursor.com>
Add Stripe billing at organizational level, webhooks and necessary logs.
Resolves #3