Fixed Index method, Comm back to back

This commit is contained in:
Cédric
2025-12-08 11:40:44 +01:00
parent 54c16c24b7
commit 9cdbcc3734
5 changed files with 19 additions and 13 deletions

View File

@@ -85,17 +85,20 @@
let token = document.getElementById("token-input").value;
await fetch("/payement", {
let dataToken = {
token: token
};
await fetch("/payment", {
method: "POST",
headers: {
"Content-Type": "application/json"
//"Authorization" : "username:password"
},
body: JSON.stringify(token)
body: JSON.stringify(dataToken)
})
.then(response => {
if (response.ok) {
//Logique à executer si serveur répond avec 200 HTTP
} else {
throw new Error("Payment request failed")
}