-
Notifications
You must be signed in to change notification settings - Fork 0
/
payment.html
181 lines (161 loc) · 3.69 KB
/
payment.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Payment Checkout Form</title>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.2/css/all.css">
<style>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Ubuntu', sans-serif;
}
body{
background: #2196F3;
margin: 0 10px;
}
.payment{
background: #f8f8f8;
max-width: 360px;
margin: 80px auto;
height: auto;
padding: 35px;
padding-top: 70px;
border-radius: 5px;
position: relative;
}
.payment h2{
text-align: center;
letter-spacing: 2px;
margin-bottom: 40px;
color: #0d3c61;
}
.form .label{
display: block;
color: #555555;
margin-bottom: 6px;
}
.input{
padding: 13px 0px 13px 25px;
width: 100%;
text-align: center;
border: 2px solid #dddddd;
border-radius: 5px;
letter-spacing: 1px;
word-spacing: 3px;
outline: none;
font-size: 16px;
color: #555555;
}
.card-grp{
display: flex;
justify-content: space-between;
}
.card-item{
width: 48%;
}
.space{
margin-bottom: 20px;
}
.icon-relative{
position: relative;
}
.icon-relative .fas,
.icon-relative .far{
position: absolute;
bottom: 12px;
left: 15px;
font-size: 20px;
color: #555555;
}
.btn{
margin-top: 40px;
background: #2196F3;
padding: 12px;
text-align: center;
color: #f8f8f8;
border-radius: 5px;
cursor: pointer;
}
@media screen and (max-width: 420px){
.card-grp{
flex-direction: column;
}
.card-item{
width: 100%;
margin-bottom: 20px;
}
.btn{
margin-top: 20px;
}
}
</style>
</head>
<body>
<div class="wrapper">
<div class="payment">
<div class="payment-logo">
<p></p>
</div>
<h2>Payment Gateway</h2>
<div class="form">
<div class="card space icon-relative">
<label class="label">Card holder:</label>
<input type="text" class="input" placeholder="Holder Name" id="input1">
<i class="fas fa-user"></i>
</div>
<div class="card space icon-relative">
<label class="label">Card number:</label>
<input type="number" class="input" data-mask="0000 0000 0000 0000" placeholder="Card Number" id="input2">
<i class="far fa-credit-card"></i>
</div>
<div class="card-grp space">
<div class="card-item icon-relative">
<label class="label">Expiry date:</label>
<input type="text" name="expiry-data" class="input" data-mask="00 / 00" placeholder="00 / 00" id="input3">
<i class="far fa-calendar-alt"></i>
</div>
<div class="card-item icon-relative">
<label class="label">CVC:</label>
<input type="text" class="input" data-mask="000" placeholder="000" id="input4">
<i class="fas fa-lock"></i>
</div>
</div>
<div class="btn" id="btn">
Pay
</div>
</div>
</div>
</div>
</body>
</html>
<script>
document.querySelector("#btn").addEventListener("click",function(){
let name = document.querySelector("#input1").value
let number = document.querySelector("#input2").value
let date = document.querySelector("#input3").value
let cvc = document.querySelector("#input4").value
let obj = {
name,
number,
date,
cvc,
}
if(obj.name == "" || obj.number == "" || obj.date == "" || obj.cvc == ""){
alert("Please fill all the details")
}
else if(obj.name == "Suraj Singh" && obj.number == "1234" && obj.date == "10/11" && obj.cvc == "4321")
{
let otp = prompt("Enter Otp")
if(otp == 1234){
alert("Payment Complete")
window.location.href = "index.html"
}else{
alert("Otp is Wrong, Check the Otp you entered")
}
}else{
alert("Check The Details U Entered")
}
})
</script>