Skip to content

Commit

Permalink
Added a test mode to bypass the return data
Browse files Browse the repository at this point in the history
  • Loading branch information
rakeshpai committed May 31, 2013
1 parent be8a3ab commit 690f877
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,16 @@ module.exports = function(options) {
client.products.coupons = buildObject(productCouponMethods, options);

client.canTrustINS = function(data) {
if(options.test) return true;

return hash.md5(
data.sale_id + "" + data.sid + data.invoice_id + options.secret
).toUpperCase() == data.md5_hash;
};

client.canTrustReturnData = function(data) {
if(options.test) return true;

return hash.md5(
options.secret + data.vendor_id + data.order_number + data.total
).toUpperCase() == data.key;
Expand Down

0 comments on commit 690f877

Please sign in to comment.