Skip to content

refactor: remove unused Stripe session handling code#1723

Open
ahmednahima0-beep wants to merge 1 commit intotestfrom
chore/chat-remove-duplicate-subscription-api
Open

refactor: remove unused Stripe session handling code#1723
ahmednahima0-beep wants to merge 1 commit intotestfrom
chore/chat-remove-duplicate-subscription-api

Conversation

@ahmednahima0-beep
Copy link
Copy Markdown
Collaborator

@ahmednahima0-beep ahmednahima0-beep commented Apr 30, 2026

Deleted the createSession API route and its associated helper functions, as well as the client-side checkout session creation logic. This cleanup reduces code complexity and removes dead code related to Stripe session management.

Summary by CodeRabbit

  • Revert
    • Removed Stripe checkout session creation functionality, including the API endpoint and client-side integration for initiating subscription sessions.

Deleted the createSession API route and its associated helper functions, as well as the client-side checkout session creation logic. This cleanup reduces code complexity and removes dead code related to Stripe session management.
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 30, 2026

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

Project Deployment Actions Updated (UTC)
chat Ready Ready Preview Apr 30, 2026 9:45pm

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 30, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1dae5dbc-7cc9-47d2-9a0d-7669e9286196

📥 Commits

Reviewing files that changed from the base of the PR and between 5897f0d and 6041ed6.

📒 Files selected for processing (4)
  • app/api/stripe/session/create/route.ts
  • hooks/useSubscribeClick.ts
  • lib/stripe/createClientCheckoutSession.ts
  • lib/stripe/createSession.ts
💤 Files with no reviewable changes (4)
  • hooks/useSubscribeClick.ts
  • lib/stripe/createSession.ts
  • app/api/stripe/session/create/route.ts
  • lib/stripe/createClientCheckoutSession.ts

📝 Walkthrough

Walkthrough

The pull request removes Stripe checkout session creation functionality from the application, including the API endpoint (app/api/stripe/session/create/route.ts), client-side utilities for initiating checkout (lib/stripe/createClientCheckoutSession.ts, lib/stripe/createSession.ts), and references in the subscription click handler (hooks/useSubscribeClick.ts).

Changes

Cohort / File(s) Summary
Stripe API Endpoint
app/api/stripe/session/create/route.ts
Removed POST handler that created Stripe checkout sessions via the server, including route dynamic caching configuration.
Stripe Utility Functions
lib/stripe/createClientCheckoutSession.ts, lib/stripe/createSession.ts
Deleted functions responsible for initiating checkout sessions on the client-side and creating parameterized Stripe subscription sessions respectively.
Subscription Hook
hooks/useSubscribeClick.ts
Removed createClientCheckoutSession import and its invocation in the subscription click handler logic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🗑️ Stripe sessions swept away,
Checkout flows fade to gray,
Cleaner code adorns the day,
Simple paths now light the way! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Solid & Clean Code ⚠️ Warning Pull request removes critical Stripe checkout functionality without replacement, leaving subscription buttons non-functional and violating SOLID principles and clean code practices. Implement alternative subscription mechanism (Stripe Pricing Table or billing portal) or restore deleted code with migration plan. Update useSubscribeClick to handle unsubscribed case properly with clear user feedback.
✅ Passed checks (2 passed)
Check name Status Explanation
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.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/chat-remove-duplicate-subscription-api

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
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

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

@ahmednahima0-beep ahmednahima0-beep changed the base branch from main to test April 30, 2026 21:45
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6041ed65b0

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines 12 to 14
if (isSubscribed) {
createClientPortalSession(userData.account_id);
return;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Restore checkout flow for unsubscribed users

handleClick now only opens the billing portal when isSubscribed is true, and performs no action for unsubscribed accounts. This breaks both visible upgrade entry points (Start Free Trial and dropdown Subscribe) because they still call this hook, so non-paying users cannot start a Stripe checkout session anymore.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: This is a functional change to the payment/subscription flow, not just dead code removal. It modifies the handleSubscribe hook, which impacts core business logic.

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