Файл: wenr.online/app/game/result.php
Строк: 17
<?php
$_POST['label']; /// ID платежа
$_POST['amount']; /// Сумма платежа
$_POST['hash']; /// Зашифрованная строка shop_id.amount.secretKey2.label.pay методом sha256
$_POST['method']; /// Способ оплаты
$_POST['pay']; /// Номер платежа в системе мерчанта
$_POST['shop_id']; /// ID кассы
$_POST['time']; ///Возвращает время платежа в формате 2020-03-03T00:26:20+03:00
$hash = hash('sha256',$_POST['shop_id'].$_POST['amount'].'l1PuIXgFbhj5CBU'.$_POST['label'].$_POST['pay']);
if($hash != $_POST['hash']){
exit('NO HASH');
}
$pay = $db->prepare('select * from `balance` where `id` = ?');
$pay -> execute([Clean :: int(base64_decode($_POST['desc']))]);
$pay = $pay -> fetch(PDO :: FETCH_OBJ);
if(!isset($pay->id)) exit('NO');
if($pay->type == 'gold'){
$update = $db->prepare('update `users` set `gold` = `gold` + ? where `user_id` = ?');
$update -> execute([$pay->amount*2,$pay->user]);
$st = $db->prepare('update `balance` set `status` = ? where `id` = ?');
$st -> execute([1,$pay->id]);
}
if($pay->type == 'potion'){
$st = $db->prepare('update `balance` set `status` = ? where `id` = ?');
$st -> execute([1,$pay->id]);
$sql = $db->prepare('insert into `bag` (`name`,`user`,`type`,`dex`,`force`,`hp`,`max_hp`,`mana`,`mana_max`,`img`) values (?,?,?,?,?,?,?,?,?,?)');
$sql -> execute([
'Слезы Инноса',
$pay->user,
'potion',
0,
0,
0,
0,
0,
0,
555
]);
}
exit('200');
?>