<div class="container marg_top"  >
<div class="row">
<div class="col-md-9   " align="justify"  >


<?php
 $status=$_POST["status"];
$firstname=$_POST["firstname"];
$amount=$_POST["amount"]; //Please use the amount value from database
$txnid=$_POST["txnid"];
$posted_hash=$_POST["hash"];
$key=$_POST["key"];
$productinfo=$_POST["productinfo"];
$email=$_POST["email"];
//$salt="nQ2BZBZzil"; //Please change the value with the live salt for production environment
$salt = "2GPoxwoKZG";

//Validating the reverse hash
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 = hash("sha512", $retHashSeq);
		 
       if ($hash != $posted_hash) {
	       echo "<h3>Transaction has been tampered. Please try again<h3>";
		 echo "<meta http-equiv='refresh' content='2;url=https://www.edansemart.com/Userpage/vieworders' />";
		   }
	   else {
           	   
          echo "<h3>Thank You, " . $firstname .".Your order status is ". $status .".</h3>";
          echo "<h4>Your Transaction ID for this transaction is ".$txnid.".</h4>";
		  
		  
		  if($status=="failure") { 
    
         //redirect('Userpage/payment_response_update/'.$productinfo.'/3');
         echo "<meta http-equiv='refresh' content='5;url=https://www.edansemart.com/Userpage/payment_response_update/".$productinfo."/3' />";
		  }
		  
		 elseif($status=="success") {
       // redirect('Userpage/payment_response_update/'.$productinfo.'/1');
		 echo "<meta http-equiv='refresh' content='5;url=https://www.edansemart.com/Userpage/payment_response_update/".$productinfo."/1' />";
		  }
		  
	    
		  
		  else
		  {
		
	echo "<meta http-equiv='refresh' content='2;url=https://www.edansemart.com/Userpage/vieworders' />";
		  }
		  
      
		  
          
           
		   }         
?>	

</div>





</div>
</div>



