-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhotel_pay_success.php
executable file
·44 lines (38 loc) · 1.38 KB
/
hotel_pay_success.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
33
34
35
36
37
38
39
40
41
42
43
44
<?php require_once("includes/session.php");?>
<?php require_once("includes/db_connection.php");?>
<?php require_once("includes/functions.php");?>
<?php
$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="6XG2QugoqF";
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 "Invalid Transaction. Please try again";
} else {
if ($status=="success") {
$update_query = "UPDATE delegates SET hotel_pay_status = 1, pay_type = 1 WHERE id = {$firstname} LIMIT 1";
$update_result = mysqli_query($conn, $update_query);
confirm_query($update_result);
if ($update_result) {
redirect_to("del_hotel_conf_mail.php?del_id=$firstname");
}
}
}
?>
<?php
if (isset ($conn)){
mysqli_close($conn);
}
?>