Card Testing Attacks in Your Order Data: How to Spot Them and Measure the Damage

A card testing attack leaves hundreds of failed orders, fake guest customers and a few small charges that turn into disputes. Here is how to recognise one in WooCommerce or Magento order data, an hourly detection query, how to keep attack orders out of your reports, and what an attack really costs.

Card testing is fraud aimed at your checkout rather than your products. Someone holding a list of stolen card numbers uses your payment form to find out which ones still work, usually with a script that submits hundreds or thousands of small orders. The cards that pass are sold or used elsewhere. You are left with a pile of failed orders, a handful of small charges that will turn into disputes, and reports that no longer describe your business.

WooCommerce’s own guide puts it plainly: the most common sign is a large increase in the number of orders being assigned the Failed status, and those orders do not represent missed sales. Most advice stops at blocking the attack. This guide is about the data: how to detect an attack from your orders, how to keep it out of your metrics, and how to put a number on what it cost.

Why it matters beyond the failed orders

Card networks now count card testing against the merchant. Visa’s Acquirer Monitoring Program tracks an enumeration ratio alongside its fraud and dispute ratio; merchants with more than 300,000 enumerated transactions in a month and an enumeration ratio of 20 percent or more can be pulled into the program. Most small stores will never reach that volume, but acquirers watch decline rates well below network thresholds, and a sustained attack can get an account restricted. Stripe also warns that card testing can lead to early fraud warnings, disputes and enrolment in card monitoring programs, and recommends refunding fraudulent payments that succeeded.

Attacks are also getting larger. OOPSpam, which makes an anti-spam plugin for WooCommerce, described blocking more than 450,000 card testing attempts in a single week across stores it protects, against PayPal and card processors on both classic and block-based checkouts.

What an attack looks like in order data

Hourly orders during a card testing attack Bar chart of orders per hour over 24 hours. Paid orders follow a normal daily pattern. Between 1 a.m. and 5 a.m. failed orders jump to many times the usual level, while paid orders stay low. 0006121823 Hour of day (store time) Paid orders Failed orders Attack: failed orders at40 times the usual rate,overnight, tiny totals
Illustrative. Attacks often run overnight in the store’s time zone, when nobody is watching the orders screen.

The burst of failed orders is the obvious part. The other signals help you separate an attack from a real payment outage, where failures rise but the orders themselves look normal.

SignalCard testingGateway outage
Failed orders per hourMany times normal, often overnightUp, in line with normal traffic
Order totalsSmall, often the cheapest productNormal basket mix
CustomersMany new guest emails and names, few repeatsYour usual mix, including returning customers
Order attribution originOften “Unknown”, with no device typeNormal sources
Session page viewsIdentical low counts across ordersVaried
Gateway decline reasonsGeneric declines, invalid numbers, wrong CVCTimeouts, processing errors
The attribution signals come from WooCommerce Order Attribution, available since WooCommerce 8.5.

The attribution clues are worth explaining. WooCommerce records an origin, device type and the number of page views in the session for each order, captured by JavaScript in the shopper’s browser. Scripts that post straight to the checkout endpoint skip that browser step, so their orders arrive with origin “Unknown”. In the attack OOPSpam described, many orders had exactly that, and many showed identical session page view counts, a strong sign of automation.

Detect it with an hourly query

Most stores find out about an attack from the gateway, an angry email or the orders screen the next morning. An hourly check against your own baseline catches it within the hour. On WooCommerce with High-Performance Order Storage, orders live in wc_orders and attribution data in wc_orders_meta:

-- Hourly paid vs failed orders, with card-testing indicators (last 14 days)
SELECT DATE_FORMAT(o.date_created_gmt, '%Y-%m-%d %H:00')          AS hour_gmt,
       SUM(o.status IN ('wc-processing', 'wc-completed'))         AS paid,
       SUM(o.status = 'wc-failed')                                AS failed,
       SUM(o.status = 'wc-failed' AND m.meta_value IS NULL)       AS failed_no_origin,
       COUNT(DISTINCT o.billing_email)                            AS distinct_emails,
       ROUND(AVG(o.total_amount), 2)                              AS avg_total
