Skip to content

Commit 0d872eb

Browse files
authored
Merge pull request #61 from AuthorizeNet/future
Update for Release 1.0.7
2 parents d05445c + 4bf3b7e commit 0d872eb

7 files changed

Lines changed: 663 additions & 9 deletions

File tree

CONTRIBUTING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
+ Thanks for contributing to the Authorize.Net Node SDK.
2+
3+
+ Before you submit a pull request, we ask that you consider the following:
4+
5+
- Submit an issue to state the problem your pull request solves or the funtionality that it adds. We can then advise on the feasability of the pull request, and let you know if there are other possible solutions.
6+
- Part of the SDK is auto-generated based on the XML schema. Due to this auto-generation, we cannot merge contributions for request or response classes. You are welcome to open an issue to report problems or suggest improvements. Auto-generated classes are inside [sdk-node/lib/apicontracts.js](https://github.com/AuthorizeNet/sdk-node/tree/master/lib) and [sdk-node/lib/apicontrollers.js](https://github.com/AuthorizeNet/sdk-node/tree/master/lib) folders, except [sdk-node/lib/apicontrollersbase.js](https://github.com/AuthorizeNet/sdk-node/tree/master/lib).
7+

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
* Node.js version 4.8.4 or higher
99
* An Authorize.Net account (see _Registration & Configuration_ section below)
1010

11+
### Contribution
12+
- If you need information or clarification about any Authorize.Net features, please create an issue for it. Also you can search in the [Authorize.Net developer community](https://community.developer.authorize.net/).
13+
- Before creating pull requests, please read [the contributors guide](CONTRIBUTING.md).
14+
1115
### TLS 1.2
1216
The Authorize.Net APIs only support connections using the TLS 1.2 security protocol. It's important to make sure you have new enough versions of all required components to support TLS 1.2. Additionally, it's very important to keep these components up to date going forward to mitigate the risk of any security flaws that may be discovered in your system or any libraries it uses.
1317

lib/apicontracts.js

Lines changed: 409 additions & 0 deletions
Large diffs are not rendered by default.

lib/apicontrollers.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,26 @@ class GetCustomerPaymentProfileListController extends APIOperationBase {
486486

487487
module.exports.GetCustomerPaymentProfileListController = GetCustomerPaymentProfileListController;
488488

489+
class GetCustomerPaymentProfileNonceController extends APIOperationBase {
490+
constructor(apiRequest) {
491+
logger.debug('Enter GetCustomerPaymentProfileNonceController constructor');
492+
super(apiRequest);
493+
logger.debug('Exit GetCustomerPaymentProfileNonceController constructor');
494+
}
495+
496+
validateRequest(){
497+
logger.debug('Enter validateRequest');
498+
499+
logger.debug('Exit validateRequest');
500+
return;
501+
}
502+
503+
getRequestType(){
504+
return 'GetCustomerPaymentProfileNonceRequest';
505+
}
506+
}
507+
508+
module.exports.GetCustomerPaymentProfileNonceController = GetCustomerPaymentProfileNonceController;
489509
class GetCustomerProfileController extends APIOperationBase {
490510
constructor(apiRequest) {
491511
logger.debug('Enter GetCustomerProfileController constructor');

lib/apicontrollersbase.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,6 @@ class APIOperationBase {
8383
var reqOpts = {
8484
url: this._endpoint,
8585
method: 'POST',
86-
headers: {
87-
'Content-Type': 'application/json',
88-
'Content-Length': this._request.length
89-
},
9086
json: true,
9187
timeout: config.timeout,
9288
body: this._request
@@ -102,9 +98,10 @@ class APIOperationBase {
10298
} else
10399
{
104100
//TODO: slice added due to BOM character. remove once BOM character is removed.
105-
var responseObj = JSON.parse(body.slice(1));
106-
logger.debug(JSON.stringify(responseObj, 2, null));
107-
obj._response = responseObj;
101+
if(typeof body!=='undefined'){
102+
var responseObj = JSON.parse(body.slice(1));
103+
logger.debug(JSON.stringify(responseObj, 2, null));
104+
obj._response = responseObj;
108105
/*
109106
var jsonResponse = JSON.stringify(body);
110107
console.log("escaped body : '" + escape(jsonResponse) + "'");
@@ -114,6 +111,11 @@ class APIOperationBase {
114111
*/
115112
callback();
116113
}
114+
else
115+
{
116+
logger.error("Undefined Response");
117+
}
118+
}
117119
});
118120

119121
logger.debug('Exit APIOperationBase execute');

0 commit comments

Comments
 (0)