[PR #8474] [CLOSED] Implement grouped Stripe subscription targeting #24898

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/8474
Author: @hasdfa
Created: 3/7/2026
Status: Closed

Base: mainHead: tunis


📝 Commits (10+)

  • 62a8f16 ci: continue on error
  • 35ab204 docs(expo): update Metro config for Expo SDK 53+ (#8220)
  • 973c5f8 docs: fix release og path
  • 478e9fe docs: fix release image
  • 551d607 docs: use full URL for 1.5 release og image
  • 7eb9022 docs: extract api-key plugin to separate package and update related schema and client SDK references
  • 5451e15 docs: fix sidebar contents from old (#8221)
  • 40ad3fa docs: update 1.5 release notes for api-keys (#8222)
  • 0584e61 docs: re-add razorpay and payu community plugins (#8224)
  • f944e39 docs: fix features component (#8225)

📊 Changes

318 files changed (+38883 additions, -10261 deletions)

View changed files

.claude/agents/cherry-pick-release.md (+184 -0)
📝 .cspell/auth-terms.txt (+1 -0)
📝 .cspell/custom-words.txt (+3 -1)
📝 .cspell/tech-terms.txt (+5 -2)
📝 .cspell/third-party.txt (+2 -0)
.github/workflows/demo.yml (+56 -0)
.github/workflows/npm-dist-tag.yml (+35 -0)
📝 .github/workflows/release.yml (+1 -0)
📝 .gitignore (+1 -0)
📝 .remarkignore (+1 -0)
📝 CLAUDE.md (+13 -2)
📝 CONTRIBUTING.md (+1 -1)
📝 demo/electron/package.json (+10 -10)
demo/electron/pnpm-lock.yaml (+4736 -0)
demo/electron/pnpm-workspace.yaml (+4 -0)
📝 demo/expo/app.config.ts (+0 -4)
📝 demo/expo/metro.config.js (+1 -5)
📝 demo/expo/package.json (+24 -23)
demo/expo/pnpm-lock.yaml (+8625 -0)
demo/expo/pnpm-workspace.yaml (+2 -0)

...and 80 more files

📄 Description

Summary

  • implement real Stripe subscription group support with persisted
  • scope list/cancel/restore and upgrade targeting by while keeping omitted unscoped
  • normalize missing groups to for matching and add compatibility tests for legacy rows and grouped webhook behavior

Details

This proposal turns the existing Stripe field from dead metadata into an actual subscription lane.

Key behavior:

  • one active or trialing subscription per in plugin-managed flows
  • plans without a configured group are treated as for matching
  • omitting in list/cancel/restore remains unscoped across all groups
  • explicit targets legacy rows with no stored group
  • grouped webhook reconciliation updates only the matching lane

Summary by cubic

Adds real support for grouped Stripe subscription lanes, enabling per‑group upgrades and lifecycle actions while preserving legacy behavior for ungrouped plans. Updates Stripe docs to explain group behavior.

  • New Features

    • Group-aware subscriptions: one active or trialing subscription per referenceId per group in plugin-managed flows.
    • Matching rules: plans without a group fall back to a default lane; you can explicitly target ungrouped (legacy) rows when needed.
    • Targeting: list/cancel/restore accept an optional group; omitting group remains unscoped across all groups. Upgrades reuse the active subscription when there’s a single match in the target group.
    • Webhooks: reconciliation is lane-scoped and updates only the matching group.
  • Migration

    • To isolate products, assign groups to your Stripe plans/prices and pass the same group when calling upgrade/list/cancel/restore.
    • No changes required if you don’t use groups; existing behavior stays the same.
    • When operating on legacy ungrouped data, explicitly target the ungrouped lane as needed.

Written for commit c510ad9087. 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/8474 **Author:** [@hasdfa](https://github.com/hasdfa) **Created:** 3/7/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `tunis` --- ### 📝 Commits (10+) - [`62a8f16`](https://github.com/better-auth/better-auth/commit/62a8f165380816424439c24df4c7813adb6c64d7) ci: continue on error - [`35ab204`](https://github.com/better-auth/better-auth/commit/35ab20440093fbee397b57f3da96a434fd3dcedc) docs(expo): update Metro config for Expo SDK 53+ (#8220) - [`973c5f8`](https://github.com/better-auth/better-auth/commit/973c5f8127d515f2d6921ec0d52e097038c517c4) docs: fix release og path - [`478e9fe`](https://github.com/better-auth/better-auth/commit/478e9fe24eb4eb1417e06792497ded1ff2976c81) docs: fix release image - [`551d607`](https://github.com/better-auth/better-auth/commit/551d607bfc13c0b7c93d3487b56b79ac326d6490) docs: use full URL for 1.5 release og image - [`7eb9022`](https://github.com/better-auth/better-auth/commit/7eb9022634b06f369d3f0b208d678cf6d17d94d5) docs: extract api-key plugin to separate package and update related schema and client SDK references - [`5451e15`](https://github.com/better-auth/better-auth/commit/5451e1575b86013a23a9fef20725e44973cd80bc) docs: fix sidebar contents from old (#8221) - [`40ad3fa`](https://github.com/better-auth/better-auth/commit/40ad3fa3c1c22275aeab2ff743b2ac0757ce0cd0) docs: update 1.5 release notes for api-keys (#8222) - [`0584e61`](https://github.com/better-auth/better-auth/commit/0584e61cc5fe47c06e59b02c57faca34d4d5c0a3) docs: re-add razorpay and payu community plugins (#8224) - [`f944e39`](https://github.com/better-auth/better-auth/commit/f944e39d6077701af7af9275faf78d98958fba14) docs: fix features component (#8225) ### 📊 Changes **318 files changed** (+38883 additions, -10261 deletions) <details> <summary>View changed files</summary> ➕ `.claude/agents/cherry-pick-release.md` (+184 -0) 📝 `.cspell/auth-terms.txt` (+1 -0) 📝 `.cspell/custom-words.txt` (+3 -1) 📝 `.cspell/tech-terms.txt` (+5 -2) 📝 `.cspell/third-party.txt` (+2 -0) ➕ `.github/workflows/demo.yml` (+56 -0) ➕ `.github/workflows/npm-dist-tag.yml` (+35 -0) 📝 `.github/workflows/release.yml` (+1 -0) 📝 `.gitignore` (+1 -0) 📝 `.remarkignore` (+1 -0) 📝 `CLAUDE.md` (+13 -2) 📝 `CONTRIBUTING.md` (+1 -1) 📝 `demo/electron/package.json` (+10 -10) ➕ `demo/electron/pnpm-lock.yaml` (+4736 -0) ➕ `demo/electron/pnpm-workspace.yaml` (+4 -0) 📝 `demo/expo/app.config.ts` (+0 -4) 📝 `demo/expo/metro.config.js` (+1 -5) 📝 `demo/expo/package.json` (+24 -23) ➕ `demo/expo/pnpm-lock.yaml` (+8625 -0) ➕ `demo/expo/pnpm-workspace.yaml` (+2 -0) _...and 80 more files_ </details> ### 📄 Description ## Summary - implement real Stripe subscription group support with persisted - scope list/cancel/restore and upgrade targeting by while keeping omitted unscoped - normalize missing groups to for matching and add compatibility tests for legacy rows and grouped webhook behavior ## Details This proposal turns the existing Stripe field from dead metadata into an actual subscription lane. Key behavior: - one active or trialing subscription per in plugin-managed flows - plans without a configured group are treated as for matching - omitting in list/cancel/restore remains unscoped across all groups - explicit targets legacy rows with no stored group - grouped webhook reconciliation updates only the matching lane <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds real support for grouped Stripe subscription lanes, enabling per‑group upgrades and lifecycle actions while preserving legacy behavior for ungrouped plans. Updates Stripe docs to explain group behavior. - **New Features** - Group-aware subscriptions: one active or trialing subscription per referenceId per group in plugin-managed flows. - Matching rules: plans without a group fall back to a default lane; you can explicitly target ungrouped (legacy) rows when needed. - Targeting: list/cancel/restore accept an optional group; omitting group remains unscoped across all groups. Upgrades reuse the active subscription when there’s a single match in the target group. - Webhooks: reconciliation is lane-scoped and updates only the matching group. - **Migration** - To isolate products, assign groups to your Stripe plans/prices and pass the same group when calling upgrade/list/cancel/restore. - No changes required if you don’t use groups; existing behavior stays the same. - When operating on legacy ungrouped data, explicitly target the ungrouped lane as needed. <sup>Written for commit c510ad9087a8b87ca860461473a98d9cf85daf89. 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:37:14 -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#24898