-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpayment.php
More file actions
98 lines (93 loc) · 3.72 KB
/
payment.php
File metadata and controls
98 lines (93 loc) · 3.72 KB
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
session_start();
$name = $_SESSION['name'];
$amt = $_SESSION['amt'];
$email = $_SESSION['email'];
$contact = $_SESSION['contact'];
$country = $_SESSION['country'];
$city = $_SESSION['city'];
?>
<html>
<head>
<title>Light-De-Literacy</title>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="icon" type="image/x-icon" href="images/favicon.ico">
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://checkout.razorpay.com/v1/checkout.js"></script>
</head>
<body>
<section>
</section>
<script type="text/javascript">
pay_now();
function changebg()
{
const images = [
'url("images/1.jpg")',
'url("images/2.jpg")',
'url("images/3.jpeg")',
'url("images/4.jpg")',
'url("images/5.jpg")',
'url("images/6.jpg")',
'url("images/7.jpg")',
'url("images/8.jpg")',
'url("images/9.png")',
'url("images/10.jpg")'];
const section = document.querySelector('section');
const bg = images[Math.floor(Math.random() * images.length)];
section.style.backgroundImage = bg;
}
function pay_now()
{
<?php
echo "var name ='$name';";
echo "var amt ='$amt';";
echo "var email ='$email';";
echo "var country ='$country';";
echo "var city ='$city';";
echo "var contact ='$contact';";
?>
jQuery.ajax({
type:'post',
url:'payment_process.php',
data:"amt="+amt+"&name="+name,
success:function(result){
var options = {
"key": "",
"amount": amt*100,
"currency": "INR",
"name": "Light-De-Literacy",
"description": "One step towards girls education!!",
"image":
"https://www.lightdeliteracy.com/wp-content/uploads/2017/05/logo-image.png",
"handler": function (response){
jQuery.ajax({
type:'post',
url:'payment_process.php',
data:"payment_id="+response.razorpay_payment_id,
success:function(result){
window.location.href="thankyou.php";
}
});
},
"prefill": {
"name": name,
"email": email,
"contact": contact
},
"notes": {
"address": city+", "+country
},
"theme": {
"color": "#3399cc"
}
};
var rzp1 = new Razorpay(options);
rzp1.open();
}
});
}
setInterval(changebg,3000);
</script>
</body>
</html>