This page was made as a personal project in connection with an educational exercise.
This is NOT the official site of the company or brand identified on the page. The creator of this page is NOT affiliated with the company or brand in any way. DO NOT enter any personal information (such as logins, passwords or credit card numbers) on this site.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpayment.html
180 lines (149 loc) · 5.65 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
<!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</title>
<style>
#j_main{
width: 50%;
margin: auto;
height: 320px;
/* border: 1px solid black; */
display: flex;
justify-content: space-between;
}
h1{
text-align: center;
color: #fc2779;
}
#j_main>div:first-child{
width: 30%;
/* border: 2px solid green; */
box-shadow: rgba(9, 30, 66, 0.25) 0px 4px 8px -2px, rgba(9, 30, 66, 0.08) 0px 0px 0px 1px;
padding: 10px 10px 20px 10px;
}
#j_main>div:last-child{
width: 60%;
/* border: 5px solid blue; */
box-shadow: rgba(9, 30, 66, 0.25) 0px 4px 8px -2px, rgba(9, 30, 66, 0.08) 0px 0px 0px 1px;
padding: 10px 10px 20px 10px;
}
#options>div{
width: 100%;
height: 40px;
border: 1px solid lightgrey;
font-size: large;
color: gray;
}
#card, #expiry{
width: 100%;
height: 40px;
border: 1px solid lightgray;
margin-bottom: 5px;
}
#submit{
width: 80%;
height: 40px;
background-color: #fc2779;
font-size: large;
border-radius: 30px;
border: 0;
margin-left: 40px;
margin-top: 10px;
text-align: center;
color: white;
}
input,button,select,option{
height: 20px;
}
#payment{
width: 100px;
height: 28px;
background-color: #fc2779;
color: white;
border: 0;
}
</style>
</head>
<body>
<h1>CHOOSE PAYMENT METHOD</h1>
<div id="j_main">
<div id="options">
<div>Credit/Debit Card (Default)</div>
<div>UPI</div>
<div>Google Pay</div>
<div>Net Banking</div>
<div>Mobile Wallets</div>
<div>Cash on Delivery</div>
<div>Gift Card</div>
</div>
<div id="j_payment">
<!-- <input type="text" name="" id="card" placeholder="Card Number"></br>
<input type="date" name="" id="expiry" placeholder="Expiry"></br>
<input type="checkbox" name="" id="sold">
save this as per RBI guidelines</br>
<input type="text" name="" id="submit" placeholder="pay now"></br> -->
<div id="box2">
<form>
<h3>Card Number*</h3>
<input type="number" id="cardNum">
<h3>Expiration Date</h3>
<select id="MonthName">
<option value="">Month</option>
<option value="January">January</option>
<option value="February">February</option>
<option value="March">March</option>
<option value="April">April</option>
<option value="May">May</option>
<option value="June">June</option>
<option value="Julay">July</option>
<option value="Augest">August</option>
<option value="September">September</option>
<option value="October">October</option>
<option value="November">November</option>
<option value="December">December</option>
</select>
<select id="Year">
<option value="">Year</option>
<option value="2022">2022</option>
<option value="2023">2023</option>
<option value="2024">2024</option>
<option value="2025">2025</option>
<option value="2026">2026</option>
<option value="2027">2027</option>
<option value="2028">2028</option>
<option value="2029">2029</option>
<option value="2030">2030</option>
<option value="2031">2031</option>
<option value="2032">2032</option>
<option value="2033">2033</option>
</select>
<h3>Card Verification Number*</h3>
<input type="Number" placeholder="CVV" id="cvv">
<input type="submit" value="Pay Now" id="payment">
</form>
</div>
</div>
</div>
</body>
</html>
<script>
document.querySelector("form").addEventListener("submit",myFunction)
function myFunction(){
event.preventDefault();
let paymentObj={
cardNumber:document.querySelector("#cardNum").value,
expirydate:document.querySelector("#MonthName").value,
expiryYear:document.querySelector("#Year").value,
cvv:document.querySelector("#cvv").value,
}
if(paymentObj.cardNumber.length!=16){
alert("Invalid Card Number")
}else if(paymentObj.cardNumber==""||paymentObj.cvv==""){
alert("Please fill all the mandatory inputs")
}else{
window.location.href="payment_successful.html"
}}
</script>