-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpayscript.php
69 lines (64 loc) · 2.41 KB
/
payscript.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
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$total = $_POST['total'];
$plan = $_POST['plan'];
$mobile = $_POST['mobile'];
$address = $_POST['address'];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Confirm to Pay</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="pay.css">
</head>
<body>
<div class="container">
<div class="parent_main">
<h2 class="h3 text-center">Click the Pay button for payment!</h2>
<div>
<button class="btn btn-success" id="rzp-button1">Pay with Razorpay</button>
</div>
</div>
</div>
<script src="https://checkout.razorpay.com/v1/checkout.js"></script>
<script>
var options = {
"key": "Your API Key Here", // Enter the Key ID generated from the Dashboard
"amount": "<?php echo $total * 100; ?>", // Amount is in currency subunits. Default currency is INR. Hence, 50000 refers to 50000 paise
"currency": "INR",
"name": "Your Company Name",
"description": "Transaction for <?php echo $plan; ?>",
"image": "https://example.com/your_logo",
//"order_id": " //echo(rand(10,100));", //This is a sample Order ID. Pass the `id` obtained in the response of Step 1
"callback_url": "thankyou.html",
"prefill": {
"name": "<?php echo $name; ?>",
"email": "<?php echo $email; ?>",
"contact": "<?php echo $mobile; ?>"
},
"notes": {
"address": "<?php echo $address; ?>"
},
"theme": {
"color": "#3399cc"
}
};
var rzp1 = new Razorpay(options);
document.getElementById('rzp-button1').onclick = function(e) {
rzp1.open();
e.preventDefault();
}
</script>
<script>
window.onload = function() {
document.getElementById('rzp-button1').click();
}
</script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>