-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpaymentfail.php
65 lines (57 loc) · 1.77 KB
/
paymentfail.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
$title="Payment Fail | Taalem | Online Course Learning";
require_once 'header.php';
if (empty($_SESSION['totalval'])) {
header("location:index.php");
}
$msg;
$upst;
$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=getenv('salt');
// 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 = hash("sha512", $retHashSeq);
if ($hash != $posted_hash) {
echo "Invalid Transaction. Please try again";
} else {
$upst=true;
$_SESSION['totalval']="";
}
?>
<section class="payment-form dark">
<div class="container">
<div class="block-heading">
<h2>Payment</h2>
</div>
<form>
<div class="card-details compare-card">
<h3 class="title">Payment Status</h3>
<div class="row">
<div class="col-sm-12">
<?php if(isset($upst) and $upst): ?>
<h1 class="text-center">Payment Fail</h1>
<div class="text-center mt-5">
<a href="usercourse.php" class="btn btn-custom">Go to MyCourse</a>
</div>
<?php endif ?>
</div>
</div>
</div>
</form>
</div>
</section>
<?php require_once 'footer.php'; ?>
</body>
</html>