Skip to content

refactor: simplify checkout URL handling and update Dodo mode configuration: - #253

Merged
yashdev9274 merged 1 commit into
mainfrom
supercode-cli
Aug 3, 2026
Merged

refactor: simplify checkout URL handling and update Dodo mode configuration:#253
yashdev9274 merged 1 commit into
mainfrom
supercode-cli

Conversation

@yashdev9274

@yashdev9274 yashdev9274 commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Description

  • Removed hardcoded product checkout URLs and streamlined the URL generation in the getCheckoutUrl function.
  • Updated the DODO_MODE environment variable in the .env.example file to default to an empty string for clarity.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor (no functional changes)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

  • bun test passes
  • bun run typecheck passes
  • bun run lint passes (if applicable)

Checklist:

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

Summary by CodeRabbit

  • Bug Fixes
    • Checkout links are now generated from the selected plan, improving reliability when plans change.
    • Checkout pages open in a new tab while keeping the current page available.
  • Configuration
    • Updated the example payment configuration to leave the payment mode unset by default.

…ration:

- Removed hardcoded product checkout URLs and streamlined the URL generation in the getCheckoutUrl function.
- Updated the DODO_MODE environment variable in the .env.example file to default to an empty string for clarity.
@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
supercli Ready Ready Preview Aug 3, 2026 6:36am
supercli-client Ready Ready Preview Aug 3, 2026 6:36am
supercli-docs Ready Ready Preview Aug 3, 2026 6:36am

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The Studio checkout flow now derives URLs from plan product IDs and opens payment links in a new tab. The server environment example leaves DODO_MODE empty by default.

Changes

Checkout configuration

Layer / File(s) Summary
Dynamic checkout flow
apps/supercode-cli/client/app/studio/page.tsx
Checkout URLs use each plan’s dodoProductId. Payment links open in a new tab with noopener,noreferrer.
Payment environment example
apps/supercode-cli/server/.env.example
DODO_MODE defaults to an empty value instead of "test".

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Poem

A rabbit hops through checkout bright,
With product IDs guiding the flight.
A new tab opens, safe and clear,
While empty mode waits near.
DODO_MODE rests, ready to start.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes both checkout URL handling changes and the Dodo mode configuration update.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch supercode-cli

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


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.

@yashdev9274
yashdev9274 merged commit 03d8e0b into main Aug 3, 2026
4 of 8 checks passed

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/supercode-cli/client/app/studio/page.tsx`:
- Line 298: Update the payment-link flow around window.open to clear
confirmingPlan immediately after the new tab is opened, ensuring the checkout
dialog closes and duplicate Pay now attempts cannot be initiated.

In `@apps/supercode-cli/server/.env.example`:
- Line 88: Update the DODO_MODE example configuration to use "test" as the safe
default, matching the test-mode check in the seed logic. Keep the existing
consumer behavior unchanged and ensure copied example configurations cannot
select the live payment branch by default.
🪄 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 Plus

Run ID: 32965e1b-c075-4e27-b0b1-97a446c5e362

📥 Commits

Reviewing files that changed from the base of the PR and between 171c1c1 and 7aa8941.

📒 Files selected for processing (2)
  • apps/supercode-cli/client/app/studio/page.tsx
  • apps/supercode-cli/server/.env.example

const url = getCheckoutUrl(confirmingPlan)
if (url) {
window.location.href = url
window.open(url, "_blank", "noopener,noreferrer")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Close the checkout dialog after opening the payment link.

The new-tab path leaves confirmingPlan set. The dialog remains open in the current tab, so the user can click Pay now again and start multiple checkout attempts. Clear the state after window.open returns.

Proposed fix
       window.open(url, "_blank", "noopener,noreferrer")
+      setConfirmingPlan(null)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
window.open(url, "_blank", "noopener,noreferrer")
window.open(url, "_blank", "noopener,noreferrer")
setConfirmingPlan(null)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/supercode-cli/client/app/studio/page.tsx` at line 298, Update the
payment-link flow around window.open to clear confirmingPlan immediately after
the new tab is opened, ensuring the checkout dialog closes and duplicate Pay now
attempts cannot be initiated.

DODO_PAYMENTS_WEBHOOK_KEY=""
# ⚪ "test" to use test-mode product IDs in the seed; omit for live.
DODO_MODE="test"
DODO_MODE=""

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Keep the example in test mode or make live mode explicit.

apps/supercode-cli/server/prisma/seed.ts:13 treats only "test" as test mode. With DODO_MODE="", a copied example configuration selects the non-test payment branch until an operator changes it. Keep "test" as the safe default, or update the consumer to require an explicit live-mode value.

🧰 Tools
🪛 dotenv-linter (4.0.0)

[warning] 88-88: [QuoteCharacter] The value has quote characters (', ")

(QuoteCharacter)


[warning] 88-88: [UnorderedKey] The DODO_MODE key should go before the DODO_PAYMENTS_API_KEY key

(UnorderedKey)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/supercode-cli/server/.env.example` at line 88, Update the DODO_MODE
example configuration to use "test" as the safe default, matching the test-mode
check in the seed logic. Keep the existing consumer behavior unchanged and
ensure copied example configurations cannot select the live payment branch by
default.

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.

1 participant