Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

auth-net-request

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

auth-net-request

Authorize.net requests for Node.JS

  • 2.2.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10
decreased by-56.52%
Maintainers
1
Weekly downloads
 
Created
Source

Authorize.net Request

Dependency Status devDependency Status

Install

npm install auth-net-request

Usage

var AuthorizeRequest = require('auth-net-request');

var Request = new AuthorizeRequest({
  api: '123',
  key: '1234',
  cert: '/path/to/cert.pem',
  rejectUnauthorized: false, // true
  requestCert: true, // false
  agent: false // http.agent object
  sandbox: false // true
});

Request.send(<method>, <xml>, [xmlOptions], function(err, response) {});

Args and Options

  • <method> - As specified in the Auhorize.net API without the "Request" suffix, e.g. "createTransaction".
  • <xml> - Either an XML string or a JavaScript object reflecting the JSON specification in the Authorize.net API.
  • xmlOptions.rejectUnauthorized - see https.request option. Note: defaults to false. Likely want to set to true.
  • xmlOptions.requestCert - Defaults to true.
  • xmlOptions.agent - Defaults to false.
  • xmlOptions.extraOptions - Adds an <extraOptions> tag to the request. For?

Err and Response

If !err on the send method callback, response is as specified in the Authorize.net API. E.g. consider checking and recording response.transactionResponse.responseCode, response.transactionResponse.authCode and response.transactionResponse.transId.

If !!err on the send method callback, you can get access to the following properties of err:

  • err.name
  • err.message
  • err.code
  • err.stack
  • err.response - response from Authorize.net API, if the request got that far.

Notes

!err on the send method callback does not necessarily mean a transaction was approved. Note the differences among the following in the API documentation: messages.resultCode, messages.message.code and transactionResponse.responseCode.

Version >= 2.x.x has a breaking change, all values are returned as strings rather than strings and numbers (unless the value is an object, array, etc).

References

FAQs

Package last updated on 28 Dec 2015

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