forked from mujhusain/theBodyshop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpayments.html
286 lines (227 loc) · 9.6 KB
/
payments.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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
<!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>Cruelty-Free & Beauty Checkout| The Body Shop</title>
<link rel="shortcut icon" href="img\favicon.png" type="image/x-icon">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://kit.fontawesome.com/64d8096832.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="payments.css">
</head>
<style>
</style>
<body >
<div>
<ul id="navul">
<li id="li1"> <i class="fas fa-chevron-left"></i> Back to Shop</li>
<li style="padding:0px;font-size:34px;text-align: center;">THE BODY SHOP®</li>
</ul>
</div>
<div style="text-align:center"><h2>CHECKOUT</h2></div>
<div id="cont1">
<div id="fdiv">
<p>PAYMENT METHOD:</p>
<br>
<input type="radio" id="cardDetails" value="cardDet" name="paySelector">
<label for="cardDetails">Pay Using Credit Card/ Debit Card/ Net Banking (Ccavenuepay)</label><br>
<div id="cardInp"></div>
<br>
<hr>
<br>
<input type="radio" id="cod" value="cod" name="paySelector">
<label for="cod">Cash On Delivery</label><br>
<div id="codDisp"></div>
<br>
<br>
</div>
</div>
<div id="cont2">
<div id="c2div1"><h3>Order Summery</h3></div>
<div id="c2div2">Cart Subtotal:-----------------------------</div>
<div id="c2div3"></div>
<div id="c2div4">Shipping Charges:--------------------------₹.100<div>3 - 5 Working days- Standard Delivery</div></div>
<div id="c2div5">Order Total (incl. GST):--------------------</div>
<div id="c2div6"></div>
</div>
<div id="imgDisp">
<img src="https://staticbodyshop.gumlet.io/pub/media/wysiwyg/checkout/secured.png" style="margin-left:500px;"/>
<img src="https://staticbodyshop.gumlet.io/pub/media/wysiwyg/checkout/master-card.png"/>
<img src ="https://staticbodyshop.gumlet.io/pub/media/wysiwyg/checkout/visa.png"/>
<img src="https://staticbodyshop.gumlet.io/pub/media/wysiwyg/checkout/american-express.png"/>
</div>
<div id="infdiv">
<div >
<!--
<img src="https://www.gccsl.in/website/images/ccavenue.png"/> -->
<div> © 2021 THE BODY SHOP INTERNATIONAL LIMITED</div>
<div><img src="https://staticbodyshop.gumlet.io/pub/media/wysiwyg/icons/payment_icons.png"/></div>
<div>
<p>® A REGISTERED TRADEMARK OF THE BODY SHOP INTERNATIONAL LIMITED™ A TRADEMARK OF THE BODY SHOP INTERNATIONAL LIMITED ALL RIGHTS RESERVED.</p>
<p>REGISTERED OFFICE: WATERSMEAD, LITTLEHAMPTON, WEST SUSSEX, BN17 6LS, UNITED KINGDOM; REGISTERED IN ENGLAND NO. 1284170</p>
</div>
</div>
</div>
</body>
</html>
<script>
// total billing
// var cart=JSON.parse(localStorage.getItem("cartItem"))||[];
dispTotal();
function dispTotal(){
var total=945
// var total=cart.reduce(function(a,c){
// return a+Number(c.price);
// },0);
document.querySelector("#c2div3").textContent="₹."+total;
var subTotal=0;
subTotal=100+total;
document.querySelector("#c2div6").textContent="₹."+subTotal;
}
// back to shop
document.querySelector("#li1").addEventListener("click",moveShop);
function moveShop(){
window.location.href=("index.html");
}
// card payment
document.querySelector("#cardDetails").addEventListener("click", dispCard);
var count1=0;
var count2=0;
function dispCard(){
count1++;
if(count1==1){
document.querySelector("#codDisp").innerHTML="";
var mdiv=document.createElement("div");
mdiv.setAttribute("id","mdiv");
var img=document.createElement("img");
img.setAttribute("src","https://www.gccsl.in/website/images/ccavenue.png");
img.setAttribute("id","img")
var br4=document.createElement("br");
var card=document.createElement("input");
card.setAttribute("type", "number");
card.setAttribute("id", "card");
card.setAttribute("placeholder","Enter 16 Digit Card Number");
var br1=document.createElement("br");
var cvv= document.createElement("input");
cvv.setAttribute("type", "number");
cvv.setAttribute("id", "cvv");
cvv.setAttribute("placeholder","CVV");
var date=document.createElement("input");
date.setAttribute("type", "month");
date.setAttribute("id", "date");
var br2=document.createElement("br");
var name=document.createElement("input");
name.setAttribute("placeholder", "Enter Name on Card");
name.setAttribute("id","name");
var br3=document.createElement("br");
var btn=document.createElement("button");
btn.setAttribute("id", "button");
btn.textContent="Pay";
btn.addEventListener("click", function(){
cardVer();
});
document.querySelector("#cardInp").append(img,br1,card,br2,cvv,date,br3,name,br4,btn);
count2=0;
}
}
function cardVer(){
var card=document.querySelector("#card").value;
var cvv=document.querySelector("#cvv").value;
var date=document.querySelector("#date").value;
date=date.split("-").map(Number);
if(card.length==16 && cvv=="123"){
document.querySelector("#cardInp").innerHTML="";
var oinp=document.createElement("input");
oinp.setAttribute("placeholder","Enter OTP");
oinp.setAttribute("type","number");
oinp.setAttribute("id", "oinp");
var obtn=document.createElement("button");
obtn.textContent="Submit";
obtn.addEventListener("click",function(){
otpSub();
})
document.querySelector("#cardInp").append(oinp,obtn);
} else {
document.querySelector("#card").value="";
document.querySelector("#cvv").value="";
document.querySelector("#date").value="";
alert("Invalid Card Details");
}
}
function otpSub(){
var oinp=document.querySelector("#oinp").value;
console.log(oinp);
if(oinp=="0000"){
alert("Order Sucessfully Placed");
document.querySelector("#cont1").innerHTML="";
document.querySelector("#cont1").innerHTML="";
var h1=document.createElement("h1");
h1.textContent="Thank You for Ordering from us.";
var h2=document.createElement("h2");
h2.textContent="Order id = 009865412";
var btn=document.createElement("button");
btn.textContent="CONTINUE SHOPPING";
btn.setAttribute("id", "continue");
btn.addEventListener("click",function(){
moveProd();
});
document.querySelector("#cont1").append(h1,h2,btn);
}
}
// cod
document.querySelector("#cod").addEventListener("click", dispCod);
function dispCod(){
count2++;
if(count2==1){
document.querySelector("#cardInp").innerHTML="";
var a=document.createElement("p");
a.textContent="To confirm your Cash on delivery order, Click on the VERIFY button, a 6 digit code will be sent to your mobile number";
var b=document.createElement("button");
b.setAttribute("id","verify")
b.textContent="Verify";
b.addEventListener("click", function(){
otpVer();
});
document.querySelector("#codDisp").append(a,b);
count1=0;
}
}
function otpVer(){
var inp=document.createElement("input");
inp.setAttribute("placeholder", "Enter OTP");
inp.setAttribute("type", "number");
var con=document.createElement("button");
con.setAttribute("id", "codInp");
con.textContent="Confirm";
con.addEventListener("click",function(){
otpCheck();
});
document.querySelector("#codDisp").innerHTML="";
document.querySelector("#codDisp").append(inp,con);
}
function otpCheck(){
var x=document.querySelector("#codDisp>input").value;
if(x=="654321"){
alert("Order Sucessfully Placed");
document.querySelector("#cont1").innerHTML="";
var h1=document.createElement("h1");
h1.textContent="Thank You for Ordering from us";
var h2=document.createElement("h2");
h2.textContent="Order id = 009865412";
var btn=document.createElement("button");
btn.textContent="CONTINUE SHOPPING";
btn.setAttribute("id", "continue");
btn.addEventListener("click",function(){
moveProd();
});
document.querySelector("#cont1").append(h1,h2,btn);
} else {
alert("Invalid OTP Code");
document.querySelector("#codDisp>input").value='';
}
}
function moveProd(){
window.location.href="index.html";
}
</script>