Skip to content

Instantly share code, notes, and snippets.

@craigchristenson
Last active December 30, 2015 08:06
Show Gist options
  • Save craigchristenson/3841142 to your computer and use it in GitHub Desktop.
Save craigchristenson/3841142 to your computer and use it in GitHub Desktop.
2Checkout Return
<?php
$hashSecretWord = 'tango'; //2Checkout Secret Word
$hashSid = 1303908; //2Checkout account number
$hashTotal = '1.00'; //Sale total to validate against
$hashOrder = $_REQUEST['order_number']; //2Checkout Order Number
$StringToHash = strtoupper(md5($hashSecretWord . $hashSid . $hashOrder . $hashTotal));
if ($StringToHash != $_REQUEST['key']) {
$result = "Fail - Hash Mismatch";
} else {
$result = "Success - Hash Matched";
}
echo $result;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment