asdf
This commit is contained in:
@@ -81,22 +81,24 @@ class Belevo_Bezahl_Modul extends IPSModule
|
||||
|
||||
paymentRequest.on("token", function(ev) {
|
||||
// Send the token to your server to charge it!
|
||||
fetch("/charges", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({token: ev.token.id}),
|
||||
}).then(function(response) {
|
||||
if (response.ok) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", "/api/");
|
||||
xhr.setRequestHeader("Content-Type", "application/json");
|
||||
xhr.send(JSON.stringify({
|
||||
"jsonrpc": "2.0",
|
||||
"method": "SetValue",
|
||||
"params": [' . $this->GetIDForIdent("AmountIsReserved") . ', true],
|
||||
"id": 0
|
||||
}));
|
||||
xhr.onload = function() {
|
||||
if (xhr.status === 200) {
|
||||
ev.complete("success");
|
||||
SetValueBoolean(' . $this->GetIDForIdent("AmountIsReserved") . ', true);
|
||||
IPS_LogMessage("Belevo_Bezahl_Modul", "Reservierung erfolgreich.");
|
||||
} else {
|
||||
ev.complete("fail");
|
||||
IPS_LogMessage("Belevo_Bezahl_Modul", "Reservierung fehlgeschlagen.");
|
||||
}
|
||||
});
|
||||
};
|
||||
});
|
||||
</script>
|
||||
<div id="payment-request-button"></div>';
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"compatibility": {
|
||||
"version": "7.1"
|
||||
},
|
||||
"version": "1.008",
|
||||
"version": "1.009",
|
||||
"build": 0,
|
||||
"date": 0
|
||||
}
|
||||
Reference in New Issue
Block a user