auth-net-request
Advanced tools
Comparing version 2.1.0 to 2.2.0
var https = require('https') | ||
, parser = require('xml2js') | ||
, fs = require('fs'); | ||
, fs = require('fs') | ||
, builder = new parser.Builder({headless: true}); | ||
module.exports = (function() { | ||
@@ -37,2 +38,3 @@ var AuthorizeRequest = function(options) { | ||
AuthorizeRequest.prototype.send = function(action, xml, options) { | ||
xml = typeof xml == 'object' ? builder.buildObject(xml).replace('<root>', '').replace('</root>', '') : xml; | ||
var callback = arguments[arguments.length - 1], string = '' | ||
@@ -96,5 +98,8 @@ , originalValidationMode = this.validationMode; // In order to reset after the transaction | ||
res.on('data', function(data) { | ||
data = data.toString(); | ||
var data = ""; | ||
res.on('data', function(dataStream) { | ||
data += dataStream.toString(); | ||
}); | ||
res.on('end', function () { | ||
parser.parseString(data, {object: true, explicitArray: false}, function (err, response) { | ||
@@ -141,2 +146,2 @@ if (response.ErrorResponse) { | ||
return AuthorizeRequest; | ||
})(); | ||
})(); |
{ | ||
"name": "auth-net-request", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "Authorize.net requests for Node.JS", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6489
121