Skip to content

Response_Valid

Jacob McConnell edited this page Jun 10, 2014 · 2 revisions

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");
}
Clone this wiki locally