#amur0501

1 messages · Page 1 of 1 (latest)

worthy ivyBOT
median vortex
#

Are you providing an idempotency key in the header of the creation requests for those objects? If so, do you have a Request ID for the creation request(s) that prove(s) this?

Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request

worthy ivyBOT
warped forge
#

but then in the following webhook event there is nothing

mortal ember
#

I think this is because there's a separation between those -- your API request with the idempotency key is not what triggers the session completion, thats happening following a user action on teh checkout page

warped forge
#

indeed, so there is no way to have an indempotency key there? like tell stripe to automatically add idempotency keys to the webhook events?

mortal ember
#

No, not as far as I know. Can you explain what you're trying to accomplish?

#

I might be able to offer another way

warped forge
#

I was just thinking of adding an additional check on the idempotency key to make sure that the event won't be processed twice on my side. i guess it's pretty unlikely but lets say if stripe would send the same webhook event twice for some reason

mortal ember
#

Well if we did, it would have the same idempotency ley value too

#

You should use the event ID for this

#

eg, ensure you only process/ingest evt_123 once

warped forge
#

and is the event id going to be different after the webhook event retries?

mortal ember
#

we can and do deliver events more than once sometimes, so its good to be prepared to handle that

#

No, retried delivery is the same event, same ID

warped forge
#

but then lets say in the first try my DB is down so i return an error response, then the retry mechanism sends the event again, but i check if that event has been handled already or not and in this case i will see that i've already handled that event

#

so i'm not gonna handle it again even though i should

mortal ember
#

well that would depend on how/when you record that ingestion, yea

#

but the same issue would apply with an idempotency key value, right?

warped forge
#

yea it would, i thought they would be different for each try

mortal ember
#

Gotcha -- yea that's no how that works, so you'll need to try event ingestion/process by event ID and ensure that handles your edge cases

warped forge
#

Yupp, thanks for the help!