Implement payment page
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
<script>
|
||||
|
||||
let btn = document.getElementById("connect-button");
|
||||
btn.addEventListener("click", () => {
|
||||
btn.addEventListener("click", async () => {
|
||||
let username = document.getElementById("username-field").value;
|
||||
let pwd = document.getElementById("password-field").value;
|
||||
|
||||
@@ -42,20 +42,22 @@
|
||||
password: pwd
|
||||
};
|
||||
|
||||
fetch("/login", {
|
||||
await fetch("/login", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(data)
|
||||
})
|
||||
.then(response => response.text())
|
||||
.then(result => {
|
||||
console.log("Server response:", result);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error("Error:", error);
|
||||
});
|
||||
body: JSON.stringify(data)})
|
||||
.then(response => {
|
||||
if(response.ok) {
|
||||
window.location.href = "/payment";
|
||||
} else {
|
||||
throw new Error("Authentication request failed")
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error("Error:", error);
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
33
assets/pages/payment.html
Normal file
33
assets/pages/payment.html
Normal file
@@ -0,0 +1,33 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>MASI 3DSecure</title>
|
||||
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
header, footer {
|
||||
background: #f4f4f4;
|
||||
padding: 15px;
|
||||
text-align: center;
|
||||
}
|
||||
main {
|
||||
padding: 20px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<main>
|
||||
<h1>Payment page</h1>
|
||||
</main>
|
||||
|
||||
<script>
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user