-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpayment.js
29 lines (21 loc) · 980 Bytes
/
payment.js
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
let payment = localStorage.getItem("finalAmount");
let amountls = document.querySelector("#lsAmount");
amountls.innerText = "Payable Amount :"+" ₹"+payment+"/-";
document.querySelector("#payForm").addEventListener("click",handlePayment);
function handlePayment(event){
event.preventDefault();
let holderName = document.querySelector("#holdName").value;
console.log(holderName)
let cardNum = document.querySelector("#CardNumber").value;
console.log(cardNum)
let cvvCode = document.querySelector("#cvv").value;
console.log(cvvCode)
if(holderName=="" || cardNum=="" || cvvCode==""){
alert("Please Fill all details!")
}else if(cardNum =="1234567812345678" && cvvCode == "321"){
alert("Wohoo, Payment Successful!")
location.href = "./order.html";
}else if(cardNum !="1234567812345678" || cvvCode != '321'){
alert("Wrong Credentials, Please Check again!")
}
}