#shubhamjha
1 messages · Page 1 of 1 (latest)
Hi there
hloo
This happens because the Subscription is first created in a status of incomplete in order for the Checkout Session to be able to be completed.
Then once the payment is successful the Subscription moves to a status of active
And that causes that webhook to fire
how can i stop it ?
You can't
You just ignore it in your webhook handler
Just return a 200 and don't action that Event
how can i do it please explan
Well what are you doing in your webhook handler right now when customer.subscription.updated fires?
problem is that when i do a payment for new subscription by chekout it will first call customer.subscription.updated and after chekout session complete event
yes
Like in your webhook handler code you can basically just say "do nothing" with the customer.subscription.updated event
why it will call customer.subscription.updated this event when i just need checkout.session.completed even
Because your webhook endpoint is listening for that event
All events will always be sent to your endpoint if it is a type that the endpoint is listening for
but i have use the break for every event
Sure so the event still hits your endpoint but you just don't action it if you call break immediately after receiving that event type
yes