[PR #7221] [MERGED] feat(stripe): add billingInterval field to subscription #15401

Closed
opened 2026-04-13 10:00:59 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7221
Author: @bytaesu
Created: 1/9/2026
Status: Merged
Merged: 2/13/2026
Merged by: @bytaesu

Base: canaryHead: 2026-01-09/feat/stripe-billing-interval


📝 Commits (4)

  • abaaa1b feat(stripe): add billingInterval field to subscription
  • f1a0883 Merge branch 'canary' into 2026-01-09/feat/stripe-billing-interval
  • 1321847 Merge branch 'canary' into 2026-01-09/feat/stripe-billing-interval
  • 20733c5 docs: mixed-interval limitation

📊 Changes

6 files changed (+166 additions, -1 deletions)

View changed files

📝 docs/content/docs/plugins/stripe.mdx (+6 -0)
📝 packages/stripe/src/hooks.ts (+3 -0)
📝 packages/stripe/src/routes.ts (+1 -0)
📝 packages/stripe/src/schema.ts (+4 -0)
📝 packages/stripe/src/types.ts (+11 -0)
📝 packages/stripe/test/stripe.test.ts (+141 -1)

📄 Description


Summary by cubic

Adds billingInterval to subscriptions to track Stripe billing cadence (day/week/month/year) and expose it in API responses. Also updates docs to note Stripe Checkout rejects mixed-interval line items.

  • New Features
    • Persist billingInterval from price.recurring.interval on checkout completion and subscription create/update; include in subscriptionSuccess and subscription.list responses.
    • Add optional billingInterval to the subscriptions schema and Subscription type.
    • Tests verify storing "year" from webhook subscription.created and returning billingInterval via subscription.list().
    • Docs add a callout that all Checkout line items must use the same billing interval.

Written for commit 20733c5862. 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/7221 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 1/9/2026 **Status:** ✅ Merged **Merged:** 2/13/2026 **Merged by:** [@bytaesu](https://github.com/bytaesu) **Base:** `canary` ← **Head:** `2026-01-09/feat/stripe-billing-interval` --- ### 📝 Commits (4) - [`abaaa1b`](https://github.com/better-auth/better-auth/commit/abaaa1b889e91dc563321217b69aedd3d7bf5611) feat(stripe): add billingInterval field to subscription - [`f1a0883`](https://github.com/better-auth/better-auth/commit/f1a0883770b3768f80e8271a657721c01fef1238) Merge branch 'canary' into 2026-01-09/feat/stripe-billing-interval - [`1321847`](https://github.com/better-auth/better-auth/commit/1321847e0f0da8d54115d6ec9912c70885a9f1ac) Merge branch 'canary' into 2026-01-09/feat/stripe-billing-interval - [`20733c5`](https://github.com/better-auth/better-auth/commit/20733c5862ae342a6ffa4b9411277b0f2a659ed0) docs: mixed-interval limitation ### 📊 Changes **6 files changed** (+166 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/stripe.mdx` (+6 -0) 📝 `packages/stripe/src/hooks.ts` (+3 -0) 📝 `packages/stripe/src/routes.ts` (+1 -0) 📝 `packages/stripe/src/schema.ts` (+4 -0) 📝 `packages/stripe/src/types.ts` (+11 -0) 📝 `packages/stripe/test/stripe.test.ts` (+141 -1) </details> ### 📄 Description - Related to https://github.com/better-auth/better-auth/issues/7099#issuecomment-3728862946 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds billingInterval to subscriptions to track Stripe billing cadence (day/week/month/year) and expose it in API responses. Also updates docs to note Stripe Checkout rejects mixed-interval line items. - **New Features** - Persist billingInterval from price.recurring.interval on checkout completion and subscription create/update; include in subscriptionSuccess and subscription.list responses. - Add optional billingInterval to the subscriptions schema and Subscription type. - Tests verify storing "year" from webhook subscription.created and returning billingInterval via subscription.list(). - Docs add a callout that all Checkout line items must use the same billing interval. <sup>Written for commit 20733c5862ae342a6ffa4b9411277b0f2a659ed0. 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-13 10:00:59 -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#15401