[PR #5818] fix(stripe): handle billing portal cancellation with cancel_at field #14495

Closed
opened 2026-04-13 09:30:19 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/better-auth/better-auth/pull/5818

State: closed
Merged: No


Source: https://docs.stripe.com/billing/subscriptions/cancel

Closes https://github.com/better-auth/better-auth/issues/5780


Summary by cubic

Handle Stripe Billing Portal cancellations that use the cancel_at field. We now treat either cancel_at or cancel_at_period_end as scheduled cancel, persist cancelAtPeriodEnd, and fire onSubscriptionCancel.

  • Bug Fixes
    • In onSubscriptionUpdated, set cancelAtPeriodEnd if cancel_at_period_end is true or cancel_at is present.
    • Trigger onSubscriptionCancel when an active subscription is newly marked as canceled via either field.
    • Added tests for cancel_at, cancel_at_period_end, and both fields to prevent regressions.

Written for commit f42f5a01e4. Summary will update automatically on new commits.

**Original Pull Request:** https://github.com/better-auth/better-auth/pull/5818 **State:** closed **Merged:** No --- Source: https://docs.stripe.com/billing/subscriptions/cancel Closes https://github.com/better-auth/better-auth/issues/5780 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Handle Stripe Billing Portal cancellations that use the cancel_at field. We now treat either cancel_at or cancel_at_period_end as scheduled cancel, persist cancelAtPeriodEnd, and fire onSubscriptionCancel. - **Bug Fixes** - In onSubscriptionUpdated, set cancelAtPeriodEnd if cancel_at_period_end is true or cancel_at is present. - Trigger onSubscriptionCancel when an active subscription is newly marked as canceled via either field. - Added tests for cancel_at, cancel_at_period_end, and both fields to prevent regressions. <sup>Written for commit f42f5a01e46d89890709cb4eff7aef301ec2c35c. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. -->
GiteaMirror added the pull-request label 2026-04-13 09:30:19 -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#14495