#ledev_webhooks
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1400214127871398021
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- ledev-fou-fou-fou_api, 5 minutes ago, 12 messages
Hello
Looks like you are sending repeated Subscription update requests which are triggering the Events
So you'll need to look at your code for why you are sending a Subscription update request each time you receive the Webhhok (assuming that is what is triggering that code to run?).
Those repeated requests all look like this one: https://dashboard.stripe.com/logs/req_TrGCwA2xn8aTzZ
Which you can see you sent 5 seconds after this previous one that has an identical POST body: https://dashboard.stripe.com/logs/req_Pr8tS1zXyCPlS3
I have the impression that subscription updates when the user wants to unsubscribe at the end of the period are launched in a loop
example :
I opened 10 and all have cancel_at_period_end: true
Sure but that's just because they are set to cancel at the period end... that isn't the reason for a lots of update Events relating to one Subscription. If you look at the top of the Event there you can click on Source to see the actual API request that triggers the Event.
exemple for sub_1RPGZyJsUJztFB3FGbAEXXOe and cus_SJuOeqsMEOWrTs
Yep, click API there
And you can see the actual API request that caused that Event to be generated.
ok but all webhook for the same event ? it' all right ?
Not sure what you mean by that?
Each of those is a different Event, generated due to a different API request.
Right now there is a bug in your integration that you need to find to understand why you are spamming the same Subscription update request.
but it's the same customer who can only have one subscription, he can't generate so much in such a short time, especially since there are a lot of cases, and then you can only use the term cancellation at the end of the period once, then you have to reactivate to cancel again... so impossible with the logs that I see
You are misunderstanding I think.
Ignore the customer and what they are doing.
This is your own code
Somewhere your code is repeatedly sending API requests that are duplicates.
So your next step is to add logs throughout your relevant code to understand where these requests are coming from and why they are getting triggered.
My guess is that you are unintentionally updating a Subscription based on receiving a customer.subscription.updated Webhook. Which then triggers another Webhook (as it creates a new Event) and thus you are in a loop.
So you need to find out why that initial API request is happening, stop it, and then refactor to prevent that in the future (or just remove it if you don't need it).
yet it's the same code for months, and now it's happening... ok I'll look but my script cancels the subscription then reloads the page to display a reactivation button, so I don't really see how it's possible
or is it Apache playing tricks on me?
Yeah sorry I can't tell you why you are sending those API requests to update the Sub which is what is resulting in these Events being generated.
So really the only next step here is to figure that part out!
You too ๐