- Add billing module (app/api/billing.py) with 5 API endpoints:
- GET /api/v1/billing/checkout/{tier} — redirect to Stripe Payment Links
- GET /api/v1/billing/status — current org tier, limits, upgrade URLs
- GET /api/v1/billing/success — Stripe success callback
- GET /api/v1/billing/cancel — Stripe cancel callback
- POST /api/v1/billing/webhook — handles 5 Stripe event types
- Zero-code payment flow: uses pre-configured Stripe Payment Links
with client_reference_id (org ID) and prefilled_email params
- Webhook handler processes checkout.session.completed,
customer.subscription.updated/deleted, invoice events
- Stripe signature verification via stripe library (primary)
or manual HMAC-SHA256 (fallback)
- Tier determination from payment amount: =pro, 9=team
- 4 new config settings in app/config.py:
stripe_pro_checkout_url, stripe_team_checkout_url,
stripe_webhook_secret, stripe_api_key
- Added stripe>=5.0,<16.0 dependency
- 29 tests in tests/test_billing.py (all passing)
- Total: 98 tests passing (69 existing + 29 new)
62 lines
No EOL
1.3 KiB
TOML
62 lines
No EOL
1.3 KiB
TOML
[project]
|
|
name = "indie-status-page"
|
|
version = "0.1.0"
|
|
description = "Lightweight, affordable status page tool for indie SaaS developers"
|
|
readme = "README.md"
|
|
requires-python = ">=3.11"
|
|
license = {text = "MIT"}
|
|
dependencies = [
|
|
"fastapi>=0.110,<1.0",
|
|
"uvicorn[standard]>=0.27,<1.0",
|
|
"starlette>=0.36,<1.0",
|
|
"sqlalchemy[asyncio]>=2.0,<3.0",
|
|
"aiosqlite>=0.19,<1.0",
|
|
"alembic>=1.13,<2.0",
|
|
"pydantic>=2.5,<3.0",
|
|
"pydantic-settings>=2.1,<3.0",
|
|
"python-multipart>=0.0.6,<1.0",
|
|
"jinja2>=3.1,<4.0",
|
|
"apscheduler>=3.10,<4.0",
|
|
"httpx>=0.27,<1.0",
|
|
"typer>=0.9,<1.0",
|
|
"rich>=13.0,<14.0",
|
|
"python-jose[cryptography]>=3.3,<4.0",
|
|
"passlib[bcrypt]>=1.7,<2.0",
|
|
"bcrypt==4.0.1",
|
|
"email-validator>=2.0,<3.0",
|
|
"stripe>=5.0,<16.0",
|
|
]
|
|
|
|
[project.optional-dependencies]
|
|
dev = [
|
|
"pytest>=8.0,<9.0",
|
|
"pytest-asyncio>=0.23,<1.0",
|
|
"httpx>=0.27,<1.0",
|
|
"ruff>=0.2,<1.0",
|
|
"mypy>=1.8,<2.0",
|
|
]
|
|
|
|
[project.scripts]
|
|
statuspage = "app.cli:app"
|
|
|
|
[build-system]
|
|
requires = ["hatchling"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[tool.hatch.build.targets.wheel]
|
|
packages = ["app"]
|
|
|
|
[tool.ruff]
|
|
target-version = "py311"
|
|
line-length = 100
|
|
|
|
[tool.ruff.lint]
|
|
select = ["E", "F", "I", "N", "W", "UP"]
|
|
|
|
[tool.pytest.ini_options]
|
|
asyncio_mode = "auto"
|
|
testpaths = ["tests"]
|
|
|
|
[tool.mypy]
|
|
python_version = "3.11"
|
|
strict = true |