-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpayment_complete.php
executable file
·32 lines (29 loc) · 1.08 KB
/
payment_complete.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
//echo '<b>Transaction In Process, Please do not reload</b>';
echo '<pre>';
print_r($_POST);
$payment_mode=$_POST['mode'];
$pay_id=$_POST['mihpayid'];
$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"];
$MERCHANT_KEY = "gtKFFx";
$SALT = "eCwWELxi";
$udf5='';
$keyString = $MERCHANT_KEY .'|'.$txnid.'|'.$amount.'|'.$productinfo.'|'.$firstname.'|'.$email.'|||||'.$udf5.'|||||';
$keyArray = explode("|",$keyString);
$reverseKeyArray = array_reverse($keyArray);
$reverseKeyString = implode("|",$reverseKeyArray);
$saltString = $SALT.'|'.$status.'|'.$reverseKeyString;
$sentHashString = strtolower(hash('sha512', $saltString));
if($sentHashString != $posted_hash){
mysqli_query($con,"update order set payment_status='$status', mihpayid='$mihpayid' where txnid='$txnid'");
}else{
mysqli_query($con,"update order set payment_status='$status', mihpayid='$mihpayid' where txnid='$txnid'");
}
?>