Stripe Plugin | Webhook Event Failure
Upon testing extensively, it appears the cancellation functionality of the plugin doesn't work at all.


97 Replies
It states that its a 200 request in the actual code, but doesn't set the active status back to no sub
Another isuse, none of the hooks for
works


I've tried multiple things and its still not working
This is happening to me too
can you guys try
1.2.1-beta.4
I tested it and it still doesn't work
what exactly doesn't work?
I cancel the subscription, I receive the webhook (200) but the database does not update and the subscription remains active
1.2.1-beta.5
👀Something went wrong with the typing

I forgot to update best-auth/stripe to 1.2.1-beta.5
However, I still sign and then cancel and do not update the database


when you cancel a sub, it won't be automatically cancelled until the billing period end.
I understand, but when the subscription ends, does Stripe send a webhook?
yeah actually it should have set cancel_at_period_end
let me take a look
ok
Does this support instant sub cancelling on stripe?
I will test it now
That was beta v5, testing v6 now
This is the current status of the problems, checking if i need to update schema
once done that, will let oyu know if it works
Same issue, when triggering it from the stripe dashboard to cancel
It deosn't work at all
@bekacru
am i doing anything wrong here?
also another bug
with the beta versio
admin plugin requires as any
to not throw type errors
going to fix it myself and push it to the github repo
saves you going backc and fourth
If this helps:
the event that is failing
try the last release should fix the stripe issues
Alright, is there any major breaking changes
and do i have to resubscribe to test
no just fixes
Alright, so i can just resend the event through stripe
and it should work
or do i need to resub
yeah it should work without resub
Testing now
give me 2 minutes
found another bug
its creating 2 customers on register now
but im testing subs now
and its also making 2 subs


hmm? so when you signup 2 customers are being created?
Yeah
i can add you to my repo
so you can test it out yourself
if you want
I only need to update better-auth right?
nothing else
no it's fine. but check that you're not doing something 2 times
customers are created through hooks. Unless the hook is called 2 times, it can't happen.
this is my register form
shouldn't be called twice

console shows only 1 register event was called
for sign up there is no event that's handled by better auth
it jsut updates
stripeCustomerId
field
make sure you're on v1.2.1-beta.7
pnpm i [email protected]

im on beta 7
I installed it the minute you released it
So the way im doing it is wrong?
I'm unsure why its throwing 2 customers into the mix
I deleted it manually in stripe + db
to make sure that didnt break it
wait, what is customer?
in the stripe dash
it made 2 customers
there should only be user table and
stripeCustomerId
ohnew database schema?
no. if you had tried better auth before 1.2 release we used to have a
customer
table. never mind.
this is the schema i have
this is correct
Yeah im unsure why its not working then
You know when you're testing, are you using the stripe dash or using the function to cancel it?
as im doing it in the dash to instantly end the sub
both should work
Yeah doesn't work for me, let me make a quick test page
as my subs page is like 700 lines with the design
wait the customer creation should work
I'll completely restart everything
fresh install of db
and let you know
okay thanks!
No worries, about to have it back up with all fresh stuff
gonna use a different email to register too
so a reboot fixed the 2 customer being made issue, im now subscribed

Ahh nvm
found an issue

I just subscribed
and its done this

So when subscribing, its not using the already made customer to make the subscription and also changing the name + making a new customer
upon cancelling still has a ton of issues
so after the first customer is created it should update
user.stripeCustomerId
check that for me.it made a new customer and set the customer id as that
instead of using the already made one
on first registration
on first registration, it'll always make a new cutsomer and updates
stripeCustomerId
yeah i deleted all customers
and then made a new user
and it made another one
with a completely different name
these are all the requests made
and then we have the stipr webhooks
I think we're missing each other somewhere
- whenever a user is created, if customerOnSignUp is enabled, it'll always create a customer on stripe and whenever you try to upgrade a sub, if the user doesn't have
stripeCustomerId
yet it'll also create a new customer.
there should be no reason 2 customers would be created for one user, if they are already assigned stripeCustomerId
in your dbI'm aware, i have the customeronsignup enabled
and I'll make a new user to show you
wait tell me the behavior, what happens when you register as a new user?
So upon registering a new user

It sets the stripe customer id

In the stripe dashboard
as you can see
only 2 customers rn
so this is correct, right?
yeah now, let me sub
to show you what happens
As you can see no subscirption rn


Now im subscribed

This time it didnt' create 2 users
now im canceling in the UI




So now you can see its still active
now let me cancel it in the stripe dash



and boom
same error
oh I think the issue is with immediate cancel
let me check that
Thanks a lot
The thing is
I want immediate cancel support, as i want support for that
so support agents can instantly cut their sub off
you need the event data for instant cancel?
should be fixed now
will test it
Nope @bekacru
is this on
subscription.delete
event?doesn't tell me, testing clearing all cache etc
see if it works
check from the stripe cli webhook logs
just says this
lmao
Makes no sense
as it says
HTTP status code
200
on stripe's end
but in the db
no status changes r made
etc
want access to my repo to see if i done anything wrong?
invited you to the repo
I found out another problem too
this is the prolbem
but in the onSubscriptionDeleted
its not console logging at all

so the issue is the
onSubscriptionDeleted
hook isn't being called?Yeah it should be
I cant even tell
cuz its literally not giving me enough info
i gave u the repo to test it
Yeah latest version has the same issues:
Also:
This doesn't work at all