Card testing in online shops: how to stop stolen card checks
If dozens of orders with the status “Failed” appear in your online shop within a few minutes, with small amounts, nonsensical names and notes about declined cards, you are very likely dealing with card testing. An attacker is using your checkout to find out which stolen payment cards still work. You need to stop the attack, refund successful fraudulent payments as soon as possible and protect the checkout in a way that still lets real customers buy without unnecessary obstacles.
This article explains how to recognise card testing, what to do during an attack and which measures make sense in the long term. It is based on documentation from WooCommerce, Stripe and the OWASP project.
What card testing is and why it targets online shops
OWASP lists this automated attack as OAT-001 Carding: repeated payment authorisation attempts that verify the validity of bulk stolen card data. When the attacker does not know the expiry date or security code and guesses them, OWASP classifies it as a separate attack, Card Cracking. Other names include carding, card stuffing and card checking.
According to the WooCommerce documentation, the attacker typically tries many small purchases, each with a different card, so that neither the cardholder nor the bank notices. Validated cards are then sold at a higher price or used for larger purchases. Stripe adds that attackers use scripts and abuse not only payments but also card saving, because such a verification usually does not appear on the cardholder’s statement. Your shop is merely a tool for them, not a target for stealing goods.
How to recognise an attack and what it costs you
Typical symptoms according to WooCommerce and Stripe:
- a sharp rise in orders with the Failed status, often with several notes about declined cards,
- a rise in declined authorisations in your payment gateway, with Stripe for example 402 errors with the outcome
generic_decline, - series of low-value payments with customer names or e-mail addresses that make no sense,
- unusual server load and a high number of requests to the checkout.
Failed orders are not lost sales, nor proof of a broken checkout. The damage lies elsewhere: Stripe mentions disputes and fraud reports from the real cardholders, fees, strain on infrastructure and, above all, a higher decline rate. That can harm your reputation with card issuers, so banks may decline legitimate payments more often, even after the attack has ended. Fake orders also distort your business statistics.
Example: a Saturday night in a shop with low-priced products
Illustrative example, not a real case. A WooCommerce shop sells digital vouchers from one euro and allows purchases without registration. Overnight, several hundred orders are created within two hours, almost all of them failed, with different cards and made-up names. A few payments go through. The owner finds out in the morning from the new-order e-mails.
If the successful payments were left in place, disputes from the real cardholders would arrive within days. If the owner only blocked a single IP address, the attack would probably continue from other addresses. The right approach combines immediate action, refunds and a lasting change to the checkout.
What to do immediately during an attack
- Confirm that it is card testing. Compare the number of failed orders and declines with normal operation and review the order notes and the overview in your payment gateway.
- Refund suspicious successful payments. Both WooCommerce and Stripe call this the most important step because it prevents disputes. Do not ship goods or vouchers for such orders.
- Close off the easiest target. Temporarily hide low-priced products, donations or name-your-price products. WooCommerce also recommends considering disabling guest checkout.
- Contact your payment provider. Ask them to review and tighten the anti-fraud settings. Ask about fees too: according to WooCommerce, the provider may not refund them automatically when you refund a payment.
- If there are few failed orders, check card saving. WooCommerce notes that when cards are being validated through customer accounts, disabling payments with saved cards may help, if the gateway supports it.
- Check your gateway keys. Stripe warns that with a leaked secret key an attacker can create payments directly. If you suspect a leak, rotate the key.
After the attack, do not retry payments on the cards of fraudulent customers, for example when failed payments are retried automatically. Stripe warns that you would essentially repeat the attack.
Lasting protection for the checkout
Stripe states explicitly that simple rules based on a single signal, such as blocking IP addresses, are usually not enough. Protection needs several layers and, with plugins or ready-made platforms, usually requires changes at code level.
CAPTCHA verified on the server
WooCommerce recommends adding bot verification to the checkout, for example reCAPTCHA or Cloudflare Turnstile. According to Stripe, the verification must apply to all requests that allow a payment or card validation and must be checked on the server. If the attack continues, adjust the score threshold or switch from an invisible to a visible challenge. According to WooCommerce, a misconfigured plugin offers little or no protection.
Access to the payment form
The easier it is for an attacker to reach the payment, the easier the attack. Stripe lists requiring a login or a valid session before payment as an option, and CSRF tokens can also help. In a typical shop this is a business decision, so it is often enough to require login only for high-risk products or temporarily during an attack.
Rate limits and rules
Limits should match the specific attack. Stripe gives these examples:
- the number of new customers created from one IP address per day,
- the number of cards that can be added to one account,
- the number of purchases of the same product,
- filtering requests by user agent or other parameters,
- a combination: the first attempt from an IP address goes through unhindered, further attempts in the following hours require a CAPTCHA.
Data for the payment gateway’s anti-fraud checks
The provider’s protection works better when it receives more signals. Stripe says its recommended integrations, such as Payment Element or Checkout, include rate limits, models and CAPTCHA, and lists the IP address, e-mail, customer name and billing address as important data. With a custom integration, check that your shop actually sends them to the gateway.
Trade-offs: protection versus customer convenience
| Measure | What it stops | Risk for real customers |
|---|---|---|
| CAPTCHA in the checkout | Scripts that submit payments in bulk | A visible challenge slows down the purchase; an invisible one needs tuning |
| Mandatory login | Anonymous attempts without an account | An obstacle on the first purchase |
| Limits per IP address or account | Large series of attempts from one source | Several customers behind one company network |
| Minimum price and hiding low-priced products | Cheap, inconspicuous test payments | A smaller range or a change in pricing |
| Anti-fraud rules in the gateway | Risky patterns across payments | An occasional decline of an honest payment |
Recommendation: start with measures customers barely notice, namely server-side CAPTCHA, limits and complete data for the gateway. Turn on stricter steps, such as mandatory login, selectively and evaluate their impact on completed orders.
Common mistakes
- Relying on blocking individual IP addresses.
- Adding a CAPTCHA only to the form, but not to the server-side processing of payments or card saving.
- Leaving successful fraudulent payments unrefunded and waiting to see whether a dispute arrives.
- Keeping name-your-price products or donations without a minimum amount; WooCommerce lists them as a frequent target.
- Installing an anti-fraud plugin and not configuring it according to its documentation.
- Not monitoring failed orders, so the attack is only discovered through complaints.
Checklist for shop owners
- An alert for an unusual number of failed orders or declines per hour.
- A prepared procedure: who confirms the attack, who refunds payments and who contacts the payment gateway.
- CAPTCHA verified on the server for both payment and card saving.
- Rate limits for the checkout, account creation and adding cards.
- A minimum price for donations and name-your-price products.
- The IP address, e-mail, name and billing address are sent to the gateway.
- Gateway secret keys are not in public code and you can rotate them quickly.
- Automatic payment retries skip fraudulent customers.
Frequently asked questions
Am I losing revenue through failed orders?
No. WooCommerce states that such orders do not represent missed sales or a checkout fault. The problem is successful fraudulent payments, disputes and a higher decline rate.
Is it enough to block the attacker’s IP addresses?
Usually not. According to Stripe, attackers change their techniques, and rules based on a single signal, such as the IP address, are usually not sufficient on their own. Blocking can help as a temporary step combined with other measures.
Do I have to refund payments that went through?
Yes, if you consider them fraudulent. Both WooCommerce and Stripe recommend refunds to prevent disputes. The provider may not return the transaction fees, so ask them about it.
Will a CAPTCHA plugin protect me automatically?
Only if it is configured correctly. WooCommerce warns that a misconfigured plugin provides little or no protection, and Stripe stresses server-side checking on every request that allows a payment or card validation.
Need to protect your shop’s checkout?
If card testing has already hit you or you want to secure your checkout in advance, I can help you analyse the payment flow and set up verification, limits and data for your payment gateway. Find out more about my work on the Webiant homepage. When requiring login, secure session management is also worth getting right. Get in touch via the contact page.