Stripe Idempotency Key Bug

1 votes

I'm having a bug with the Invoiced + Stripe integration. Steps to reproduce:

1. I issued an invoice to a customer that did not have a payment method set up yet.
2. The customer accidentally tried to pay before they verified their ACH bank account.
3. The customer then verified their bank account
4. The customer retried the invoice payment, but it still produces an error that the bank account has not been verified.

I contacted Stripe support and they helped me determine the cause of the issue. It has to do with idempotent requests (https://stripe.com/docs/api/idempotent_requests). Every time the customer tried to pay, it created a POST request to the Stripe API. However, the idempotency key for every single request is the exact same. This means that every subsequent request is retrying the very first request (which returned an error), even though the customer has now verified their account. Stripe's intended use for idempotency keys is to have a unique key for each unique request.

Done Suggested by: Nick Kneupper Upvoted: 07 Aug, '20 Comments: 0

Comments: 0