Skip to content

Commit

Permalink
Adapting code
Browse files Browse the repository at this point in the history
  • Loading branch information
Heitor committed May 11, 2015
1 parent 3f03419 commit 0cebc6f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ Config.prototype = {
return 'https://api.ebanx.com/';
}
}
}
};

module.exports = new Config();
8 changes: 4 additions & 4 deletions lib/resources/Direct.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ function direct(params, callback) {
if(params.creditcard.hasOwnProperty('token')) {
options.params.payment.creditcard = {
token : params.creditcard.token
}
};
} else {
options.params.payment.creditcard = {
card_number : params.creditcard.card_number,
card_name : params.creditcard.card_name,
card_due_date : params.creditcard.card_due_date,
card_cvv : params.creditcard.card_cvv
}
};
}
}

Expand All @@ -90,7 +90,7 @@ function direct(params, callback) {
bank_code : params.directdebit.bank_code,
bank_agency : params.directdebit.bank_agency,
bank_account : params.directdebit.bank_account
}
};
}

if(params.hasOwnProperty('person_type') && params.person_type === 'business') {
Expand All @@ -99,7 +99,7 @@ function direct(params, callback) {
name : params.responsible.name,
birth_date : params.responsible.birth_date,
document : params.responsible.document
}
};
}

client.send(options, function(err , reply) {
Expand Down
2 changes: 1 addition & 1 deletion lib/resources/Refund.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function refund(params, callback) {
validator.params = params;
validator.validatePresence("operation");

if (params.operation == "request") {
if (params.operation === "request") {
validator.validatePresence("hash");
validator.validatePresence("amount");
validator.validatePresence("description");
Expand Down
4 changes: 2 additions & 2 deletions lib/resources/Validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Validator.prototype = {
var levels = keys.length;
var params = this.params;

if (levels == 4) {
if (levels === 4) {
if (params[keys[0]][keys[1]][keys[2]][keys[3]]) {
return params[keys[0]][keys[1]][keys[2]][keys[3]];
}
Expand Down Expand Up @@ -93,6 +93,6 @@ Validator.prototype = {
throw new Error("Config key testMode not boolean value");
}
}
}
};

module.exports = new Validator();

0 comments on commit 0cebc6f

Please sign in to comment.