Fixed Index method, Comm back to back
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user