Skip to content

Commit

Permalink
Added message verification methods
Browse files Browse the repository at this point in the history
  • Loading branch information
rakeshpai committed May 31, 2013
1 parent 76f1c73 commit df97841
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,17 @@ module.exports = function(options) {
client.products.options = buildObject(productOptionsMethods, options);
client.products.coupons = buildObject(productCouponMethods, options);

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

client.canTrustReturnData = function(data) {
return hash.md5(
options.secret + data.vendor_id + data.order_number + data.total
).toUpperCase() == data.key;
}

return client;
}

0 comments on commit df97841

Please sign in to comment.