#ubi-error-idempotency

1 messages ยท Page 1 of 1 (latest)

pulsar ginkgoBOT
light drum
#

yes

humble flint
#

I am trying to understand how the Idempotency-Key in case of server failures

#

ah shot ๐Ÿ˜ฆ

light drum
#

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

humble flint
#

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

light drum
#

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

humble flint
#

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 bShrug

light drum
#

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

pulsar ginkgoBOT
humble flint
#

hhhmmm I am kind of following, but I am not

#

I am creating and confirming at the same time btw

light drum
#

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

humble flint
#

Why? Dont get me started .... I want to cry by now! I have learned and redo things for the last week

#

The answer: because sobpike

light drum
#

lol

#

But yeah I wouldn't really overthink it here

humble flint
#

yeah ... just detect double charges and move on honestly

#

maybe do some sessionstorage I guess, reset the key on failure

light drum
#

yep

humble flint
#

thank you anyway, I wish Stripe has some better stuff around this topic

#

Succeed Identity: "course:1235"

#

LOL

light drum
humble flint
#

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

light drum
#

yeah that's fair

humble flint
#

I wasted 3 days because I trusted ChatGPT ...........

#

you need to add ChatGPT trained by you 5Head

light drum
#

๐Ÿ˜…

humble flint
#

Or not, I dont get KEKInsane with people like you

#

actually, I take it back, dont add more stupid robots

light drum
#

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