#Dan Judge
1 messages · Page 1 of 1 (latest)
Hi! Let me help you with this.
It's not possible to resend events using the API, so you'll need to list and retrieve the events and apply them manually: https://stripe.com/docs/api/events/retrieve
Okay, so I can take this event data and in my script send it to my server, which will perform the actions I need, but how do I then mark them as successful, to stop them coming back the next day when I retrieve any new failed events?
stop them coming back
You mean stopping your script from retrieving them, if they were applied?
Yeah, so I'm using this:
failed_events = stripe.Event.list(created={"gte": events_since_unix}, limit=100, delivery_success=False)
Let's say there was a failed event on Sunday, the server boots Monday, runs the above, finds the failed event, I manually repost it to my server, then another webhook fired Monday night at 8pm, Tuesday morning comes, the above runs, it would then get the Sunday event again, but I've already resent that, or actually, I think my script gets events gte to 7pm the previous day unless it's a weekend, so I think I've answered my own question, ha!
Thanks for your help.
Happy to help. Please, let me know if you have any other questions.