How many customers want to pay, and my shop still loses the order? Declined payments, false declines and soft declines
TL;DR
Difficulty: Intermediate
Customers who are declined at the payment step have already decided to buy, and most shops never see them.
- Measure the checkout success rate at the payment step, not only the provider's authorisation rate: in the example 1,980 of 2,150 checkouts (92.1%) end in an order.
- Of the 170 lost checkouts, only 40 are hard declines. 130 are soft declines, abandoned or failed 3D Secure challenges and technical errors.
- Better data, exemptions that are allowed to work, one safe retry for technical failures, a second way to pay inside the error, clear messages and a basket that survives recover 52 orders a month, £12,393 a year in contribution.
- Record every attempt with its decline and advice code, and repeat a half hour check every quarter.
What to read first
A customer has chosen the products, the address and the delivery, presses Pay, and the payment fails. No report counts that lost order. This chapter shows who declines a payment and why, which declines a shop can win back, and how to measure and fix the leak in a Rails and Solidus shop.
The order that was already won
A customer has found the lamp, put it in the basket, typed in the delivery address and chosen a delivery slot. They press "Pay". Then the page says the payment did not go through, and a few seconds later they are gone.
Every marketing report counts that person as a success. They clicked an advert, they browsed, they reached checkout. Yet no order exists, no money arrived, and nobody at the shop ever hears about it. This is the quietest leak in eCommerce, because it happens after the hardest part of selling is already done.
This chapter answers one question: how many customers want to pay, and my shop still loses the order? You will learn how a card payment is approved or declined, what the authorisation rate is and why almost no shop knows its own, which declines are final and which are not, what a false decline is, and what a shop can actually change: strong authentication done properly, retries within the card networks' rules, saved cards that stay valid, the right second way to pay, error messages that keep the customer, and a basket that survives the failure. Then you will find the leak in your own data, with SQL against a Solidus database and a small Rails subscriber that records every attempt, and you will put a number on it.
It builds on the map of quiet leaks in the first chapter of this series, which ranks this leak among the others. Where this chapter mentions conversion before the payment step, the chapter on the eCommerce funnel covers it. This chapter starts at the moment the customer has decided.
Example: Priya's 170 missing orders
The example for the whole series is Wrenfield Home, an online homeware shop in Leeds (wrenfieldhome.example) run by Priya, with Callum as her developer and data engineer. It sells about 1,400 products, has 110,000 sessions and 1,980 orders a month at an average order value of £72 including VAT. Each order leaves a contribution of £19.86 before marketing, worked out line by line in the chapter on contribution margin per order. The shop runs on Ruby on Rails and Solidus with PostgreSQL, and takes cards and wallets through Stripe and PayPal.
In June, 2,150 checkouts reached the payment step. 1,980 of them ended in an order. That is 92.1%, and Priya had never seen the figure before Callum worked it out. The other 170 checkouts ended without an order, although the customer had already chosen what to buy, where to send it and how to pay.
Of those 170, Callum's analysis later in this chapter shows that 40 were declines the shop could never have turned round: suspected fraud, no money on the card, a card that was simply invalid. The other 130 were recoverable: soft declines from the customer's bank, authentication steps that were abandoned or failed, and technical errors. With the fixes described below, Wrenfield Home recovers 40% of those 130, which is 52 orders a month. At £19.86 each, that is worth £12,393 a year in contribution. Every figure here is the invented example's, and the rest of the chapter shows where each one comes from.
What happens in the two seconds after "Pay"
To fix a decline you need to know who said no. A card payment online passes through five parties, and only one of them is the shop.
- The shop collects the card details (or, more often today, lets the payment provider's form collect them) and asks for the money.
- The payment provider, Stripe in the example, packages the request and sends it on. Its form also runs the authentication step when one is needed.
- The acquirer is the bank or licensed firm that accepts card payments on the shop's behalf and settles the money into the shop's account. With a provider like Stripe the shop rarely sees it as a separate party.
- The card network, Visa, Mastercard or American Express, carries the message between the acquirer and the bank that issued the card, and sets the rules all parties follow.
- The issuer is the customer's own bank. It decides. It looks at the card, the account balance, the customer's habits, the shop, the amount and the data that came with the request, and answers yes or no in well under a second.
The answer is called an authorisation. An approved authorisation reserves the money on the customer's card. Taking the money is a second step called capture, which Solidus can do at once or later, for example when the parcel ships. A decline comes back with a reason code, and that code is the most useful piece of data in this chapter.
Before the issuer decides, it may ask the customer to prove they are the cardholder: a confirmation in the banking app, a code by text message, a fingerprint. That step is 3D Secure, the card networks' authentication protocol, and in the UK and the European Economic Area (EEA) it is how strong customer authentication is usually done for cards. If the issuer is satisfied from the data alone, the customer never sees a thing. That is called the frictionless flow. If the issuer wants proof, the customer gets a challenge.
Example: one £72 order on its way to the bank
Priya's customer in Bristol orders a table lamp and two cushions for £72 and pays with a debit card. Callum's Solidus checkout hands the payment to Stripe's form on the payment step. Stripe sends the request through its acquiring side to Visa, and Visa routes it to the customer's bank.
The bank looks at the request. The card is a year old, the customer has bought online many times, the billing postcode matches, and the amount is ordinary. It approves without a challenge. Stripe tells Solidus, the payment moves to completed, and the order is placed. The whole journey took about two seconds.
Change one detail and the result changes. If the same customer had moved house and typed the old billing postcode, the bank might have asked for a challenge in the app. If they were on a train with no signal, the challenge would time out. Nothing would be wrong with the card, the customer or the shop, and the order would still be lost.
The authorisation rate, and why almost no shop knows its own
The authorisation rate is the share of payment attempts the issuers approve. It sounds like a number every shop would watch. Almost none do, for three reasons.
First, the shop's own reports start at the order. A checkout that ended in a decline never becomes an order, so it never appears in the sales report, the analytics revenue or the accounting. Second, the payment provider shows the number, but it sits in a dashboard the owner rarely opens, and it counts attempts, not customers. Third, it is easy to measure the wrong thing, because one customer can make several attempts.
That last point matters, so it is worth two definitions.
is the authorisation rate, is the number of payment attempts the issuers approved, and is the number of attempts sent to the issuers. This is the provider's view. It tells you how the banks treat your payments. Foundations: ratios and rates explains ratios like this one from scratch.
is the payment success rate of the checkout, is the number of checkouts that ended in an order, and is the number of checkouts that reached the payment step. This is the customer's view, and it is the one that pays the bills. The same Foundations section on ratios and rates covers it.
The two rates move differently. If a customer is declined twice and succeeds on the third try, the authorisation rate counts two failures and the checkout counts a success. A shop that only looks at panics about declines that cost nothing. A shop that only looks at misses that customers are fighting their way through.
Example: two rates for the same month
In June, Wrenfield Home's 2,150 checkouts at the payment step produced 2,390 payment attempts, because some customers tried a second card or tried the same card again. This attempt count is an invented figure for the example. The issuers approved 1,980 attempts, one for each order.
So of attempts were approved. That looks alarming.
So of checkouts ended in an order. That looks reassuring. Both are true. The 240 extra attempts () are customers who were declined and tried again, and many of them succeeded. The 170 checkouts that never became orders () are the leak. From here on, this chapter counts checkouts, because a lost checkout is a lost order.
Hard declines, soft declines and the ones in between
When an issuer says no, it sends a reason. Card networks use short numeric codes, and payment providers translate them into readable ones. Stripe returns a decline code such as insufficient_funds or do_not_honor, the raw network decline code, and an advice code that tells the shop what to do next: do_not_try_again, try_again_later or confirm_card_data.1 Mastercard calls its advice codes Merchant Advice Codes.
Declines fall into two broad families.
- Hard declines will not change if you ask again. The card is reported lost or stolen, the account is closed, the card number is invalid, the issuer suspects fraud. Retrying is pointless and, as a later section shows, can cost money.
- Soft declines might change. The bank could not be reached, the issuer wants authentication first, the attempt tripped a temporary limit, or the bank declined for a reason it does not share. A second attempt, a different moment or a different method can succeed.
The trouble is the large middle. Stripe's own documentation notes that issuers categorise most declines as generic, so the exact reason stays unclear, and that issuers discuss the specifics only with their own cardholders.2 generic_decline and do_not_honor cover everything from real fraud to a bank's model being nervous about a shop it has not seen before.
| Decline code (Stripe) | What it means | Family | What the shop can do |
|---|---|---|---|
insufficient_funds | Not enough money or credit on the card | Hard for this attempt | Offer another way to pay, such as PayPal or pay later |
fraudulent, stolen_card, lost_card | Suspected fraud, or a card reported stolen or lost | Hard | Show the same message as a generic decline, nothing more |
incorrect_number, incorrect_cvc, expired_card | The details typed in do not match | Fixable by the customer | Ask them to check the details or use another card |
generic_decline, do_not_honor | Declined, reason not shared | Usually soft | Clear message, a second way to pay, better data next time |
authentication_required | The issuer wants strong authentication | Soft | Run the 3D Secure step and let the customer finish it |
issuer_not_available, processing_error | The bank or a system could not be reached | Soft | Try once more, then ask the customer |
The table follows Stripe's published list of decline codes and its next steps for each.1 Other providers use their own names for the same network codes, and the logic carries over.
Example: Wrenfield Home's 170 failures by reason
Callum groups the 170 checkouts that ended without an order by the last reason recorded for each. All counts are the example's.
- Hard, 40: 14 suspected fraud or cards reported lost or stolen, 16 insufficient funds, 10 card details that were wrong and never corrected.
- Soft declines from the issuer, 62: mostly
generic_declineanddo_not_honor, a fewtry_again_later. - Authentication, 48: 31 customers abandoned the 3D Secure challenge, 17 failed it.
- Technical, 20: 12 timeouts between the shop and the provider, 8
issuer_not_availableorprocessing_error.
The 40 hard declines are 23.5% of the failures (). The 130 in the other three groups are 76.5%. That split is the first surprise for most owners: three quarters of the lost checkouts were not the customer's card being bad.
False declines: the good customer the bank turned away
A false decline is a payment the issuer declined although the customer was the genuine cardholder with every intention of paying. From the issuer's side it looked risky. From the shop's side it was a sale.
Issuers are cautious for a reason. In the 2025 report on payment fraud by the European Banking Authority (EBA) and the European Central Bank (ECB), remote card payments made up around 83% of all card fraud in the EEA in 2024, although they were only around 28% of the value of card transactions. The fraud rate for remote card payments was 0.091% of value, against 0.007% at the till.3 In the UK, UK Finance reported that remote purchase fraud cases rose by 22% in 2024 to nearly 2.6 million, with losses of just under £400 million.4 A bank that sees those numbers tunes its models to say no when in doubt, and online shops pay for that doubt in declined good customers.
How many declines are false? Nobody publishes an independent, measured answer. Issuers do not reveal it, and the figures that circulate come mostly from vendors selling fraud tools, which makes them marketing, not measurement. I leave them out. What is published is what customers say: in Baymard Institute's survey of reasons for abandoning a checkout, 10% of those who abandoned named a declined card.5 That is a share of abandoners, not of payments, but it tells you the problem is common enough for shoppers to remember it.
The honest approach is to estimate your own false declines from your own data, using signals that a declined customer was probably genuine.
Example: were the 62 soft declines good customers?
Callum takes the 62 checkouts that ended in a soft decline and checks three signals in the Solidus database for each: did the same customer account or email have an earlier paid order, did the delivery address match an earlier delivered order, and did the customer come back and pay within seven days? All counts below are invented for the example.
- 44 of the 62 belonged to customers with at least one earlier paid order at the same address.
- 19 of those 44 came back within seven days and paid, often with PayPal.
- 25 of those 44 never came back.
44 out of 62 is 71% of the soft declines coming from people the shop already knew and had already been paid by. These are not fraudsters. They are regular customers whose bank hesitated. The 25 who never came back are the clearest picture of a false decline the shop can get, and they are worth more than an average new customer, because they had already bought before.
This does not prove that every soft decline was false. It shows where to look, and it gives Priya a reason to care: the leak is mostly her best customers.
Strong customer authentication and 3D Secure, done right
Strong customer authentication is the legal requirement that a payer proves who they are with two independent things: something they know (a PIN or password), something they have (a phone or card) or something they are (a fingerprint or face). In the UK, regulation 100 of the Payment Services Regulations 2017 requires the payment service provider to apply it when a payer initiates an electronic payment, and to link the authentication dynamically to the amount and the payee for remote payments.6 The detailed rules, including the exemptions, sit in the Financial Conduct Authority's (FCA) technical standards on strong customer authentication, which the FCA has amended since Brexit, most recently by an instrument in force from 19 March 2026.7 This chapter is general information about how these rules affect a shop, not legal advice.
Notice who the law addresses: the payment service providers, mostly the issuer. The shop does not authenticate anyone. What the shop controls is how well its checkout carries the authentication step, and how much data it sends so the issuer can decide without a challenge.
Exemptions: when the issuer may skip the challenge
The rules allow some payments without strong authentication. Two matter most for a shop.
- Low value. Stripe's documentation gives the UK limit as under £25 a payment, but the issuer may still ask once the payments since the last authentication exceed £85 in total or number five.8
- Transaction risk analysis. The payment provider or issuer may exempt a payment it judges low risk in real time, if its own fraud rate stays below set thresholds. Stripe lists 0.13% for payments up to £85, 0.06% up to £220 and 0.01% up to £440, and says UK merchants currently have access to this exemption up to £220.8
Two warnings come with exemptions. The issuer can always refuse the exemption and ask for authentication anyway, so the checkout must be able to run the challenge every time. And when an exemption is granted, the shop loses the liability shift: a payment authenticated with 3D Secure that is later disputed as fraud usually becomes the issuer's problem, an exempted one stays the shop's.9 Exemptions trade a smoother checkout for a little more fraud risk. For a shop with low fraud and ordinary baskets, that trade is usually worth it.
Why customers abandon the challenge
3D Secure in its current version supports the frictionless flow, where the issuer decides from data alone, and the challenge flow, where the customer must act.10 The challenge is where checkouts die. The customer has to leave the page, open the banking app, find the notification, confirm, and come back. Every step is a chance to lose them: the app is not installed on this phone, the notification never arrives, the session times out, the challenge opens in a small window a phone browser hides, or the customer simply does not understand what is happening.
What the shop can change:
- Send rich data. The more the issuer knows, the more often it decides without a challenge. Full billing address, email, phone number and the customer's account history all help. Stripe's form sends device data on its own, and the shop's job is to pass the rest.
- Let the provider request exemptions. With Stripe, the provider requests applicable exemptions on the shop's behalf. Check that it is switched on and that your fraud settings do not force a challenge on every payment.
- Keep the challenge inside the checkout. Use the provider's current form, which shows the challenge in the page, not a pop up a phone blocks.
- Explain it in one line. "Your bank may ask you to confirm this payment in its app" before the button turns surprise into a routine step.
- Offer wallets. With Apple Pay, for example, the customer authorises the payment on their own device with biometrics or the device passcode, as Apple's security guide describes,11 which is usually quicker than a bank challenge.
Example: the 48 failed authentications
Of Wrenfield Home's 48 checkouts lost at authentication, 31 were abandoned challenges and 17 failed ones. Callum checks the setup and finds three problems, all invented for the example: the checkout did not pass the customer's phone number to Stripe, a custom fraud rule asked for 3D Secure on every payment above £50, and the payment step showed no word about the bank's app.
The average order of £72 is above the £25 low value limit, so that exemption rarely applies. It is well below the £220 limit for transaction risk analysis, so most of Priya's orders are candidates for an exemption, if the custom rule stops forcing a challenge. Callum removes the rule, passes the phone number and the full billing address, and Priya adds one line of copy above the button.
The result after the change: 19 of the 48 lost checkouts are recovered each month. Some because the issuer no longer challenges, some because customers now finish the challenge. That is a recovery of in this group.
Retrying a soft decline without breaking the network rules
The obvious fix for a soft decline is to try again. The card networks know this, and they limit it, because a stream of retries on the same card looks like a fraudster testing numbers.
The rules differ by network and change from time to time, so the safest source is your payment provider. PayPal's guide for merchants, dated May 2026, summarises them like this: Visa groups its decline codes into four categories and allows no retries at all after a category 1 decline, the kind where the issuer will never approve, and up to 20 retries in 30 days after the softer categories. Mastercard bars further attempts on the same card after certain hard decline codes, is introducing a fee after 10 retries in 24 hours on soft declines, and charges a fee when a merchant retries after a decline that came with Merchant Advice Code 03 or 21.12 Stripe, more cautious, recommends no more than eight retries for charges that permit retries at all, and warns that issuers may read extra retries as possible fraud, which can raise declines for legitimate charges too.2
For a checkout, where the customer is present, these limits are rarely the problem. The problem is retrying the wrong declines. The rule of thumb:
- Never retry when the advice code says
do_not_try_again, or the code is a hard one. Offer another way to pay. - Retry once, automatically, only for technical failures: a timeout,
issuer_not_available,processing_error. Wait a moment first. - Ask the customer for everything else: check the details, finish the authentication, or choose another method.
One technical detail protects the customer's money. When a request to the provider times out, the shop does not know whether the payment went through. Sending it again could charge the customer twice. Stripe solves this with idempotency keys: the shop sends a unique key with each request, and if it repeats the request with the same key, Stripe returns the result of the first one instead of performing the operation again.13 Any server side retry must reuse the key.
Example: Callum's decline policy, test first
Callum writes the rule as a small Ruby object, and because I work test first, the tests come before the code. They pin the three behaviours that matter most.
# spec/services/decline_policy_spec.rb
require "rails_helper"
RSpec.describe DeclinePolicy do
it "never retries a card the issuer marked do not try again" do
result = described_class.for(decline_code: "do_not_honor", advice_code: "do_not_try_again")
expect(result.action).to eq(:offer_other_method)
end
it "never tells the customer that a card was reported stolen" do
result = described_class.for(decline_code: "stolen_card", advice_code: nil)
expect(result.message_key).to eq(:generic)
end
it "retries an unreachable issuer exactly once" do
result = described_class.for(decline_code: "issuer_not_available", advice_code: "try_again_later")
expect(result.action).to eq(:retry_once)
end
it "asks the customer to check a mistyped card number" do
result = described_class.for(decline_code: "incorrect_number", advice_code: "confirm_card_data")
expect(result.action).to eq(:ask_to_check)
end
end
Then the code that makes them pass. Data.define creates a small immutable value object and needs Ruby 3.2 or later, which Rails 8 requires anyway.
# app/services/decline_policy.rb
class DeclinePolicy
Result = Data.define(:action, :message_key)
# Codes whose real reason must never be shown to the customer
CONCEAL = %w[fraudulent stolen_card lost_card pickup_card merchant_blacklist].freeze
# Temporary failures where one automatic retry is reasonable
RETRY_ONCE = %w[issuer_not_available processing_error reenter_transaction].freeze
# Details the customer can correct
CHECK_DETAILS = %w[incorrect_number incorrect_cvc invalid_expiry_month
invalid_expiry_year incorrect_zip expired_card].freeze
def self.for(decline_code:, advice_code:)
if advice_code == "do_not_try_again" || CONCEAL.include?(decline_code)
Result.new(action: :offer_other_method, message_key: :generic)
elsif RETRY_ONCE.include?(decline_code)
Result.new(action: :retry_once, message_key: :bank_busy)
elsif advice_code == "confirm_card_data" || CHECK_DETAILS.include?(decline_code)
Result.new(action: :ask_to_check, message_key: :check_details)
else
Result.new(action: :offer_other_method, message_key: :generic)
end
end
end
The order of the branches is deliberate. The concealment check comes first, so a stolen card can never fall through to a branch with a more specific message. Everything unknown ends in the safest place: a clear generic message and a second way to pay. Callum's change for the 20 technical failures is one automatic retry for the temporary codes, with the same idempotency key on any server side request, plus a longer timeout on the shop's side. It recovers 8 of the 20 a month, 40% of the group.
Saved cards that stay valid: network tokens
Returning customers often pay with a card saved in their account. Saved cards decline for a reason that has nothing to do with money: the card was replaced. It expired, or the bank reissued it after a fraud scare, and the stored number and expiry date are no longer valid.
Network tokens address this. Instead of storing the card number, the provider stores a token issued by the card network for this shop, and the network keeps it current when the underlying card changes. Stripe describes network tokens as working with Visa, Mastercard and American Express to replace card numbers for online payments, and keeping them current even when the card data changes.14 Card account updater services, run by the networks, do a similar job for stored card numbers. For one off purchases the effect is modest. For subscriptions it is large, and the later chapter on expired cards and failed renewals goes into it in depth. Moving saved cards between providers without losing them is covered in the article on migrating payment tokens and saved cards, and what card storage means for your compliance scope in the article on PCI DSS.
Example: nine saved cards that had been replaced
Among the 62 soft declines, Callum finds 9 payments with a saved card whose stored expiry date had already passed or whose bank had reissued the card. The customer saw "declined" and had no idea why. All counts are the example's.
Stripe's network tokens and card account updater are available on Priya's account, but saved cards were collected years ago through an old integration. Callum checks that new cards are saved through the current Payment Intents flow, and adds one change to the checkout: when a saved card declines, the payment step opens the card form straight away with the message "Your saved card may have been replaced by your bank. Add the new one and it will be saved for next time." Most of these nine customers simply add the new card.
A second way to pay, offered at the right moment
Some declines cannot be rescued on the same card. Insufficient funds is the clearest case. Stripe's own advice for that decline is to consider offering a buy now, pay later option.2 The same is true for an unclear soft decline: the customer may have a second card, a PayPal account or a wallet on their phone that their bank treats differently.
The leak here is often a design one. The checkout shows the decline, and the customer has to find the other methods themselves, often by going back a step. A better checkout shows the alternatives right inside the error, with the basket and the address kept. For a UK shop that usually means cards, Apple Pay and Google Pay, PayPal and, where the margin allows its fees, a pay later option such as Klarna. Each method has its own fees, which the later chapter on payment fees and payouts weighs against the orders it wins.
Example: the second way to pay recovers soft declines
After Callum's change, a soft decline at Wrenfield Home shows the message, keeps the basket and the address, and puts PayPal and the wallet buttons directly underneath. Together with the richer data and the help for replaced saved cards, the soft decline group improves: of the 62 soft declines a month, 25 now end in an order, a recovery of . These counts are the example's.
The 16 customers with insufficient funds are counted as hard declines and stay out of the recovery figure, although some of them now pay with PayPal or pay later. Any of those orders are a bonus on top of the £12,393, not part of it.
Error messages that keep the customer
A decline message has two readers: the customer, who wants to know what to do, and a possible fraudster, who wants to know what worked. Stripe's guidance settles the conflict: for fraudulent, stolen_card and lost_card, do not report the specific reason, and present it like a generic decline.1 For everything the customer can fix, be specific.
Good decline copy follows the style rules for any error: say what happened, say what to do next, never blame. It also says the one thing an anxious customer wants to know, which is whether money has left their account.
| Situation | Message on the payment step |
|---|---|
| Generic, fraud or unknown | "Your bank didn't approve this payment, so nothing has been taken. Your basket is saved. You can try another card, PayPal or Apple Pay." |
| Details to check | "The card number, expiry date or security code doesn't match. Please check them and try again." |
| Bank not reachable | "Your bank didn't answer in time. Trying once more now." |
| Authentication not finished | "Your bank needs you to confirm this payment in its app. Your basket is saved, so you can confirm and carry on." |
Example: the old message and the new one
Before the change, every decline at Wrenfield Home showed the same text from the payment form's default: "Your card was declined." No word on what happened to the money, no hint of another method, and on a phone the payment buttons were above the message and out of sight.
The new messages above replaced it. Priya reads each one aloud before it goes live, which is the simplest test of whether it sounds like a person. The message for the generic case does most of the work, because generic declines are the largest group.
Keep the basket when the payment fails
A failed payment should never cost the customer their basket, their address or their delivery choice. In Solidus it does not by default: the order stays in the payment state of the checkout, with its line items and addresses, and the customer can try again. The default checkout flow goes through address, delivery, payment and confirm, and the payment step only appears when a payment is required.15
Where baskets get lost is in customisations: a custom front end that clears the session on error, a checkout that redirects to the basket page after a failure, or a guest checkout that does not keep the order when the customer leaves and comes back. The test is simple. Decline a payment on purpose in staging, then close the tab and come back from the same device. If the basket, address and delivery choice are not all still there, that is part of the leak.
Example: what Callum found in staging
Callum runs the test with Stripe's test cards, which return specific declines on purpose, such as 4000000000000002 for a generic decline and 4000000000009995 for insufficient funds.16 On desktop everything survives. On the shop's mobile layout, a failed payment sends the customer back to the basket page, and the delivery slot has to be chosen again. It is a small thing, invented for the example, and it explains part of why the soft decline group lost so many customers on phones. He fixes it in the same release.
Finding the leak in your own data
You can measure all of this with three sources: the payment provider's reports, the shop's own database, and a small table that records every attempt.
The payment provider's reports
Stripe shows declines and their reasons in its Dashboard, and suggests excluding repeat attempts by looking at the card's fingerprint rather than the charge, because one customer can make several attempts.2 PayPal shows declined and abandoned payments in its activity reports. These views are good for the reasons behind declines. They are poor for the checkout view, because the provider does not know which attempts belonged to the same checkout or which customer finally paid by another method.
The Solidus database: how many checkouts reach the payment step
Solidus records every state change of an order in the spree_state_changes table, with the previous and the next state.17 An order that moved into the payment state reached the payment step. An order with a completed_at date became an order. That gives the checkout success rate directly.
-- PostgreSQL. Checkouts that reached the payment step in June 2026,
-- and how many of them became an order.
WITH reached_payment AS (
SELECT DISTINCT sc.stateful_id AS order_id
FROM spree_state_changes sc
WHERE sc.stateful_type = 'Spree::Order'
AND sc.next_state = 'payment'
AND sc.created_at >= '2026-06-01'
AND sc.created_at < '2026-07-01'
)
SELECT
count(*) AS checkouts_at_payment,
count(*) FILTER (WHERE o.completed_at IS NOT NULL) AS orders,
round(100.0 * count(*) FILTER (WHERE o.completed_at IS NOT NULL) / count(*), 1) AS success_pct
FROM reached_payment rp
JOIN spree_orders o ON o.id = rp.order_id
WHERE o.email NOT ILIKE '%@wrenfieldhome.example'; -- leave out staff test orders
| checkouts_at_payment | orders | success_pct |
|---|---|---|
| 2150 | 1980 | 92.1 |
The filter on the email removes the shop's own test and staff orders, about 40 a year in the example's data, which would otherwise count as checkouts. An order that reached payment in June and completed in early July still counts as an order, which is what you want.
The Solidus database: what happened to each payment
The spree_payments table holds one row per payment with a state. A payment starts in checkout and can move to processing, pending, completed, failed, void or invalid.18 With the official Stripe extension, solidus_stripe, the payment's response_code holds the ID of the Stripe PaymentIntent, and a failed payment intent webhook marks the Solidus payment as failed.19
-- PostgreSQL. Payment states by payment method, June 2026.
SELECT pm.name AS payment_method, p.state, count(*) AS payments
FROM spree_payments p
JOIN spree_payment_methods pm ON pm.id = p.payment_method_id
WHERE p.created_at >= '2026-06-01' AND p.created_at < '2026-07-01'
GROUP BY pm.name, p.state
ORDER BY pm.name, p.state;
This shows how many payments failed per method. It does not show why. The webhook that marks a payment as failed fires once per payment, and the Solidus log entry it writes does not keep the decline code. One PaymentIntent can also hold several attempts. For the reasons, you need every attempt.
Recording every attempt
Callum adds a table for payment attempts and fills it from Stripe's webhooks. The solidus_stripe extension publishes each Stripe webhook it is configured for on Solidus's event bus, with the original Stripe name prefixed by stripe., and lets the shop add its own subscribers.19 The charge object Stripe sends carries the outcome of each attempt: the network status, the type (authorized, issuer_declined, blocked and so on), the reason, the advice code, the network's own decline code, and the card's brand, country and funding type.20
# db/migrate/20260702090000_create_payment_attempts.rb
class CreatePaymentAttempts < ActiveRecord::Migration[8.0]
def change
create_table :payment_attempts do |t|
t.integer :order_id, index: true
t.string :stripe_charge_id, null: false, index: { unique: true }
t.string :stripe_payment_intent_id, index: true
t.string :status, null: false # succeeded or failed
t.string :outcome_type # authorized, issuer_declined, blocked, invalid
t.string :network_status
t.string :decline_code # outcome.reason, for example do_not_honor
t.string :advice_code # do_not_try_again, try_again_later, confirm_card_data
t.string :network_decline_code
t.string :card_brand
t.string :card_country, limit: 2
t.string :card_funding
t.integer :amount_minor, null: false
t.string :currency, limit: 3
t.datetime :attempted_at, null: false
t.timestamps
end
add_foreign_key :payment_attempts, :spree_orders, column: :order_id
end
end
# config/initializers/solidus_stripe.rb
SolidusStripe.configure do |config|
# Also register these events in the Stripe Dashboard webhook settings
config.webhook_events = %i[charge.succeeded charge.failed]
end
Rails.application.config.to_prepare do
PaymentAttemptSubscriber.new.subscribe_to(Spree::Bus)
end
# app/subscribers/payment_attempt_subscriber.rb
class PaymentAttemptSubscriber
include Omnes::Subscriber
handle :"stripe.charge.succeeded", with: :record
handle :"stripe.charge.failed", with: :record
def record(event)
charge = event.data.object
card = charge.payment_method_details&.card
intent = SolidusStripe::PaymentIntent.find_by(stripe_intent_id: charge.payment_intent)
PaymentAttempt.find_or_create_by!(stripe_charge_id: charge.id) do |attempt|
attempt.order_id = intent&.order_id
attempt.stripe_payment_intent_id = charge.payment_intent
attempt.status = charge.status
attempt.outcome_type = charge.outcome&.type
attempt.network_status = charge.outcome&.network_status
attempt.decline_code = charge.outcome&.reason
attempt.advice_code = charge.outcome&.advice_code
attempt.network_decline_code = charge.outcome&.network_decline_code
attempt.card_brand = card&.brand
attempt.card_country = card&.country
attempt.card_funding = card&.funding
attempt.amount_minor = charge.amount
attempt.currency = charge.currency
attempt.attempted_at = Time.zone.at(charge.created)
end
end
end
Three details deserve a word. find_or_create_by! on the unique charge ID makes the subscriber safe when Stripe sends the same webhook twice, which webhooks are allowed to do. The amount stays in minor units, pence, exactly as Stripe sends it, so no rounding creeps in. And the table holds no card number, no name and no address: the brand, country and funding type are enough to analyse declines.
That last point is also the law. The attempts are linked to orders, so they are personal data under the UK General Data Protection Regulation (UK GDPR), and its data minimisation principle asks that you hold only what is adequate, relevant and limited to the purpose.21 The Information Commission (formerly the Information Commissioner's Office, ICO) explains the principle in its guidance.22 Keep the table to these columns, mention payment analysis in your privacy notice, and delete attempts on the same schedule as the orders they belong to.
Reading the attempts
With a month of attempts recorded, two queries answer most questions. The first compares approval by card country, because cards issued abroad often decline more.
-- PostgreSQL. Approval of payment attempts by card origin, June 2026.
SELECT
CASE
WHEN card_country IS NULL THEN 'Unknown'
WHEN card_country = 'GB' THEN 'UK card'
ELSE 'Card issued abroad'
END AS card_origin,
count(*) AS attempts,
count(*) FILTER (WHERE status = 'succeeded') AS approved,
round(100.0 * count(*) FILTER (WHERE status = 'succeeded') / count(*), 1) AS approval_pct
FROM payment_attempts
WHERE attempted_at >= '2026-06-01' AND attempted_at < '2026-07-01'
GROUP BY 1
ORDER BY attempts DESC;
The second lists the reasons, so you can see which group to work on first.
-- PostgreSQL. Failed attempts by reason and advice, June 2026.
SELECT coalesce(decline_code, outcome_type) AS reason,
advice_code,
count(*) AS failed_attempts
FROM payment_attempts
WHERE status = 'failed'
AND attempted_at >= '2026-06-01' AND attempted_at < '2026-07-01'
GROUP BY 1, 2
ORDER BY failed_attempts DESC;
To get back from attempts to checkouts, join on order_id and keep the last attempt per order. That is how Callum produced the 170 failures by reason earlier in this chapter. Timeouts that never reached Stripe will not appear in the webhooks, so the shop's own error log fills that gap.
Example: the payment step by method and card origin
Callum combines both views for June, using the last method each checkout tried. All figures are the example's.
| Method at the last attempt | Checkouts at payment | Orders | Success rate |
|---|---|---|---|
| Card issued in the UK | 1,480 | 1,370 | 92.6% |
| Card issued abroad | 150 | 118 | 78.7% |
| Apple Pay or Google Pay | 210 | 203 | 96.7% |
| PayPal | 310 | 289 | 93.2% |
| Total | 2,150 | 1,980 | 92.1% |
Two things stand out. Wallets succeed most often, which fits the earlier point that they authenticate on the customer's own device. And cards issued abroad, only 150 checkouts, lose more than one in five. That is too small a group to chase first, and a good one to watch: if Priya starts advertising abroad, it will grow.
Putting a number on the leak
Now the maths, which is short. The recovered orders are the sum, over the recoverable groups, of each group's size times the share the fixes recover.
is the number of orders recovered each month, runs over the recoverable groups (soft declines, authentication, technical errors), is the number of lost checkouts in group , and is the share of that group the fixes recover. Each is an expected share, an average over many months, which Foundations: expected value explains. The yearly value in contribution is then:
is the yearly value, is the months in a year, and is the contribution per order before marketing. Contribution is the right measure, not revenue, because a recovered order still costs the goods, the fees and the delivery. Planning on the expected value is right here because the fixes run every month, so the good and the bad months average out.
Example: 52 orders and £12,393 a year
The three groups and the share recovered, from the sections above:
Each product is rounded to whole orders, because a shop cannot recover a fraction of one. of the 130 recoverable checkouts is exactly 40%. The yearly value:
That is about £12,393 a year in contribution, or £1,032.72 a month. In revenue, the same 52 orders are worth pounds a month, or £44,928 a year, which is the figure a marketing report would quote. Contribution is the honest one.
The payment step improves from 1,980 orders out of 2,150 checkouts to 2,032 out of 2,150:
So rises from 92.1% to , and the lost checkouts fall from 170 to 118 a month.
Is the improvement real, or just a good month?
A rise from 92.1% to 94.5% could be luck. One month of 2,150 checkouts is a sample, and a sample's rate wobbles. A confidence interval says how much. For a rate measured on checkouts, the approximate 95% interval is:
is the measured success rate, is the number of checkouts it was measured on, is the multiplier for 95% confidence, and the square root is the standard error, the typical wobble of a rate measured on cases. Foundations: confidence intervals explains where this comes from and when the approximation is good enough. With thousands of checkouts and rates away from 0% and 100%, it is.
Example: June against September
Before the fixes, and :
So June's true rate lies roughly between 90.9% and 93.2%. After the fixes, in September, on the same number of checkouts:
So between about 93.5% and 95.5%. For the difference of 2.4 points, the standard errors combine as , and the 95% interval for the improvement runs from about 0.9 to 3.9 points. It does not include zero, so the improvement is very unlikely to be luck.
The same maths carries a warning for the small groups. The 150 checkouts with cards issued abroad give an interval of about plus or minus 6.5 points around 78.7%. A change of a few points there means nothing in a single month. Watch it over a quarter.
A check to repeat every quarter
The fixes above are mostly one off changes. The leak comes back quietly when a provider changes a default, a fraud rule is added in a hurry, or a new checkout design hides the second way to pay. A quarterly check of about half an hour keeps it closed. The later chapter on silent failures covers how to catch a sudden break within hours instead.
| What to check | Where | Act when | Who |
|---|---|---|---|
| Checkout payment success rate | The spree_state_changes query | Below 93%, or down more than one point on last quarter | Callum |
| Lost checkouts by reason | The payment_attempts reasons query | A group grows by more than 20% | Callum |
| Approval by card origin and by method | The card origin query and the table by method | Any method 5 points below the shop's average | Callum |
Retries after do_not_try_again | payment_attempts, failed attempts per order | More than zero | Callum |
| Custom fraud rules that force 3D Secure | Stripe Dashboard settings | Any rule nobody can explain | Priya and Callum |
| A decline test in staging on phone and desktop | Stripe test cards | Basket, address or delivery lost after a decline | Callum |
| The decline messages, read aloud | The payment step | Any message that blames, hides the next step or sounds like a machine | Priya |
Example: Wrenfield Home's first quarterly check
Callum shipped the fixes in July. In early October he runs the queries for July to September. The success rate sits at 94.3%, 94.6% and 94.5%, all above 93%. No group of reasons has grown. The attempts table shows two retries after do_not_try_again, both from a customer pressing the button again by hand, not from the shop's code, so no action. Priya reads the four messages aloud and changes one word. The check takes 25 minutes, and the next one is in the calendar for January.
My view
Declined payments are the leak I would fix first in most shops, for one reason: these customers have already said yes. Every other lever in eCommerce spends money to persuade someone. This one only asks the shop to stop losing the people it already persuaded.
It is also the leak where measuring is most of the work. Most owners have never seen their checkout success rate at the payment step, and the moment they do, the fixes almost choose themselves. I would not start with a new payment provider or a fraud tool. I would start with the two queries in this chapter, a table of attempts, and an honest look at the messages and the basket after a failure. Most of the recovery comes from there, and none of it needs a contract with anyone new.
Conclusion
Between "Pay" and the order, a shop passes the customer to four other parties, and any of them can say no. In the example, 170 of 2,150 checkouts at the payment step ended without an order. Only 40 of those were declines nobody could fix. The other 130 were soft declines, abandoned or failed authentication, and technical errors, and better data, exemptions that are allowed to work, one safe retry for technical failures, help for replaced saved cards, a second way to pay inside the error, kinder messages and a basket that survives recover 52 orders a month, £12,393 a year in contribution.
The method works for any shop. Measure the checkout success rate at the payment step, not only the provider's authorisation rate. Record every attempt with its reason. Group the failures into what cannot be fixed and what can. Fix the largest recoverable group first, and check the result against a confidence interval before you celebrate. Then put the half hour check in the calendar for every quarter.
I build shops on Ruby on Rails and Solidus where every payment attempt is recorded next to the order it belongs to, and the shop, its code and its data belong to the client. If you want to know how many of your own customers are lost at the very last step, that is a good first conversation.