Skip to content

Instantly share code, notes, and snippets.

@w3guy
Forked from craigchristenson/gist:3841142
Created December 30, 2015 08:06
Show Gist options
  • Save w3guy/55d136cd19c0e1d78c3c to your computer and use it in GitHub Desktop.
Save w3guy/55d136cd19c0e1d78c3c 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