Founder deal: 75% off the lifetime licence. Unlimited sites, one payment, every update.See the founder plan
Home / Blog / Developer resources

Logging and Debugging NMI Requests in WooCommerce

Where NMI for WooCommerce logs live, how to read a gateway response, and a clean five-step way to debug a failed NMI payment.

To debug NMI requests in WooCommerce, open WooCommerce, Status, Logs and pick the log whose source is nmiwp. NMI for WooCommerce writes through the standard WooCommerce logger and removes card numbers, CVV and the security key before anything is saved, so the log is safe to read and to paste into a support ticket. Match the failing order’s time and ID, then read the gateway response, which says why the payment failed.

This guide covers where the evidence lives, how to read it and what to do when the log is empty. Extension points for adding your own logging are in the hooks and filters reference.

Where to look, in order

  1. The order notes. The gateway response is stored on the order: transaction ID, authorization code, AVS and CVV results and the raw response code. Start here, it is the quickest. See finding the NMI transaction ID for an order.
  2. WooCommerce, Status, Logs. Filter by source nmiwp and choose the file for the date of the failure. Use the order number or the time to locate the entry.
  3. The PHP error log. For fatal errors, blank checkouts and plugin conflicts. Turn on WP_DEBUG_LOG in wp-config.php temporarily and read wp-content/debug.log. Turn it off afterward.
  4. The browser console and network tab. For card fields that do not appear or tokenization that fails. This is where JavaScript errors and blocked requests show up, and your gateway log will not see them.
  5. The gateway’s own records. The Merchant Portal shows what NMI received, which settles arguments about whether a request ever arrived.

Reading a gateway response

NMI returns a response value of 1, 2 or 3 for approved, declined or error, plus responsetext and a numeric response_code. Read all three together:

  • 2xx response codes are issuer declines. The customer needs another card or a call to the bank. See diagnosing a declined card.
  • 300 means the gateway rejected the request, for example a missing field or a credentials or permission problem. The text varies, so always read it. Details in NMI response code 300.
  • 4xx response codes point at processor or merchant account configuration, such as 410 invalid merchant configuration. Your provider fixes those, not WordPress.

The response field guide explains how the three values relate. Credential errors are covered in the invalid security key guide.

A debugging session that stays clean

  1. Switch the store to sandbox mode with sandbox credentials. The banner shows you are not live.
  2. Place one test order and note the time to the second.
  3. Read the log entry and the order notes. Write down the code and text.
  4. Change exactly one thing, then repeat. Do not change keys, plugins and settings in one go.
  5. Switch back to live and confirm one real low-value order.

For sandbox accounts and test cards, see the testing and sandbox documentation.

If the log is empty

  • The request never left the site. Look for a PHP fatal error or a JavaScript error that stopped checkout before the server call.
  • You are reading the wrong date or source. Logs are split by source and date.
  • Log files were purged. WooCommerce has a retention setting that deletes older logs, so check the log retention days if you are investigating something old.
  • A caching or security plugin blocked the checkout request. Check the browser network tab for a non-200 response.

Do not log secrets yourself

If you add custom logging with wc_get_logger(), log IDs, codes and response text, never raw requests. Do not disable the plugin’s redaction on a production site. When contacting support, send the redacted log lines, the order number and the time, and use the troubleshooting guide first. More developer notes live in developer resources.

A worked example: a customer says their payment failed

A customer emails at 3:10 pm saying their card was refused, but they were charged. Start with the order. If it has a transaction ID and an approved response in its notes, the gateway took the payment and the problem is the order status. If the notes show a decline, read the response code and text, then tell the customer what to do next.

If the order has no gateway note at all, go to WooCommerce, Status, Logs for the nmiwp source at that time. An entry with a response means the request arrived. No entry means look at the PHP error log and the browser network tab, because the failure happened before the gateway call. Last, search the transaction in the merchant portal. That tells you whether the gateway ever saw it.

Mistakes to avoid

  • Changing several settings at once, then not knowing which one fixed or broke anything.
  • Leaving WP_DEBUG_LOG on after the investigation.
  • Reading a log from the wrong day or the wrong source and concluding nothing happened.
  • Pasting unredacted data from another tool into a ticket.
  • Testing in live mode with real cards when sandbox would have shown the same behavior.

A useful habit: when you close a payment problem, add one line to an internal note with the order number, the response code and what fixed it. After a few weeks you will have a short list of your store’s recurring causes.

Running NMI on WooCommerce? Free covers the basics and Pro adds the paid features. Compare Free and Pro.

Last reviewed November 2026.

NMI for WooCommerce

Built-in redacted logging

Card numbers, CVV and security keys are stripped from logs before they are written.

See the plugin featuresSee pricing

Logging is included in the free plugin.