-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
185 lines (167 loc) · 4.78 KB
/
index.html
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
<!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>Payment Integration</title>
<script src="https://checkout.razorpay.com/v1/checkout.js"></script>
</head>
<style>
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;300;400;500;600&display=swap');
*{
font-family: 'Poppins', sans-serif;
margin:0; padding:0;
box-sizing: border-box;
outline: none; border:none;
text-transform: capitalize;
transition: all .2s linear;
}
.container{
display: flex;
justify-content: center;
align-items: center;
padding:25px;
min-height: 100vh;
background:#2ecc71
}
.container form{
padding:20px;
width:700px;
background: #fff;
box-shadow: 0 5px 10px rgba(0,0,0,.1);
}
.container form .row{
display: flex;
flex-wrap: wrap;
gap:15px;
}
.container form .row .col{
flex:1 1 250px;
}
.container form .row .col .title{
font-size: 20px;
color:#333;
padding-bottom: 5px;
text-transform: uppercase;
}
.container form .row .col .inputBox{
margin: 15px;
}
.container form .row .col .inputBox span{
margin-bottom: 10px;
display: block;
}
.container form .row .col .inputBox input{
width: 100%;
border:1px solid #ccc;
padding:10px 15px;
font-size: 15px;
text-transform: none;
}
.container form .row .col .inputBox input:focus{
border:1px solid #000;
}
.container form .row .col .flex{
display: flex;
gap:15px;
}
.container form .row .col .flex .inputBox{
margin-top: 5px;
}
.container form .row .col .inputBox img{
height: 34px;
margin-top: 5px;
filter: drop-shadow(0 0 1px #000);
}
.submit-btn{
width: 100%;
padding:12px;
font-size: 20px;
font-weight: bold;
background: #186f3d;
color:#fff;
cursor: pointer;
}
.submit-btn:hover{
background: #2ecc71;
}
</style>
<body>
<div class="container">
<form action="">
<div class="row">
<div class="col">
<h3 class="title">billing address</h3>
<div class="inputBox">
<span>Full Name :</span>
<input type="text" placeholder="John Doe" id="Name" required>
</div>
<div class="inputBox">
<span>Phone :</span>
<input type="number" placeholder="Enter 10 digit phone number" id="Phone" required>
</div>
<div class="inputBox">
<span>E-mail :</span>
<input type="email" placeholder="abc@example.com" id="Mail" required>
</div>
<div class="inputBox">
<span>Address :</span>
<input type="text" placeholder="room - street - locality">
</div>
<div class="inputBox">
<span>City :</span>
<input type="text" placeholder="Mumbai">
</div>
<div class="flex">
<div class="inputBox">
<span>Country :</span>
<input type="text" placeholder="India">
</div>
<div class="inputBox">
<span>Zip Code :</span>
<input type="text" placeholder="123 456">
</div>
</div>
<div class="inputBox">
<span>Please enter amount to be paid :</span>
<input type="number" id="amount" name="amount">
</div>
</div>
</div>
</form>
</div>
<div>
<button id="payBtn" type= "submit" class="submit-btn" onclick="makePayment()">Pay Now</button>
</div>
<script>
function makePayment() {
var amount = document.getElementById('amount').value;
var options = {
key: 'rzp_test_vhF6y5mMOrXAZ1',
amount: amount * 100,
currency: 'INR',
name: 'Code Clause',
description: 'Payment Integration',
image: '',
handler: function(response) {
alert('Payment Successful!');
},
prefill: {
name : document.getElementById("Name").value,
email: document.getElementById("Mail").value,
contact: document.getElementById("Phone").value
},
notes: {
address: 'Demo Store Address'
},
theme: {
color: '#6af1a2'
}
};
var rzp = new Razorpay(options);
rzp.open();
}
</script>
</body>
</html>