Back to the journal

Your payment flow assumes the card succeeds the first time, and in South Africa it often doesn't

Most checkout flows we inherit were built for a world where a card either works or it doesn't, and if it doesn't the customer simply tries again. That world is not the South African one. Here a transaction can fail for a dozen reasons that have nothing to do with the customer having enough money: a 3D Secure one-time PIN that arrives ninety seconds late over a congested network, an issuing bank that is mid-upgrade, a daily online-spend limit the customer forgot was switched on, or a fraud rule that fires because the customer is on a mobile IP that geolocates to a different province. The default reaction most apps give to all of these is the same blunt red error, and the default customer reaction is to close the tab. If your studio builds anything that takes money, the single highest-leverage thing you can do this quarter is treat a failed first attempt as the start of a conversation rather than the end of one.

The failure is almost never 'insufficient funds'

When a card is declined, your payment gateway returns a response code, and the laziest integration throws away everything except pass or fail. That is where the money leaks. There is a meaningful difference between a hard decline (stolen card, closed account, 'do not honour') and a soft decline (issuer temporarily unreachable, OTP timeout, a velocity or risk rule). A hard decline means stop; retrying it just annoys the bank and can get your merchant account flagged. A soft decline means the exact same card will very likely succeed in thirty seconds. Collapsing the two into one message means you either badger people whose cards will never work, or you give up on people whose cards were one tap away from clearing.

The common mistake is to surface the gateway's raw message to the user. 'Transaction declined by issuer' is technically accurate and completely useless. The customer reads it as 'this shop thinks I have no money', feels embarrassed, and leaves. What you want instead is a mapping layer that groups response codes into a handful of human outcomes with different copy and different next steps. An OTP timeout should say something like 'That verification code expired before we heard back. Let's try that again' with a prominent retry button. A genuine 'do not honour' should gently suggest a different card or payment method rather than inviting a pointless retry.

Design for the OTP that arrives late

3D Secure is where a huge share of local card failures actually happen, and it is the part you control least. The redirect to the bank, the SMS OTP, the entry screen, the return to your site, all of it depends on the customer's connection and the bank's infrastructure at that moment. On a weak signal, the OTP SMS can land after the bank's own entry window has closed, and the customer is bounced back to you having done nothing wrong. If your flow treats that return as a definitive failure and clears the cart, you have punished the customer for your gateway's timeout.

Build the return handler to distinguish an authentication timeout from an actual authentication failure, and keep the order in a pending state rather than destroying it. Preserve the cart, the shipping details, and any entered information so that 'try again' is genuinely one tap and not a fifteen-field re-entry. Where your gateway supports it, consider offering an alternative on the second attempt: a different card, or better, a local method like an instant EFT or a pay-by-link that sidesteps card rails entirely. A customer who has failed 3DS twice is often ready to switch rails, and the business that offers that switch in the same session keeps the sale.

Retries, idempotency and not charging twice

Once you accept that retrying soft declines is the right move, you inherit a new risk: charging someone twice. This happens when the first attempt actually succeeded on the bank's side but the response got lost on the way back to you over a flaky connection, so your system thinks it failed and the customer taps pay again. The protection is an idempotency key, a unique token your client generates once per checkout attempt and sends with every retry of that same purchase. A well-behaved gateway will recognise the repeated key and return the original result instead of creating a second charge. If your current integration generates a fresh reference on every button press, you are one lost response away from a double-billed customer and an angry support thread.

Be deliberate about where retries live. Automatic silent retries belong only on genuinely transient, server-to-server soft declines, and even then with a cap and a short backoff so you don't hammer the issuer. Anything involving the customer, like a fresh OTP, has to be a visible, consented action. Also log the decline code against the order, not just 'failed'. Over a few weeks that log tells you whether your losses cluster around one bank, one time of day, load-shedding windows when connectivity drops, or one specific risk rule you can ask your acquirer to loosen. Without that breakdown you are guessing, and payment problems are expensive to guess about.

The takeaway

Start by auditing what your checkout actually does with a declined card today, and if the answer is 'shows one red error for everything', that is your Monday task. Add a mapping layer that sorts gateway response codes into hard declines, soft declines, and authentication timeouts, each with its own copy and its own next step. Keep failed and pending orders alive with the cart intact so a retry is one tap, never a re-entry. Treat 3D Secure timeouts as recoverable rather than final, and offer a local alternative such as instant EFT or a pay-by-link by the second failed attempt. Generate one idempotency key per checkout attempt and pass it on every retry so a lost success response can never become a double charge. Finally, log every decline code against its order so that within a month you can see exactly where your money is leaking and take that evidence to your acquirer. None of this makes South African card rails more reliable, but it stops their unreliability from being silently passed on to your customer as a lost sale.

A payment that fails is not the same as a customer who cannot pay. Most of the gap between those two is interface and state-handling work, and it is entirely yours to close.

FROM IDEAS TO SOMETHING REAL

Your next chapter.
Let’s build it.

A website, an app, a better way to work. Tell us what you have in mind.

Start a conversation