[PR #7542] [MERGED] fix(stripe): allow billing interval change for same plan #24289

Closed
opened 2026-04-15 22:17:12 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7542
Author: @bytaesu
Created: 1/22/2026
Status: Merged
Merged: 1/22/2026
Merged by: @himself65

Base: canaryHead: 2026-01-22/fix/stripe-billing-interval-change


📝 Commits (4)

  • 838b2e0 fix: allow billing interval change for same plan
  • cbd943d fix: adjust isSamePriceId condition
  • ed0e7fd test: improve test case
  • 754929c test: fix existing tests to handle priceId correctly

📊 Changes

2 files changed (+229 additions, -56 deletions)

View changed files

📝 packages/stripe/src/routes.ts (+36 -53)
📝 packages/stripe/test/stripe.test.ts (+193 -3)

📄 Description


Summary by cubic

Allow switching from monthly to annual on the same plan without the "already subscribed" error. We now compare Stripe price IDs and resolve lookup keys to detect valid interval changes.

  • Bug Fixes
    • Check the subscription item's Stripe price ID and period end; still respects plan and seat checks.
    • Resolve the target price ID (including lookup keys) once and reuse it across the flow.
    • Added tests for monthly→annual upgrade, duplicate prevention, and billing portal using the annual price.

Written for commit 754929cceb. Summary will update on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/7542 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 1/22/2026 **Status:** ✅ Merged **Merged:** 1/22/2026 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `2026-01-22/fix/stripe-billing-interval-change` --- ### 📝 Commits (4) - [`838b2e0`](https://github.com/better-auth/better-auth/commit/838b2e08c148be8bff3b43bc2b238987db1af832) fix: allow billing interval change for same plan - [`cbd943d`](https://github.com/better-auth/better-auth/commit/cbd943d8f95c39ef88e1875cb84017d231a63a04) fix: adjust isSamePriceId condition - [`ed0e7fd`](https://github.com/better-auth/better-auth/commit/ed0e7fddbd32c3650098c2775aa2fa0721482e1a) test: improve test case - [`754929c`](https://github.com/better-auth/better-auth/commit/754929cceb7ac276dee93819164e497ee4e30766) test: fix existing tests to handle priceId correctly ### 📊 Changes **2 files changed** (+229 additions, -56 deletions) <details> <summary>View changed files</summary> 📝 `packages/stripe/src/routes.ts` (+36 -53) 📝 `packages/stripe/test/stripe.test.ts` (+193 -3) </details> ### 📄 Description - Closes https://github.com/better-auth/better-auth/issues/7515 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Allow switching from monthly to annual on the same plan without the "already subscribed" error. We now compare Stripe price IDs and resolve lookup keys to detect valid interval changes. - **Bug Fixes** - Check the subscription item's Stripe price ID and period end; still respects plan and seat checks. - Resolve the target price ID (including lookup keys) once and reuse it across the flow. - Added tests for monthly→annual upgrade, duplicate prevention, and billing portal using the annual price. <sup>Written for commit 754929cceb7ac276dee93819164e497ee4e30766. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-15 22:17:12 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#24289