r/fintechdev • u/Character_Breath_382 • 7d ago
payment timeout doesn't always mean the payment failed, no?
someone sends a payment, your API request times out, and the app tells them something went wrong and they should try again. Pretty normal UX except the processor might have already accepted the first request, and now you've basically encouraged the customer to pay twice lol.
The annoying part is that a timeout tells almost nothing about whether the money actually moved. Your server stopped waiting for a response, that's it - the transaction could still be processing, already completed, or genuinely failed.
I run Energize Global Services (EGS), my main focus is payment infrastructure side, and IMO failing transactions are kind of thing that makes payment engineering way more complicated than just connecting an API... Ideally you persist the payment reference before submitting anything, handle retries with the same idempotency key where supported, and have some way to recover the actual transaction status when a response or callback goes missing, am I correct here? Want to know how you guys see in from dev side and understand is there any optimal way to solve this type of issue. And yeah, I know showing "still processing" instead of a clear success/failure message isn't exactly great UX.. but telling someone their payment failed when you don't actually know is potentially much-much worse and clients don't like that approach tbh
Kill the connection after submitting a payment, simulate a delayed callback, send the same request twice - thats how we work on it rn, so will be rly grateful for ANY feedback and advice about our method.
1
u/WesternLeg9703 7d ago
The double-charge scenario is real, and your customers will absolutely notice before you do. Persisting the reference before firing off the request is non-negotiable, otherwise you're just blind when the timeout hits.
We leaned hard into idempotency keys and built a reconciliation job that polls the processor's status endpoint whenever a callback goes dark. Showing "still processing" is awkward but it beats issuing a refund because your UI confidently lied about a failure.
1
u/FinexerOfficial 7d ago
That's correct. Timeout should be considered an unknown payment status rather than a failed transaction. With idempotency keys, duplicates are avoided, but you'll have to do status check and reconcile transactions to deal with timeouts or missed callbacks. It's one of the things we take into account when helping our customers implement reliable payment flows via Open Banking APIs.
1
u/a-identity 6d ago
A useful addition is to model this as a payment intent with explicit states, not a boolean success/failure: created → submitted → pending/unknown → succeeded or failed. Create the intent and persist the idempotency key before the processor call; if the client times out, return the same intent/status on retry rather than minting a new charge.
For callbacks, dedupe by processor event ID and make state transitions monotonic so a delayed “processing” event can’t overwrite a settled result. A reconciliation worker can poll by the stored processor reference for intents that stay unknown. Only a confirmed terminal processor state should trigger fulfillment or a retry with a new key.
1
u/OkMud2013 3d ago
Yes, exactly. The timeout just informs you that the payment was not received within the time limit and doesn’t say whether the payment was successful. This is when the payment is duplicated if you try to repeat it without checking the status of the initial payment.
It’s reasonable to use the same idempotency key on retries when it is available and to store the id of the initial payment. It would be better to have some reconciliation procedure for the case when the callbacks are not delivered on time.