User can't subscribe again after canceling ( Stripe )
I'm using stripe
basically after subscribing, and cancelling, when the user would want to subscribe again, it's not possible
it looks like there's already a record with referenceId in Subscribtions table with canceled status 
should I remove that record immidietely after user cancels?
or somehow ( dunno how ) get that referenceId and upgade?

20 Replies
@The Untraceable
What error happened when you tried to https://www.better-auth.com/docs/plugins/stripe#restoring-a-canceled-subscription
Stripe | Better Auth
Stripe plugin for Better Auth to manage subscriptions and payments.
"successfully restored subscribtion" but nothing happened
Hold on lemme just double check something


here's my stripe billing portal setting
https://github.com/better-auth/better-auth/blob/canary/packages%2Fstripe%2Fsrc%2Findex.ts#L753-L862 just scanned through this, i dont see anything immediately wrong with it. How do you call that endpoint?
GitHub
better-auth/packages/stripe/src/index.ts at canary · better-auth/b...
The most comprehensive authentication framework for TypeScript - better-auth/better-auth


I can't restore them because cancelAtPerionEnd is false
but that's not the problem
imagine a user that
1. subscribes
2. cancels
3. next month or few months want to subscribe again
he's unable to subscribe again and can't restore it
@The Untraceable any more ideas?
I dont see what you could really do apart from deleting the customer after the subscription. I'm not 100% sure though maybe someone else might know
I thought the same since every data is still in stripe
I'ma delete Subcribtion data after user cancels and see what happens

also that does onSubsciptionDeleted do?
also

something wrong in better auth I guess
because I user can't subscribe even if all previous subscriptions are canceled
@The Untraceable I changed the referenceId to not be @unique
it works but dunno what are the risks of doing that
You're gonna have multiple stripe customers I think not 100% sure
Just make sure if you migrate your DB you make sure you set it back to unique or it'd break things
do you have a public repo with how you do it?
I mean using stripe with better auth
Nah i dont