New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@calistyle/nmi

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@calistyle/nmi

Node SDK for Networking Merchants Inc's (NMI) Three Step Redirect API, Query API, Direct API

  • 1.0.0-alpha.4
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-66.67%
Maintainers
2
Weekly downloads
 
Created
Source

NMI SDK

NPM version Build Status Test Coverage Dependency Status

Strongly typed Node SDK for Networking Merchants Inc's (NMI) Three Step Redirect API, Query API, and Direct API

Installation

npm install @calistyle/nmi

Documentation

Module documentation

NMI Three Step Redirect API docs

Notes

All attribute names received from NMI will be converted to camelCase for uniformity. Attribute names sent to NMI will be converted to the appropriate hypen-case and param_case where appropriate. Additionally, some fields are aliased (e.g, postalCode => postal) to provide consistent access between the Three Step and Query APIs.

You can disable this completely by specifying transform: false in the configuration options.

Dispatched XML is generated by xmlbuilder.

Usage

Setup

const NMI = require('@calistyle/nmi').NMI
const nmi = new NMI({
  apiKey: 'your-key-here',
  username: 'your-username',
  password: 'your-password'
})

Transaction

// create a sale
nmi.transaction.create('sale', {
  amount: 2.99,
  redirectUrl: 'http://127.0.0.1/example',
  billing: {
    firstName: 'John',
    lastName: 'Doe'
  }
});

// execute a token
nmi.transaction.execute('the-token');

Handling Errors

try {
  let txn = await nmi.transaction.execute('<some-token>');

  // success!

}
catch(err) {

  if (err.isNMI) {
    // payment or gateway error - see err.response
  }
  else {
    // connection or outside error
  }

}

FAQs

Package last updated on 17 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc