Skip to content

pricing adjustments and stripe factory#318

Merged
InfinityBowman merged 6 commits into
mainfrom
317-stripe-improvements
Jan 20, 2026
Merged

pricing adjustments and stripe factory#318
InfinityBowman merged 6 commits into
mainfrom
317-stripe-improvements

Conversation

@InfinityBowman
Copy link
Copy Markdown
Owner

@InfinityBowman InfinityBowman commented Jan 19, 2026

Summary by CodeRabbit

  • Documentation

    • Added a comprehensive Stripe production setup guide: product/price examples, webhook and key setup, secret provisioning commands, env var references, and customer portal configuration.
  • Pricing Updates

    • Starter Team: $8/month ($80/year). Unlimited Team: $59/month ($590/year).
  • UX

    • Toast notifications now deduplicate similar messages to reduce repeat alerts.
  • Refactor

    • Centralized Stripe client creation for consistent payment handling.
  • Style

    • Minor UI background gradient class adjustment in notifications settings.

✏️ Tip: You can customize this high-level summary in your review settings.

@InfinityBowman InfinityBowman linked an issue Jan 19, 2026 that may be closed by this pull request
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 19, 2026

📝 Walkthrough

Walkthrough

Centralizes Stripe client creation via a new factory, updates billing/admin routes to use it, adds Stripe production setup docs, lowers the starter_team plan pricing, adds toast deduplication in the web UI, and updates Wrangler production env examples.

Changes

Cohort / File(s) Summary
Documentation
packages/docs/guides/stripe-setup.md
Add a production Stripe setup guide covering products/prices, webhook endpoints & secrets, API key → env var mapping, Wrangler secret commands, and Customer Portal configuration.
Pricing
packages/shared/src/plans/pricing.ts, packages/workers/src/auth/config.ts, packages/docs/guides/pricing-model.md
Adjust starter_team pricing: monthly $9 → $8 and yearly $90 → $80; update related comments and pricing docs.
Stripe client factory
packages/workers/src/lib/stripe.ts
New module exporting STRIPE_API_VERSION, createStripeClient(env), isStripeConfigured(env), and getStripeClientIfConfigured(env) with validation and standardized API version.
Stripe integration refactor
packages/workers/src/commands/billing/createSingleProjectCheckout.ts, packages/workers/src/routes/admin/billing-observability.ts, packages/workers/src/routes/admin/stats.ts, packages/workers/src/routes/admin/stripe-tools.ts, packages/workers/src/routes/billing/checkout.ts, packages/workers/src/routes/billing/invoices.ts, packages/workers/src/routes/billing/webhooks.ts
Replace direct new Stripe(...) usage with createStripeClient(c.env) and use isStripeConfigured() where applicable; convert some Stripe imports to type-only; preserve business logic and error handling.
Client UX
packages/web/src/components/ui/toast.tsx
Add toast deduplication (2s window), cap concurrent toasts (max: 3), and suppress duplicate messages.
Wrangler config
packages/workers/wrangler.jsonc
Add production STRIPE_PRICE_ID_* entries and example secret-provisioning commands for Stripe keys and webhook secrets.
Misc / Status & UI
packages/docs/STATUS.md, packages/web/src/components/settings/pages/NotificationsSettings.jsx
Remove two historical STATUS rows and change two CSS utility classes (bg-gradient-to-rbg-linear-to-r) in notifications settings.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant Client
participant WorkerRoute as Worker Route
participant StripeFactory as createStripeClient
participant StripeAPI as Stripe API
participant DB as Database
Client->>WorkerRoute: Initiate checkout request
WorkerRoute->>StripeFactory: isStripeConfigured(env) / createStripeClient(env)
StripeFactory-->>WorkerRoute: Configured Stripe client
WorkerRoute->>StripeAPI: Create Checkout Session (idempotent)
StripeAPI-->>WorkerRoute: Session URL / ID
WorkerRoute->>DB: Persist session / idempotency key
WorkerRoute-->>Client: Return checkout URL and session ID

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the two main changes: pricing adjustments (starter_team and unlimited_team pricing updates across multiple files) and the new Stripe factory (centralized createStripeClient utility and refactoring throughout the codebase).

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7c78ea3 and cd5edbf.

