buildmymcpserver/apps/api/package.json
Marco Sadjadi c2a21fc3cd
Some checks failed
Deploy to Production / deploy (push) Failing after 46s
feat(billing): Stripe Checkout + Customer Portal + signed webhook
- @bmm/api: stripe@22 SDK, plan-aware price-id lookup, Redis-backed event
  idempotency (7d TTL covers Stripe's retry window), startup warning when
  STRIPE_PRICE_* env vars contain product ids (prod_) by mistake
- routes/billing.ts:
    POST /v1/billing/checkout-session  → Stripe-hosted Checkout, SEPA+card,
                                          auto-VAT via Stripe Tax, tax_id
                                          collection for B2B, address required
    POST /v1/billing/portal            → Customer Portal session
    GET  /v1/billing/status            → drives the settings/billing UI
    POST /v1/billing/webhook           → signed, idempotent, handles
                                          checkout.session.completed,
                                          subscription.{created,updated,deleted},
                                          invoice.{paid,payment_failed}
- index.ts: rawBody-aware JSON parser so Stripe signature verify gets the
  exact payload bytes
- web: /settings/billing page (status, upgrade flow, manage-billing portal,
  auto-checkout when arriving with ?tier=… from the pricing CTAs), pricing
  page CTAs point to /settings/billing?tier=…
- Payment-failure path: suspend org only after 3rd failed attempt (Stripe
  Smart Retries handles the soft-retries). Suspended orgs keep their running
  servers but cannot create new ones (enforcement is in /v1/servers POST as
  a follow-up).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 16:30:42 +02:00

34 lines
769 B
JSON

{
"name": "@bmm/api",
"version": "0.1.0",
"type": "module",
"private": true,
"scripts": {
"dev": "tsx watch src/index.ts",
"start": "tsx src/index.ts",
"build": "tsc -p tsconfig.json",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@bmm/auth": "workspace:*",
"@bmm/db": "workspace:*",
"@bmm/llm": "workspace:*",
"@bmm/types": "workspace:*",
"@fastify/cookie": "11.0.1",
"@fastify/cors": "10.0.1",
"@fastify/websocket": "11.0.1",
"bullmq": "5.34.5",
"drizzle-orm": "0.36.4",
"fastify": "5.2.0",
"ioredis": "5.4.1",
"jose": "5.9.6",
"stripe": "^22.1.1",
"zod": "3.25.76"
},
"devDependencies": {
"@types/node": "22.10.2",
"tsx": "4.19.2",
"typescript": "5.7.2"
}
}