Created
October 30, 2019 15:57
-
-
Save deepak140596/fc43b79de65f58d7aa5a667001094f98 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include'config/db.php'; // Your database connection file if needed | |
$status=$_POST["status"]; | |
$firstname=$_POST["firstname"]; | |
$amount=$_POST["amount"]; | |
$txnid=$_POST["txnid"]; | |
$posted_hash=$_POST["hash"]; | |
$key=$_POST["key"]; | |
$productinfo=$_POST["productinfo"]; | |
$email=$_POST["email"]; | |
$salt=""; // PLACE YOUR SALT KEY HERE | |
// Salt should be same Post Request | |
if(isset($_POST["additionalCharges"])){ | |
$additionalCharges=$_POST["additionalCharges"]; | |
$retHashSeq = $additionalCharges.'|'.$salt.'|'.$status.'|||||||||||'.$email.'|'.$firstname.'|'.$productinfo.'|'.$amount.'|'.$txnid.'|'.$key; | |
}else{ | |
$retHashSeq = $salt.'|'.$status.'|||||||||||'.$email.'|'.$firstname.'|'.$productinfo.'|'.$amount.'|'.$txnid.'|'.$key; | |
} | |
$hash = strtolower(hash('sha512', $retHashSeq)); // NOTE: THIS PART IN YOUR KIT MAY HAVE AN ERROR. THERE YOU MIGHT GET $hash_string instead of $retHashSeq. JUST REPLACE $hash_string with $retHashSeq. | |
if($hash != $posted_hash){ | |
// Transaction completed but is Invalid as Hash Values are not Matching. Notify Admin. | |
//header('Location: fail.php'); | |
//exit(); | |
}else{ | |
// Transaction is Valid. Process orders here. | |
//header('Location: thanks.php'); | |
//exit(); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment