🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

auth-net-types

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

auth-net-types - npm Package Compare versions

Comparing version

to
1.2.1

16

lib/index.js

@@ -142,4 +142,9 @@ var xml = require('xml');

this.customerProfileId = options.customerProfileId || '';
this.shipToList = new AuthorizeShippingAddress(options.shipToList);
this.paymentProfiles = new AuthorizePaymentProfiles(options.paymentProfiles);
if (options.shipToList) {
this.shipToList = new AuthorizeShippingAddress(options.shipToList);
}
if (options.paymentProfiles) {
this.paymentProfiles = new AuthorizePaymentProfiles(options.paymentProfiles);
}
};

@@ -155,4 +160,7 @@

addXmlObjToList(xmlObj.profile, 'email', this.email);
xmlObj.profile = xmlObj.profile.concat(this.paymentProfiles.toXmlObjList());
if (this.shipToList.length > 0) {
if (this.paymentProfiles && this.paymentProfiles.length) {
xmlObj.profile = xmlObj.profile.concat(this.paymentProfiles.toXmlObjList());
}
if (this.shipToList && this.shipToList.length) {
xmlObj.profile.push({ shipToList: this.shipToList.toXmlObjList() });

@@ -159,0 +167,0 @@ }

{
"name": "auth-net-types",
"version": "1.2.0",
"version": "1.2.1",
"description": "A collection of Authorize.net's types/data types/xml objects.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -19,2 +19,4 @@ var Types = require(__dirname + '/../index')

expect(Customer.customerProfileId).to.equal(1234);
expect(Customer.shipToList).to.not.exist;
expect(Customer.paymentProfiles).to.not.exist;
expect(Customer.toXml()).to.equal('<profile><merchantCustomerId>123</merchantCustomerId><description>A customer with a lot of cash &amp; stuff.</description><email>completelyfake@dontemail.com</email></profile>');

@@ -21,0 +23,0 @@