Website Building » WooCommerce » How Do I Connect NMI to WooCommerce?

How Do I Connect NMI to WooCommerce?

Last updated on January 16, 2023 @ 1:46 pm

As the name suggests, NMI is a payment gateway that merchant account holders can use to process credit card payments. When you connect NMI to WooCommerce, you open up your store to a world of possibilities in terms of payment options.

With NMI, you can offer your customers a variety of payment options, all of which are processed through a secure gateway. This not only makes it easier for your customers to pay, but also gives you peace of mind knowing that all of your transactions are secure.

There are two ways to connect NMI to WooCommerce. The first is by using the NMI Payment Gateway plugin.

This plugin is available for free from the WordPress plugin repository. Once installed and activated, you simply need to enter your NMI account details into the plugin settings page and you’re ready to go.

PRO TIP: If you are not careful, connecting NMI to WooCommerce can be dangerous. Make sure that you know what you are doing before you attempt to connect the two. If you are not sure, ask someone who is experienced with WooCommerce and NMI for help.

The second way to connect NMI to WooCommerce is by adding the following code snippet to your theme’s functions.php file:

add_action( 
  'woocommerce_after_checkout_form', 
  'nmi_gateway_script' );
function nmi_gateway_script() {
  if ( ! is_checkout() ) {
  return; }
?>
<script type="text/javascript" src="https://secure.networkmerchants.com/gateway/js/include-gateway.js"></script>
<script type="text/javascript">
// <![CDATA[
NMIGatewayConfig = {};
NMIGatewayConfig.transactionKey = "YourTransactionKey"; 
//Replace with your Transaction Key 
NMIGatewayConfig.environment = "live"; 
//Change this to "live" when you're ready to go live 
// ]]>  </script>  <?php } ?>

How Do I Connect NMI to WooCommerce?

There are two ways to connect NMI to WooCommerce. The first is by using the NMI Payment Gateway plugin. This plugin is available for free from the WordPress plugin repository.

The second way to connect NMI to WooCommerce is by adding the following code snippet to your theme’s functions.php file:

Morgan Bash

Morgan Bash

Technology enthusiast and Co-Founder of Women Coders SF.