Skip to content

Commit

Permalink
simple fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
eraycetinay committed Nov 4, 2017
1 parent a48d380 commit 3698109
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion examples/secure3d.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ nestpay = new nodeNestpay({
storekey: 'TRPS1234',
callbackSuccess: 'http://localhost:3000/success',
callbackFail: 'http://localhost:3000/fail',
endpoint3d: 'asseco',
endpoint: 'asseco',
currency: 'TRY',
});

Expand Down
3 changes: 1 addition & 2 deletions examples/secure3dExpress.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ nestpay = new nodeNestpay({
callbackSuccess: 'http://localhost:3000/success',
callbackFail: 'http://localhost:3000/fail',
endpoint: 'asseco',
endpoint3d: 'asseco',
currency: 'TRY',
});

Expand Down Expand Up @@ -61,7 +60,7 @@ app.post('/success', function(req, res) {
}).catch(function(securePurchaseError) {

res.send(securePurchaseError);

});
});

Expand Down
6 changes: 1 addition & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ function nestpay(value) {
storekey: value.storekey || '',
mode: value.mode || 'P',
currency: value.currency || 'USD',
ip: value.ip || '127.0.0.1',
orderId: value.orderId || 'Auto',
callbackSuccess: value.callbackSuccess || '',
callbackFail: value.callbackFail || '',
secureFormat: value.secureFormat || '',
endpoint: value.endpoint || 'asseco',
endpoint3d: value.endpoint3d || 'asseco',
endpoints: {
'test': 'https://testvpos.asseco-see.com.tr/fim/api',
'asseco': 'https://entegrasyon.asseco-see.com.tr/fim/api',
Expand Down Expand Up @@ -55,9 +53,7 @@ function nestpay(value) {
'citibank': 'citibank.est.com.tr',
'cardplus': 'cardplus.est.com.tr'
},
amount: 0,
storetype: '',
lang: 'tr'
lang: value.endpoint || 'tr'
}
}

Expand Down
2 changes: 1 addition & 1 deletion methods/authorize.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = function(nestpay) {
Cvv2Val: value.cvv || ''
};

var url=that.config.endpoints[value.endpoint || that.config.endpoint];
var url=that.config.endpoints[that.config.endpoint];
that.request(url,data).then(resolve).catch(reject);
});
}
Expand Down
2 changes: 1 addition & 1 deletion methods/capture.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = function(nestpay) {
OrderId: value.orderId
};

var url=that.config.endpoints[value.endpoint || that.config.endpoint];
var url=that.config.endpoints[that.config.endpoint];
that.request(url,data).then(resolve).catch(reject);
});
}
Expand Down
2 changes: 1 addition & 1 deletion methods/purchase.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = function(nestpay) {
Cvv2Val: value.cvv || ''
};

var url=that.config.endpoints[value.endpoint || that.config.endpoint];
var url=that.config.endpoints[that.config.endpoint];
that.request(url,data).then(resolve).catch(reject);
});
}
Expand Down
2 changes: 1 addition & 1 deletion methods/refund.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = function(nestpay) {
Total: value.amount,
};

var url=that.config.endpoints[value.endpoint || that.config.endpoint];
var url=that.config.endpoints[that.config.endpoint];
that.request(url,data).then(resolve).catch(reject);
});
}
Expand Down
2 changes: 1 addition & 1 deletion methods/secure3d.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module.exports = function(nestpay) {
storetype: '3d',
lang: value.lang || that.config.lang
},
url: that.config.endpoints3d[that.config.endpoint3d]
url: that.config.endpoints3d[that.config.endpoint]
};
var hashstr = data.form.clientId + data.form.oid + data.form.amount + data.form.okUrl + data.form.failUrl + data.form.rnd + (value.storekey || that.config.storekey);
data.form.hash = crypto.createHash('sha1').update(hashstr).digest('base64');
Expand Down
2 changes: 1 addition & 1 deletion methods/securePurchase.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module.exports = function(nestpay) {
data.PayerSecurityLevel = value.eci;
data.PayerAuthenticationCode = value.cavv;

var url=that.config.endpoints[value.endpoint || that.config.endpoint];
var url=that.config.endpoints[that.config.endpoint];
that.request(url,data).then(resolve).catch(reject);
}
});
Expand Down
2 changes: 1 addition & 1 deletion methods/void.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = function(nestpay) {
OrderId: value.orderId
};

var url=that.config.endpoints[value.endpoint || that.config.endpoint];
var url=that.config.endpoints[that.config.endpoint];
that.request(url,data).then(resolve).catch(reject);
});
}
Expand Down

0 comments on commit 3698109

Please sign in to comment.