-
Notifications
You must be signed in to change notification settings - Fork 0
/
success.php
80 lines (64 loc) · 2.12 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
include('config.php');
session_start();
if(!empty($_GET))
{
$_SESSION['product'] = $_GET['item_name'];
$_SESSION['txn_id'] = $_GET['tx'];
$_SESSION['amount'] = $_GET['amt'];
$_SESSION['currency'] = $_GET['cc'];
$_SESSION['status'] = $_GET['st'];
$_SESSION['payer_id'] = $_GET['payer_id'];
$_SESSION['payer_email'] = $_GET['payer_email'];
$_SESSION['payer_name'] = $_GET['first_name'].' '.$_GET['last_name'];
date_default_timezone_set('Asia/Kolkata');
$sql="insert into payments (payment_id,payer_id,payer_name,payer_email,item_id,item_name,currency,amount,status,created_at) values ('".$_SESSION['txn_id']."','".$_SESSION['payer_id']."','".$_SESSION['payer_name']."','".$_SESSION['payer_email']."','','".$_SESSION['product']."','".$_SESSION['currency']."','".$_SESSION['amount']."','". $_SESSION['status']."','".date('y-m-d h:i:s')."')";
$result=mysqli_query($conn,$sql);
if($result)
{
header('location:success.php');
}
else
{
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Success</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/js/bootstrap.bundle.min.js"></script>
</head>
<body>
<div class="container mt-3">
<div class="alert alert-success">
<strong>Success!</strong> Payment has been successful
</div>
<table class="table table-bordered">
<tbody>
<tr>
<td>Transaction Id</td>
<td><?php echo $_SESSION['txn_id'];?></td>
</tr>
<tr>
<td>Product Name</td>
<td><?php echo $_SESSION['product'];?></td>
</tr>
<tr>
<td>Amount</td>
<td><?php echo $_SESSION['amount'];?></td>
</tr>
<tr>
<td>Payment Status</td>
<td><?php echo $_SESSION['status'];?></td>
</tr>
</tbody>
<a href="orders.php" class="option-btn">continue shopping</a>
</table>
</div>
</body>
</html>