include('VPCPaymentConnection.php'); $conn = new VPCPaymentConnection(); / This is secret for encoding the SHA256 hash // This secret will vary from merchant to merchant $secureSecret = "F3BAF2F79EFDD23B6407985EB4AD40DD"; // Set the Secure Hash Secret used by the VPC connection object $conn->setSecureSecret($secureSecret); // Sort the GET data - it's important to get the ordering right ksort ($_GET); $// Add VPC post data to the Digital Order foreach($_GET as $key => $value) { if (($key!="secure_hash") && ($key != "vpc_SecureHashType")) { $conn->addDigitalOrderField($key, $value); } } // Obtain a one-way hash of the Digital Order data and // check this against what was received. $serverSecureHash = array_key_exists("secure_hash", $_GET)? $_GET["secure_hash"] : ""; $secureHash = $conn->hashAllFields(); if ($secureHash==$serverSecureHash) { //two are the same } else { //two are different }