diff --git a/Belevo_Bezahl_Modul/module.php b/Belevo_Bezahl_Modul/module.php index 1949486..85b6ecf 100644 --- a/Belevo_Bezahl_Modul/module.php +++ b/Belevo_Bezahl_Modul/module.php @@ -29,84 +29,85 @@ class Belevo_Bezahl_Modul extends IPSModule $apiKey = "pk_test_51Qkr79LJAcsNrpivA90lt7ULEzyXKR8l0pAqTBgfeuAIWlsLS4A3BdIBITc9UooFANbImvlJQ2F2jOZ0X5j8GI7Q00hNNasvQm"; // Test-API-Schlüssel $html = ' -
- - - - - - - + + + + + + - - '; + function getAmount() { + 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") . ', false], + "id": 0 + })); + xhr.onload = function() { + if (xhr.status === 200) { + console.log("Abzug erfolgreich."); + } else { + console.log("Abzug fehlgeschlagen."); + } + }; + } + +