Skip to content

fix(ui): warn refunds cancel the subscription - #3227

Merged
steebchen merged 1 commit into
mainfrom
claude/self-refund-subscription-warning-orsary
Jul 25, 2026
Merged

steebchen merged 1 commit into
mainfrom
claude/self-refund-subscription-warning-orsary

Conversation

@steebchen

@steebchen steebchen commented Jul 25, 2026 •

Copy link
Copy Markdown
Member

Summary

Refunding a plan payment cancels the Stripe subscription outright — handleChargeRefunded calls subscriptions.cancel(...) on any full refund of a dev/chat plan payment, which ends the plan immediately and wipes the rest of the cycle's credits. The self-refund dialogs either buried that ("your DevPass will be cancelled immediately", as a trailing clause) or never mentioned it at all. This makes the consequence the first thing users read.

Changes

  • DevPass invoices (apps/code/.../DevPassInvoices.tsx) — plan payments now lead with "Refunding cancels your subscription completely", state that the plan ends right away rather than at the end of the billing period, that the cycle's remaining credits are lost, and that resubscribing means starting from scratch. Title changed to "Refund and cancel your DevPass?". Reset Pass copy is unchanged (it does not touch the subscription).
  • Lounge billing history (apps/playground/.../chat-billing-history.tsx) — same warning for chat plan payments, plus a "Keep my membership" cancel action and a "Refund and cancel" confirm action so the destructive path is explicit. Credit top-up copy is unchanged.
  • Org billing transactions (apps/ui/.../billing/transactions-client.tsx) — this dialog rendered credit top-up copy ("N credits will be removed from your balance") for every refundable transaction, including plan payments and Reset Passes, which the endpoint does return here. The copy now branches by transaction type: subscription-cancellation warning for plan payments, pass-specific copy for Reset Passes, existing copy for top-ups. The success toast mentions the cancellation for plan payments too.

Copy-only change; no behavior, API, or eligibility logic touched.

Testing

  • pnpm format
  • turbo run build --filter=ui --filter=playground --filter=code — all pass

Generated by Claude Code

Summary by CodeRabbit

  • New Features

    • Added clearer refund confirmations for DevPass and chat plan payments.
    • Plan refunds now explain that the subscription ends immediately, remaining credits are lost, and a new subscription is required to use the plan again.
    • Updated action labels to distinguish keeping a membership from requesting a refund.
  • Bug Fixes

    • Improved refund processing messages based on the type of transaction.
    • Preserved the existing messaging for Reset Pass refunds and one-time purchases.

Refunding a plan payment cancels the Stripe subscription outright, but
the self-refund dialogs downplayed or omitted it. Spell out that the
subscription ends immediately, the remaining cycle credits are lost, and
resubscribing is required.

Also branch the org billing dialog on the transaction type so plan
payments and Reset Passes no longer get credit top-up copy.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QT99FzP9yQUdM8ii1Y45M7
Copilot AI review requested due to automatic review settings July 25, 2026 11:20

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f51ba3a1-8891-4e19-b1f3-7253a7931e29

📥 Commits

Reviewing files that changed from the base of the PR and between 135776e and 4da9102.

📒 Files selected for processing (3)
  • apps/code/src/app/dashboard/components/DevPassInvoices.tsx
  • apps/playground/src/components/pricing/chat-billing-history.tsx
  • apps/ui/src/components/billing/transactions-client.tsx

Walkthrough

Refund interfaces now recognize DevPass and chat plan transactions, presenting cancellation-specific confirmation, toast, and action-label text while preserving separate messaging for non-plan purchases and Reset Pass refunds.

Changes

Plan refund messaging

Layer / File(s) Summary
Transaction classification and refund flow
apps/ui/src/components/billing/transactions-client.tsx
Plan lifecycle transaction types are classified and used to vary refund toasts, confirmation text, and action labels.
Product-specific refund dialogs
apps/playground/src/components/pricing/chat-billing-history.tsx, apps/code/src/app/dashboard/components/DevPassInvoices.tsx
Chat plan refunds use membership cancellation labels, while DevPass refunds explain immediate cancellation, credit loss, and re-subscription requirements.

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

Possibly related PRs

Suggested reviewers: copilot, smakosh

🚥 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 is concise and accurately reflects the main UI change: refund flows now warn that refunds cancel the subscription.
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
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/self-refund-subscription-warning-orsary

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.

@steebchen
steebchen enabled auto-merge July 25, 2026 11:25
@steebchen
steebchen added this pull request to the merge queue Jul 25, 2026
Merged via the queue into main with commit 07d8141 Jul 25, 2026
12 checks passed
@steebchen
steebchen deleted the claude/self-refund-subscription-warning-orsary branch July 25, 2026 11:43
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.

3 participants