docs(stripe): add local setup guide, env comments, feature breakdown,…#161
docs(stripe): add local setup guide, env comments, feature breakdown,…#161
Conversation
… and release notes (#154) - backend/.env.example: annotate all Stripe vars with where to find them, test vs live key prefixes, and phase-2 webhook note - README.md: add Stripe Local Setup section (test keys, price IDs, FRONTEND_URL warning, phase-2 webhook deferred rationale) - _docs/featureBreakdown/v3.1-stripe-payments.md: add Local Development Setup walkthrough and updated Phase 2 / limitations section with reference to upcoming issue #152 - _docs/releaseNotes/v.3.1.0_Stripe.md: new release note covering full v3.1 scope, env var table, upcoming issues (#152, phase 2), and complete files-changed log
WalkthroughDocumentation and configuration examples for Stripe local development added across README, feature breakdown docs, release notes, and environment configuration. Enables developers to set up Stripe checkout locally with test keys and products. No functional code changes. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@backend/.env.example`:
- Around line 51-54: The .env.example contradicts its own docs by setting
STRIPE_WEBHOOK_SECRET to a placeholder instead of leaving it empty; update the
STRIPE_WEBHOOK_SECRET entry so its default value is blank (e.g.,
STRIPE_WEBHOOK_SECRET=) and keep the existing comment that it’s reserved for
Phase 2, ensuring the example matches the “leave blank locally” guidance for
newcomers and avoids accidental use of a fake secret.
- Line 61: The comment incorrectly suggests Stripe Price IDs use a
price_test_... prefix; update the comment text to state that Price IDs always
start with price_... in both test and live modes and that mode is controlled by
the API key (e.g., use your test secret key sk_test_... for test mode and live
secret key sk_live_... for live mode) and by the object's livemode field;
replace the existing line mentioning price_test_... with this corrected guidance
so developers know to switch API keys rather than look for a different Price ID
format.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c24faf3f-3065-495b-94e4-483b6b0fabea
📒 Files selected for processing (4)
README.md_docs/featureBreakdown/v3.1-stripe-payments.md_docs/releaseNotes/v.3.1.0_Stripe.mdbackend/.env.example
| # Stripe webhook signing secret — reserved for Phase 2 (fulfillment). | ||
| # NOT required to run the checkout flow today; leave blank locally. | ||
| # When you add webhook support: https://dashboard.stripe.com/webhooks → "Add endpoint" → copy signing secret. | ||
| STRIPE_WEBHOOK_SECRET=whsec_xxxx |
There was a problem hiding this comment.
Docs say “leave blank,” example says “not blank” — pick one and enforce it.
Line 52 says local webhook secret is not required, but Line 54 sets STRIPE_WEBHOOK_SECRET=whsec_xxxx. That contradiction is a setup trap for new devs. Prefer empty default in .env.example.
Suggested fix
-STRIPE_WEBHOOK_SECRET=whsec_xxxx
+STRIPE_WEBHOOK_SECRET=🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@backend/.env.example` around lines 51 - 54, The .env.example contradicts its
own docs by setting STRIPE_WEBHOOK_SECRET to a placeholder instead of leaving it
empty; update the STRIPE_WEBHOOK_SECRET entry so its default value is blank
(e.g., STRIPE_WEBHOOK_SECRET=) and keep the existing comment that it’s reserved
for Phase 2, ensuring the example matches the “leave blank locally” guidance for
newcomers and avoids accidental use of a fake secret.
| # 1. Create a product (e.g. "Coffee") | ||
| # 2. Add a one-time price (e.g. AUD 5) | ||
| # 3. Copy the Price ID (starts with price_) | ||
| # Use price_test_... IDs for local/test; price_... IDs for live. |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
In Stripe, do Price IDs have different prefixes in test vs live modes (for example price_test_...vsprice_...), or are they always price_...?
💡 Result:
Stripe Price IDs don’t get a special “test” prefix. In both test and live modes they look like price_...; the mode is indicated by the object’s livemode field (and by which API key you use), not by the ID format. [1], [2]
So you won’t see price_test_... (that prefix style is for API keys like sk_test_..., not Price IDs). [2]
Fix the comment: Stripe Price IDs don't have a price_test_... prefix — that's not how they work.
The current guidance is straight-up wrong and will send devs down a rabbit hole. Stripe Price IDs are always price_... in both test and live modes. The mode is determined by the API key you use and the livemode field on the object, not the ID format. The test_ prefix thing? That's only for API keys like sk_test_..., not Price IDs. Update this to something like: "Use your test API key for test mode, live API key for live mode—Price IDs stay price_... either way."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@backend/.env.example` at line 61, The comment incorrectly suggests Stripe
Price IDs use a price_test_... prefix; update the comment text to state that
Price IDs always start with price_... in both test and live modes and that mode
is controlled by the API key (e.g., use your test secret key sk_test_... for
test mode and live secret key sk_live_... for live mode) and by the object's
livemode field; replace the existing line mentioning price_test_... with this
corrected guidance so developers know to switch API keys rather than look for a
different Price ID format.
… and release notes (#154)
Summary by CodeRabbit