[GH-ISSUE #5388] Add Stripe cancel_at to subscription table #18861

Closed
opened 2026-04-15 17:32:54 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @Escapado on GitHub (Oct 17, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/5388

Is this suited for github?

  • Yes, this is suited for github

Hi,

So I am trying to integrate stripe through the better-auth package and it is going great. However I noticed that when the webhook handles the customer.subscription.updated event, if there is a cancel_at present in the update (such as when an auto-renewing subscription is cancelled through the customer billing dashboard), then there is no column to represent that and so the data in the subscription table does not change. We have status but that remains active, we have cancel_at_period_end but that pertains to regular auto-renew and does stay null in this case and period_end which is also just the normal billing end date.

So in a sense, now the application has no idea that the subscription is scheduled to be cancelled by the end of the billing period. In my case I would like to show a message on my billing section my site that informs the user that their subscription is scheduled to be cancelled at the end of their billing period and no auto-renew will happen (and subsequently not show them a cancel button that redirects them to their billing portal).

Describe the solution you'd like

In the @better-auth/stripe package I would like a cancel_at column in the subscription table and I would like the webhook to fill that field accordingly in response to the customer.subscription.updated event and ensure that the authClient.stripe.list({...}) would then return it too.

Describe alternatives you've considered

The current workaround is to add this column in the subscription schema yourself and then add a onSubscriptionUpdate callback in the stripe plugin to do a manual update on the data. I think it would be great if the package could handle that.

Additional context

No response

Originally created by @Escapado on GitHub (Oct 17, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/5388 ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. Hi, So I am trying to integrate stripe through the better-auth package and it is going great. However I noticed that when the webhook handles the `customer.subscription.updated` event, if there is a `cancel_at` present in the update (such as when an auto-renewing subscription is cancelled through the customer billing dashboard), then there is no column to represent that and so the data in the `subscription` table does not change. We have `status` but that remains active, we have `cancel_at_period_end` but that pertains to regular auto-renew and does stay null in this case and `period_end` which is also just the normal billing end date. So in a sense, now the application has no idea that the subscription is scheduled to be cancelled by the end of the billing period. In my case I would like to show a message on my billing section my site that informs the user that their subscription is scheduled to be cancelled at the end of their billing period and no auto-renew will happen (and subsequently not show them a cancel button that redirects them to their billing portal). ### Describe the solution you'd like In the `@better-auth/stripe` package I would like a `cancel_at` column in the subscription table and I would like the webhook to fill that field accordingly in response to the `customer.subscription.updated` event and ensure that the `authClient.stripe.list({...})` would then return it too. ### Describe alternatives you've considered The current workaround is to add this column in the `subscription` schema yourself and then add a `onSubscriptionUpdate` callback in the stripe plugin to do a manual update on the data. I think it would be great if the package could handle that. ### Additional context _No response_
GiteaMirror added the lockedenhancement labels 2026-04-15 17:32:54 -05:00
Author
Owner

@billy-victory commented on GitHub (Oct 21, 2025):

Yeah having the same issue will the cancel_at_period_end be removed and replaced with this?

<!-- gh-comment-id:3425115188 --> @billy-victory commented on GitHub (Oct 21, 2025): Yeah having the same issue will the cancel_at_period_end be removed and replaced with this?
Author
Owner

@kubk commented on GitHub (Oct 29, 2025):

Bump so it gets more attention.

I had to re-configure Stripe to workaround it. It'd be nice if better-auth supported it, since "Cancel at the end of billing period" is default Stripe's behavior for the customer portal

<!-- gh-comment-id:3461280629 --> @kubk commented on GitHub (Oct 29, 2025): Bump so it gets more attention. I had to re-configure Stripe to workaround it. It'd be nice if better-auth supported it, since "Cancel at the end of billing period" is default Stripe's behavior for the customer portal
Author
Owner

@MaxLikesCode commented on GitHub (Dec 11, 2025):

Feature Classic Billing (Basil & Older) Flexible Billing (Clover Default)
Cancellation Field cancel_at_period_end: true cancel_at: 1759104000 (Timestamp)
Portal Behavior Toggles the boolean flag. Calculates the date and sets cancel_at.
Mixed Intervals Not supported. Supported (hence the need for exact dates).

That's why it's absolutely crucial to either replace cancel_at_period_end with cancel_at (since we can derive the cancel_at value from cancel_at_period_end anyway) or add it to the table.

<!-- gh-comment-id:3642035960 --> @MaxLikesCode commented on GitHub (Dec 11, 2025): | Feature | Classic Billing (Basil & Older) | Flexible Billing (Clover Default) | |--------|--------|--------| | Cancellation Field |`cancel_at_period_end: true` |`cancel_at: 1759104000` (Timestamp) | | Portal Behavior | Toggles the boolean flag. | Calculates the date and sets `cancel_at`. | | Mixed Intervals | Not supported. | Supported (hence the need for exact dates). | That's why it's absolutely crucial to either replace `cancel_at_period_end` with `cancel_at` (since we can derive the `cancel_at` value from `cancel_at_period_end` anyway) or add it to the table.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#18861