Repository navigation
docs(env): STRIPE_* placeholders for Phase 2 PR 2 - #747
LucasSantana-Dev wants to merge 1 commit into
Conversation
Drops the 5 env vars the billing PR will consume into .env.example now, commented out. Zero runtime change — the billing routes don't exist yet; when PR 2 lands they default to disabled via STRIPE_ENABLED=false. Rationale for landing this separately: - Lets the next session start PR 2 without touching .env.example - Makes the env surface reviewable in isolation - Keeps PR 2's diff focused on the actual Stripe integration Placeholders documented: - STRIPE_ENABLED — master switch, 503s when false - STRIPE_SECRET_KEY — sk_test_... for staging - STRIPE_PUBLISHABLE_KEY — frontend Stripe.js mount (if needed) - STRIPE_PRICE_ID — single \$2.99/mo tier - STRIPE_WEBHOOK_SECRET — whsec_... for signature verification
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 50 minutes and 2 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Introduces the /api/billing/* and /webhooks/stripe route surface gated behind STRIPE_ENABLED. Zero runtime change — STRIPE_ENABLED defaults to unset so production hits the 503 path everywhere. Sets the shape for the real billing PR without touching the stripe npm dep, Prisma, or the frontend. Adds: - utils/billingConfig.ts — isStripeEnabled(), getStripeConfig(), requireStripeEnabled(). Tiny env-reading helpers, no caching. Pattern mirrors utils/developerAccess.ts. - routes/billing.ts — four endpoints (status GET, checkout POST, portal POST, subscription DELETE). Each short-circuits via requireStripeEnabled() then throws AppError(501, 'Not implemented') so enabling the flag later produces predictable "to be implemented" responses. - routes/stripeWebhook.ts — POST /webhooks/stripe. Top-of-file comment flags the express.json() body-parsing issue that will matter once real signature verification lands. Not solved here because the 503 returns before body access. - routes/index.ts — imports + adds both to routeSetups. Wiring notes: - /api/billing/* inherits apiLimiter via the existing '/api/' prefix middleware. - Billing routes with mutations use writeLimiter. - /webhooks/stripe is deliberately non-/api/ so it skips apiLimiter (Stripe retries on its own cadence; client-IP rate limiting is counterproductive). Feature gating for this PR is literally the STRIPE_ENABLED flag and nothing else. No requireAuth, no guildGuardConfigs entry — those are future-PR concerns and the 503 returns before they'd apply. Tests: 8 total across two files: - 4 "disabled → 503" cases (one per endpoint). - "STRIPE_ENABLED=false (explicit) → 503" proves case handling. - "STRIPE_ENABLED=true → 501" spot-checks the flag is actually read. - 2 matching cases for the webhook. Follows up #747 (env placeholders) and #745/#746 (spec + PremiumService stub). Next PR wires in the stripe npm dep, Prisma subscription reads via PremiumService, and replaces the 501 placeholders with real logic.
|
Paused: Stripe/premium-billing work deferred. The existing |
Pull request was closed
Promotes ~/.claude/plans/lucky-next-phases-ultraplan.md into a committed spec under docs/specs/2026-04-20-lucky-next-phases/ via the spec-new skill. Includes a rewritten tasks.md with Phase 0/1 marked shipped (PRs #728-#743), Phase 2 status (PRs #746/#747/#749/#750 shipped, real Stripe SDK + PR 4 dashboard remaining), and an audit inventory of premium gates across packages/*/src to guide PR 4 wiring. Key audit findings: - Only PremiumService + replenisher.ts reference isPremium today - Collaborative playlist service already exists — natural P2 gate - embedColor palette is the cheapest premium UX gate - Leaderboard row-limit is frontend-paginated, not backend-enforced
Per 2026-04-20 decision: removing Stripe features for now. The existing premiumService.isPremium() check serves as the feature toggle (returns false without subscription rows, so all premium-adjacent paths behave as if off). Closed PRs: #745 (spec), #747 (env), #749 (routes) Kept: #746 (schema, harmless no-op on main), #750 (autoplay gate = the live toggle)
* docs(spec): promote lucky-next-phases ultraplan to docs/specs Promotes ~/.claude/plans/lucky-next-phases-ultraplan.md into a committed spec under docs/specs/2026-04-20-lucky-next-phases/ via the spec-new skill. Includes a rewritten tasks.md with Phase 0/1 marked shipped (PRs #728-#743), Phase 2 status (PRs #746/#747/#749/#750 shipped, real Stripe SDK + PR 4 dashboard remaining), and an audit inventory of premium gates across packages/*/src to guide PR 4 wiring. Key audit findings: - Only PremiumService + replenisher.ts reference isPremium today - Collaborative playlist service already exists — natural P2 gate - embedColor palette is the cheapest premium UX gate - Leaderboard row-limit is frontend-paginated, not backend-enforced * docs(spec): mark Phase 2 (Stripe/premium billing) as deferred Per 2026-04-20 decision: removing Stripe features for now. The existing premiumService.isPremium() check serves as the feature toggle (returns false without subscription rows, so all premium-adjacent paths behave as if off). Closed PRs: #745 (spec), #747 (env), #749 (routes) Kept: #746 (schema, harmless no-op on main), #750 (autoplay gate = the live toggle)
* docs(spec): promote lucky-next-phases ultraplan to docs/specs Promotes ~/.claude/plans/lucky-next-phases-ultraplan.md into a committed spec under docs/specs/2026-04-20-lucky-next-phases/ via the spec-new skill. Includes a rewritten tasks.md with Phase 0/1 marked shipped (PRs #728-#743), Phase 2 status (PRs #746/#747/#749/#750 shipped, real Stripe SDK + PR 4 dashboard remaining), and an audit inventory of premium gates across packages/*/src to guide PR 4 wiring. Key audit findings: - Only PremiumService + replenisher.ts reference isPremium today - Collaborative playlist service already exists — natural P2 gate - embedColor palette is the cheapest premium UX gate - Leaderboard row-limit is frontend-paginated, not backend-enforced * docs(spec): mark Phase 2 (Stripe/premium billing) as deferred Per 2026-04-20 decision: removing Stripe features for now. The existing premiumService.isPremium() check serves as the feature toggle (returns false without subscription rows, so all premium-adjacent paths behave as if off). Closed PRs: #745 (spec), #747 (env), #749 (routes) Kept: #746 (schema, harmless no-op on main), #750 (autoplay gate = the live toggle)



Summary
Drops the 5 env vars Phase 2 PR 2 will consume into `.env.example` now, commented out. Zero runtime change — the billing routes don't exist yet; when PR 2 lands they default to disabled via `STRIPE_ENABLED=false`.
Placeholders
Why land this separately
Test plan