#ubi-error-idempotency
1 messages ยท Page 1 of 1 (latest)
yes
I am trying to understand how the Idempotency-Key in case of server failures
ah shot ๐ฆ
for 5xx you kind of want to be careful and listen to Events on your webhook endpoint to figure out whether anything happened
like if you create a PaymentIntent and you get a 5xx you want to make sure you didn't get a payment_intent.created Event that you have no record for
I got the payment to work, but just trying to prevent the user nagivating away and my service to be too slow to process the events
another word, eventual consistency
ubi-error-idempotency
yeah I mean if they navigate away it's not a problem, you'd get an Event and then you can send them an email or something
Right well, the click away come back and pay again because my Read-Side hasn't process the event
I guess I can detect duplicate payments 

I mean in that case you can have a session id or order id in your cookie/session and then make sure to re-use the same idempotency key for example
like after the PaymentIntent is created, your server should know about this before they pay client-side
hhhmmm I am kind of following, but I am not
I am creating and confirming at the same time btw
why though lol
but ultimately before you call create, track that you are doing that so that if they come back to this flow you have a record that you were trying to do that
Why? Dont get me started .... I want to cry by now! I have learned and redo things for the last week
The answer: because 
yeah ... just detect double charges and move on honestly
maybe do some sessionstorage I guess, reset the key on failure
yep
thank you anyway, I wish Stripe has some better stuff around this topic
Succeed Identity: "course:1235"
LOL
We do have docs like https://stripe.com/docs/error-low-level
Thank you so much! Definitely you have docs for everyhing
but I need humans to make sense of them because of so much info
aaaaaaand
yeah that's fair
I wasted 3 days because I trusted ChatGPT ...........
you need to add ChatGPT trained by you 
๐
Or not, I dont get
with people like you
actually, I take it back, dont add more stupid robots

hahaha I mean we do hope to add access to AI + docs search in the future, but it needs to be factually correct for it to be helpful