NMI on WordPress: what it is and what it is not
NMI is a payment gateway platform that exposes web APIs. WordPress can talk to those APIs from any plugin or theme code that can make an HTTPS request. NMI for WooCommerce is the plugin that does this for a WooCommerce store, handling checkout, orders, refunds and saved cards. If you sell with WooCommerce, start with the complete guide to NMI payments for WooCommerce. This page is for people who want to understand the WordPress side: what the APIs offer, how card data is kept out of your server and where you can extend the plugin.
Keep three layers separate. NMI provides the gateway and its APIs. The plugin decides what a WooCommerce store can do and on which plan. Your processor or reseller controls the merchant account: fees, enabled card types, ACH and reserves. Many support questions are really about the third layer. The article gateway vs processor vs merchant account explains the difference.
The NMI building blocks
Four pieces matter for a WordPress developer.
Collect.js is NMI’s JavaScript library. It renders card fields served from NMI’s domain, so the card number is typed into NMI’s frame and never touches WordPress. Your page receives a single-use payment token instead. The details are in Collect.js, hosted fields and tokenization, and the two display variants are compared in inline vs lightbox mode. Collect.js uses a public tokenization key, which is different from your private security key; see how to create a public tokenization key.
The Payment API is the server-side endpoint where your code sends a sale, authorization, capture, void or refund, using the token and your private security key. A walkthrough for PHP is in the NMI Payment API for WordPress developers. Keep that key out of your theme and your repository; see securing NMI API credentials in WordPress.
The Customer Vault stores payment methods at NMI and returns an ID you can charge later. It is the basis for saved cards and renewals. See the Customer Vault API guide.
Webhooks and the Query API let you learn what happened after the request. Webhooks push events to an endpoint on your site and the Query API lets you look transactions up. Read NMI webhooks with WooCommerce, how to verify webhook signatures and using the Query API from WordPress.
How the plugin fits in
NMI for WooCommerce is built around Collect.js and the Payment API. The free plan covers hosted card fields, sale, authorize and validate, partial capture and refund, void, redacted logging, sandbox mode, Blocks and classic checkout, and HPOS. Pro adds Apple Pay and Google Pay, 3D Secure 2, the Customer Vault and ACH. Enterprise adds WooCommerce Subscriptions renewals, Level II and III data and multiple merchant IDs. The Free vs Pro page has the full list.
If you want WordPress features beyond WooCommerce checkout, such as a payment form on a plain page, check the current docs before you rely on the plugin for it. The APIs themselves can do it, but the plugin is documented for WooCommerce.
Extending without editing the plugin
The plugin has documented hooks and filters. Use them rather than editing plugin files, so updates do not erase your changes. The reference is hooks and filters. Typical jobs include passing extra order data to the gateway, for example a PO number as a custom field; see sending custom fields to NMI.
A sensible development path
- Get a sandbox account and test keys. See how to get an NMI sandbox account.
- Install the plugin on a staging copy and run test orders, including a refund and a void.
- Turn on logging and read a redacted request, as in logging and debugging NMI requests.
- Test your caching, firewall and builder plugins at checkout; see the compatibility hub.
- Move to live with the go-live checklist.
When something fails, a response code tells you which layer to blame. Use the response code lookup or the troubleshooting center. For store-side questions about accounts, read the WooCommerce merchant account guide.
Security note: hosted fields reduce how much card data your server handles, but they do not make a store PCI compliant on their own. Confirm what applies to you with your acquirer. See SAQ A vs SAQ A-EP.