#ares9389
1 messages ยท Page 1 of 1 (latest)
๐ happy to help
๐
I'm not sure what are you trying to avoid here?
duplicate checkouts, if for instance the network was bad and the request wasn't fulfilled it would be automatically retried an hour later than 2 hours after that for a couple of times as far as I know.
I don't want the customer to be charged twice if he starts a new checkout session and the one before becomes valid
I'm not sure I follow to be honest
I've read the and watched the video about https://stripe.com/docs/api/idempotent_requests but it has only been demonstrated with customer creation but not with checkout.
is it only meant for stripe.customers.create ?
best practices https://stripe.com/docs/payments/payment-intents#best-practices
You should also provide an idempotency key when creating the PaymentIntent to avoid erroneously creating duplicate PaymentIntents for the same purchase. This key is typically based on the ID that you associate with the cart or customer session in your application.
it's meant for any request that you initiate
if you're using Checkout Sessions, you shouldn't worry about idempotency
ohhh, great!! thank you ๐