<?php

require_once '../../wcore/core.php';

$key = '20CB83A3-CD8B-4929-88D2-8EEF3B8F6208';

$wmr_koch = $_POST['LMI_PAYEE_PURSE']; 
$summa = $_POST['LMI_PAYMENT_AMOUNT']; 
$wmidpokupatela = $_POST['LMI_PAYER_WM']; 
$id_user = intval($_POST['id_user']);

$chkstring = 'R126007994854'
.$_POST['LMI_PAYMENT_AMOUNT']
.$_POST['LMI_PAYMENT_NO']
.$_POST['LMI_MODE']
.$_POST['LMI_SYS_INVS_NO']
.$_POST['LMI_SYS_TRANS_NO']
.$_POST['LMI_SYS_TRANS_DATE']
.$key
.$_POST['LMI_PAYER_PURSE']
.$_POST['LMI_PAYER_WM'];
$md5sum = strtoupper(hash("sha256", $chkstring));

if ($md5sum != $_POST['LMI_HASH']) exit();

if (isset($_POST['LMI_PREREQUEST'])) {

mysql_query("UPDATE `users` SET `money` = `money` + '".$summapost."' WHERE `id` = '".$id_user."' LIMIT 1 "); // ПРИБАВЛЕНИЕ ЮЗЕРУ МОНЕТ 

echo 'YES';

}