FROM wp_wc_orders o
LEFT JOIN wp_wc_orders_meta m
       ON m.order_id = o.id
      AND m.meta_key = '_wc_order_attribution_source_type'
WHERE o.type = 'shop_order'
  AND o.date_created_gmt >= UTC_TIMESTAMP() - INTERVAL 14 DAY
GROUP BY hour_gmt
ORDER BY hour_gmt;

Turn the output into an alert with two simple rules: flag any hour where failed orders exceed both 10 and five times the median hourly failures of the previous two weeks, or where failed orders are more than half of all orders. Add a third check per customer, matching the starting point in WooCommerce’s anti-fraud documentation, which treats three or more orders from one customer within an hour as a velocity signal worth a high weight. Tune all three against your own history; a store that runs flash sales needs looser limits than one with steady traffic.

Magento varies more by payment integration. Some create a cancelled order for every failed payment, others leave nothing in sales_order and only a record at the gateway. Start from the gateway’s decline report and match it to orders where you can.

Keep attack orders out of your reports

Do not delete the orders straight away. They are evidence for your gateway and your host, and deleting thousands of rows during an attack adds load. Tag them instead, with an order note, a custom meta key such as _card_test = 1 or a dedicated status, then exclude the tag everywhere it would distort a number:

MetricHow an attack distorts itFix
Payment success rateCollapses for the attack windowExclude tagged orders; report attacks as a separate line
New customersGuest orders create customer records in wc_customer_lookupExclude customers whose only orders are tagged
Checkout or order conversion rateInflated if you count created orders, deflated if you count failuresCount paid orders from untagged sessions only
Average order value and product mixPulled toward the cheap product the bots usedUse paid, untagged orders
Email list and deliverabilityFailed-order emails go to stolen or invented addresses, causing bounces and complaintsSuppress tagged addresses from all lists
Cohort and repeat-rate reportsThousands of one-order customers who never returnDrop tagged customers from cohort tables

Bots that skip the browser do not show up in GA4 at all, so your analytics and your order table will disagree for the attack period. That is one more entry for the reconciliation routine in our guide to matching GA4 revenue to WooCommerce and Magento orders. Bots that do load pages are a separate problem, covered in our post on bot traffic and conversion rate.

Count what the attack cost

A post-incident cost estimate is useful twice: it tells you how much prevention is worth, and it is the evidence you need when asking a gateway to waive fees. The lines below cover most of it. Use your own gateway’s fee schedule; the example is illustrative.

Cost lineHow to measure itExample: 4,000 attempts
Authorisation fees on declined attemptsAttempts multiplied by your gateway’s per-attempt fee, if it charges one4,000 at $0.10 = $400
Successful test chargesRefund them quickly; count processing fees that are not returned40 charges, $12 in fees
Disputes and fraud warningsDisputes on test charges you did not refund in time, plus dispute fees8 at $15 = $120
Staff timeHours spent investigating, cleaning up and answering emails6 hours
Hosting and performanceExtra load during the attack; slower checkout for real shoppersCheck paid orders in the attack window against the usual level
Account riskDecline rate seen by your acquirer during the attackRecord the peak hourly decline rate

Prevention, briefly

Prevention works in layers, and the earliest layers matter most because a declined card still leaves a failed order behind once the order exists. The usual stack for WooCommerce is a CAPTCHA or Cloudflare Turnstile on checkout, rate limits on the Store API checkout endpoint, a rule that blocks orders with no attribution origin (the control OOPSpam credits with stopping its largest attack), velocity checks, and the gateway’s own fraud screening at the end. Stripe’s guidance adds rate limits per IP address and requiring session validation for sensitive actions.

Whatever you install, keep the hourly query running. Attackers change tactics, and the failed-order count is the one signal they cannot hide, because a declined card is the whole point of the exercise.

Sources