-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcard_payment.js
More file actions
28 lines (19 loc) · 754 Bytes
/
card_payment.js
File metadata and controls
28 lines (19 loc) · 754 Bytes
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
var cartData = JSON.parse(localStorage.getItem("cartData"));
function pay() {
let selext = document.querySelector("#card_type").value;
let cardNumber = document.querySelector("#card_number").value;
let cvv = document.querySelector("#cvv").value;
let expdate = document.querySelector("#exp_date").value;
if (selext == "" || cardNumber == "" || cvv == "" || expdate == "") {
alert("Please Enter valid Card Details!");
window.location.href = "card_payment.html"
} else {
alert("Payment Done!");
window.location.href = "home.html"
localStorage.removeItem("cartData");
}
}
function cardType() {
let value = document.querySelector("#card_type").value;
return value;
}