Response_Valid - 2Checkout/2checkout-node GitHub Wiki

2Checkout returns both the buyer and a set of sale parameters including any custom parameters to the approved URL when the sale has been completed. This method provides a binding to validate the MD5 hash.

##Methods

##valid

Use to validate the MD5 hash.

####Arguments

  • Object of passback parameters
  • Sale Total

####Returns

Returns true or false

####Example Usage:

var tco = new Twocheckout({
    sellerId: "1817037",
    secretWord: "tango"
});

if (tco.response.valid(request.body), 0.01) {
    response.send("Valid");
} else {
    response.send("Invalid");
}