Menu

Did the customer pay after a payment API timeout?
📰

Did the customer pay after a payment API timeout?

DEV Community: backend·Nilu Mukherjee·6 days ago
#FLSm70nD
#devtobackend#devto#dev#attempt#payment
Long article (305 words) — no AI summary yet.
Reading 0:00
15s threshold

A customer clicks Pay. Five seconds later, your server gives up waiting for the payment provider. The charge may have gone through. The customer is still looking at your checkout screen.

I'd show "We're checking your payment" and give them an order status page they can refresh. Keep the payment attempt pending there until you can confirm what happened.

Reuse the same payment attempt

For order ORD-42 , save payment attempt PAY-7 and its provider idempotency key before you send the charge request. If the customer double-clicks or the request times out, the handler or worker can load that attempt again. If your provider supports idempotent retries, reuse the same key and check how long the provider honors it.

Once the provider confirms a decline, the customer can try another card with a new attempt ID. If the first charge is still unresolved, check its status before starting another attempt.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.