diff --git a/ServiceAPI/Apps.php b/ServiceAPI/Apps.php index 521b117e..6504c23e 100644 --- a/ServiceAPI/Apps.php +++ b/ServiceAPI/Apps.php @@ -54,6 +54,11 @@ class Apps implements Handler $reject("No application with this id found"); return; } + + if($amount < 0) { + $reject(552, "Payment amount is invalid"); + return; + } $coinsLeft = $this->user->getCoins() - $amount; if($coinsLeft < 0) { diff --git a/Web/static/js/al_games.js b/Web/static/js/al_games.js index 78bd738c..63994b83 100644 --- a/Web/static/js/al_games.js +++ b/Web/static/js/al_games.js @@ -142,6 +142,8 @@ function handlePayment(event) { ok: false, error: "negative sum" }, '*'); + + return; } MessageBox(