on-internet
← Community

Proper implementation of using a idempotency key with another service like stripe

Stack Overflow ·

What is the proper way to handle idempotency in a rails application? I am using devise and need to make sure that each user doesn't get multiple duplicate PaymentIntents for the same purchase. Since the idempotency key needs to be used with each subsequent failed request should it be something saved in the database, session, etc..? Stripe suggests to use idempotency keys to prevent duplicate PaymentIntents for the same purchase: https://stripe.com/docs/payments/payment-intents#best-practices

Comments

Sign in or sign up to comment and upvote.

No comments yet.