[PR #4548] [MERGED] fix(stripe): subscription is created without completing payment #5441

Closed
opened 2026-03-13 12:22:52 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4548
Author: @himself65
Created: 9/9/2025
Status: Merged
Merged: 9/10/2025
Merged by: @himself65

Base: canaryHead: himself65/2025/09/09/stripe-sub


📝 Commits (3)

  • c81e647 fix(stripe): subscription is created without completing payment
  • e491b75 fix(stripe): subscription is created without completing payment
  • ee74780 chore: fix

📊 Changes

2 files changed (+103 additions, -9 deletions)

View changed files

📝 packages/stripe/src/index.ts (+38 -9)
📝 packages/stripe/src/stripe.test.ts (+65 -0)

📄 Description

Fixes: https://github.com/better-auth/better-auth/issues/4545

Summary by cubic

Fixes duplicate Stripe subscriptions during upgrade by reusing an existing incomplete subscription and updating its plan/seats, so users finish the same checkout instead of creating new records.

  • Bug Fixes
    • Distinguish active/trialing vs. incomplete subscriptions; keep existing “already subscribed” check for active/trialing.
    • Reuse and update incomplete subscriptions with new plan/seats; only create a new record when none exists.
    • Added test to confirm second upgrade reuses the same incomplete subscription (same id), with updated plan and seats.

🔄 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/4548 **Author:** [@himself65](https://github.com/himself65) **Created:** 9/9/2025 **Status:** ✅ Merged **Merged:** 9/10/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/09/09/stripe-sub` --- ### 📝 Commits (3) - [`c81e647`](https://github.com/better-auth/better-auth/commit/c81e6478c12b476e19dbb41a6a7e64d803e759e6) fix(stripe): subscription is created without completing payment - [`e491b75`](https://github.com/better-auth/better-auth/commit/e491b753ec96cbcdf0ca301ca3270d703e4ccea5) fix(stripe): subscription is created without completing payment - [`ee74780`](https://github.com/better-auth/better-auth/commit/ee747802f6179a31b5251ba37b79fbc9da46524d) chore: fix ### 📊 Changes **2 files changed** (+103 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `packages/stripe/src/index.ts` (+38 -9) 📝 `packages/stripe/src/stripe.test.ts` (+65 -0) </details> ### 📄 Description Fixes: https://github.com/better-auth/better-auth/issues/4545 <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Fixes duplicate Stripe subscriptions during upgrade by reusing an existing incomplete subscription and updating its plan/seats, so users finish the same checkout instead of creating new records. - **Bug Fixes** - Distinguish active/trialing vs. incomplete subscriptions; keep existing “already subscribed” check for active/trialing. - Reuse and update incomplete subscriptions with new plan/seats; only create a new record when none exists. - Added test to confirm second upgrade reuses the same incomplete subscription (same id), with updated plan and seats. <!-- 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-03-13 12:22:52 -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#5441