forked from KarlaMartinez17/card-validator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
30 lines (20 loc) · 789 Bytes
/
app.js
File metadata and controls
30 lines (20 loc) · 789 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
29
$("#confirm-purchase").click(function (event) {
event.preventDefault();
var inputName = $("#owner").val();
var inputCreditNumber = $("#cardNumber").val();
var inputMonth = $("#monthValue").val();
var inputYear = $("#yearValue").val();
var inputCvv = $("#cvv").val();
console.log(inputName);
console.log(inputCreditNumber);
console.log(inputCvv);
console.log(inputMonth);
console.log(inputYear);
if (!compareAllData(inputName, inputCreditNumber, inputMonth, inputYear, inputCvv, dataClients)) {
console.log("Tarjeta Invalida");
swal("TARJETA RECHAZADA", "Intente de nuevo", "error");
} else {
console.log("Tarjeta Valida");
swal("TARJETA APROBADA", "Gracias por su compra", "success");
}
});