⛔ Files ignored due to path filters (4)
  • packages/docs/audits/error-handling-analysis.md is excluded by !packages/docs/audits/**
  • packages/docs/audits/local-first-comparison-outline-corates.md is excluded by !packages/docs/audits/**
  • packages/docs/audits/outline-comparison-report.md is excluded by !packages/docs/audits/**
  • packages/docs/audits/security-analysis.md is excluded by !packages/docs/audits/**
📒 Files selected for processing (1)
  • packages/docs/guides/pricing-model.md
🧰 Additional context used
📓 Path-based instructions (1)
**/*

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Never use emojis or unicode symbols anywhere in code, comments, documentation, plan files, commit messages, or examples

Files:

  • packages/docs/guides/pricing-model.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Workers Builds: corates
🔇 Additional comments (4)
packages/docs/guides/pricing-model.md (4)

4-4: Last updated date change looks good.

No issues with the date update.


171-175: Starter Team pricing and limits look consistent.

Monthly and annual figures align with the stated annual discount.


224-224: Unlimited Team price update looks consistent.

No concerns with the new monthly and annual figures.


304-309: Annual pricing lines are consistent with the discount rule.

No concerns here.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Jan 19, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
corates cd5edbf Commit Preview URL Jan 20 2026, 01:42 AM

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/docs/guides/pricing-model.md (1)

249-260: Replace unicode symbols in the feature table to meet guidelines.

The feature table uses unicode symbols (for example, checkmarks and crosses) in nearby rows, which violates the "no unicode symbols anywhere" rule for documentation. Please replace them with ASCII text like "Yes" and "No".

Proposed fix
-| Automation (AMSTAR-2, etc.) | ❌         | ✅                         | ✅                         | ✅                         | ✅                         |
-| Consensus workflows         | ❌         | ✅                         | ✅                         | ✅                         | ✅                         |
-| PDF markup                  | Local only | ✅                         | ✅                         | ✅                         | ✅                         |
-| Audit trails                | ❌         | ❌                         | ❌                         | ✅                         | ✅                         |
-| Version history             | ❌         | ❌                         | ❌                         | ✅                         | ✅                         |
-| Visualizations              | Basic      | ✅                         | ✅                         | ✅                         | ✅                         |
+| Automation (AMSTAR-2, etc.) | No         | Yes                        | Yes                        | Yes                        | Yes                        |
+| Consensus workflows         | No         | Yes                        | Yes                        | Yes                        | Yes                        |
+| PDF markup                  | Local only | Yes                        | Yes                        | Yes                        | Yes                        |
+| Audit trails                | No         | No                         | No                         | Yes                        | Yes                        |
+| Version history             | No         | No                         | No                         | Yes                        | Yes                        |
+| Visualizations              | Basic      | Yes                        | Yes                        | Yes                        | Yes                        |
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7c78ea3 and cd5edbf.

⛔ Files ignored due to path filters (4)
  • packages/docs/audits/error-handling-analysis.md is excluded by !packages/docs/audits/**
  • packages/docs/audits/local-first-comparison-outline-corates.md is excluded by !packages/docs/audits/**
  • packages/docs/audits/outline-comparison-report.md is excluded by !packages/docs/audits/**
  • packages/docs/audits/security-analysis.md is excluded by !packages/docs/audits/**
📒 Files selected for processing (1)
  • packages/docs/guides/pricing-model.md
🧰 Additional context used
📓 Path-based instructions (1)
**/*

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Never use emojis or unicode symbols anywhere in code, comments, documentation, plan files, commit messages, or examples

Files:

  • packages/docs/guides/pricing-model.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Workers Builds: corates
🔇 Additional comments (4)
packages/docs/guides/pricing-model.md (4)

4-4: Last updated date change looks good.

No issues with the date update.


171-175: Starter Team pricing and limits look consistent.

Monthly and annual figures align with the stated annual discount.


224-224: Unlimited Team price update looks consistent.

No concerns with the new monthly and annual figures.


304-309: Annual pricing lines are consistent with the discount rule.

No concerns here.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@InfinityBowman InfinityBowman merged commit ec16945 into main Jan 20, 2026
3 checks passed
@InfinityBowman InfinityBowman deleted the 317-stripe-improvements branch January 20, 2026 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stripe improvements

2 participants