<?php
include('../inc/conf.php');
//if ($_SERVER['REMOTE_ADDR'] != '37.59.221.230') return;
if (isset($_POST['m_operation_id']) && isset($_POST['m_sign']))
{
$m_key = $p_key;
$arHash = array($_POST['m_operation_id'],
$_POST['m_operation_ps'],
$_POST['m_operation_date'],
$_POST['m_operation_pay_date'],
$_POST['m_shop'],
$_POST['m_orderid'],
$_POST['m_amount'],
$_POST['m_curr'],
$_POST['m_desc'],
$_POST['m_status'],
$m_key);
$sign_hash = strtoupper(hash('sha256', implode(':', $arHash)));
if ($_POST['m_sign'] == $sign_hash && $_POST['m_status'] == 'success')
{
$dt = time();
$pa = mysqli_fetch_assoc(mysqli_query($connect_db, "SELECT id,usr FROM t_ca WHERE ba = '$_POST[m_orderid]' AND ty = '1' AND st = '0' LIMIT 1"));
$usr = $pa['usr'];
if ($usr > 0) {
mysqli_query($connect_db, "UPDATE `t_users` SET `bal` = `bal`+'$_POST[m_amount]' WHERE uid = '$usr'");
mysqli_query($connect_db, "UPDATE `t_ca` SET `st` = '1' WHERE ba = '$_POST[m_orderid]' LIMIT 1");
}
echo $_POST['m_orderid'].'|success';
exit;
}
echo $_POST['m_orderid'].'|error';
}
?>