forked from Imesunny/WineProject_Collab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpayment.html
More file actions
101 lines (82 loc) · 2.84 KB
/
payment.html
File metadata and controls
101 lines (82 loc) · 2.84 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
99
100
101
<!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">
<link rel="stylesheet" href="./styles/footer.css">
<title>MineWine: Pay with razor pay</title>
<style>
body{
/* display: flex;
justify-content: center;
background-color: #EEEFEF; */
background-color : hsl(41,100%,96%)rgb(255,248,233);
margin: 0;
padding: 0;
}
#rzp-button1{
width: 200px;
height: 50px;
background-color: #bf0d12;
/* border: 1px solid white; */
border-radius: 0px;
color: white;
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
font-size: 17px;
font-weight: 400;
border: 2px solid black;
}
#rzp-button1:hover{
cursor: pointer;
}
#payDiv{
width: 100%;
height: 400px;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
}
</style>
</head>
<body bgcolor="#fff8e9">
<div id="outermost_container">
<!-- navbar start -->
<div id="header">
<div id="payDiv">
<button id="rzp-button1">Pay with Razor pay</button>
</div>
</div>
</body>
</html>
<script src="https://checkout.razorpay.com/v1/checkout.js"></script>
<script></script>
<script type="module">
let cartItems = JSON.parse(localStorage.getItem("cart")) || [];
let totalAmount = cartItems.reduce((total, item) => total + parseFloat(item.price), 0) * 100;
// // Manually set the exchange rate (1 USD = 75 INR)
// const exchangeRate = 75;
// // Calculate the amount in INR
// const amountInINR = totalAmount * exchangeRate * 100;
var options = {
"key": "rzp_test_gRDqK4ZVKwc1es", // Enter the Key ID generated from the Dashboard
"amount": totalAmount,
"currency": "INR",
"name": "Wine Shop",
"description": "Test Payment",
"image": "https://icon2.cleanpng.com/20171221/kre/wine-bottle-and-glass-png-vector-clipart-5a3bf295a8cd94.2296204215138781656914.jpg",
// "order_id": "order_Ef80WJDPBmAeNt", //Pass the `id` obtained in the previous step
// "account_id": "acc_Ef7ArAsdU5t0XL",
"handler": function (response){
alert(response.razorpay_payment_id);
alert(response.razorpay_order_id);
alert(response.razorpay_signature)
}
};
var rzp1 = new Razorpay(options);
document.getElementById('rzp-button1').onclick = function(e){
rzp1.open();
e.preventDefault();
}
</script>