#__leak__

1 messages ยท Page 1 of 1 (latest)

wooden troutBOT
weary latch
#

Hello

digital olive
weary latch
#

Events will always fire and be sent to your Webhook endpoint whenever they occcur. You can't prevent that. What you need to do instead is write code in your Webhook handler to ignore these Events if they are for a new Subscription as opposed to a renewal.

digital olive
#

how can i do that that it only runs the checkout.session.complete when a new user makes a payment

weary latch
#

You look at the data that the customer.subscription.updated Events contain and you ignore ingesting that Event if it is for a new Subscription.

#

For instance, you can use the previous_attributes on the customer.subscription.updated to know why that Event actually fired.

#

And that information will likely be able to tell you whether it was for a new Subscription or a renewal

digital olive
#

ok thank you, i will try it out

weary latch
#

๐Ÿ‘

digital olive
#

when i have a question again with this,do i need to send a new message or can i just write it in this chat

weary latch
#

You can write in this same thread unless it is closed (they get closed after a period of inactivity) in which case you can just post again in the main channel.

digital olive
#

ok