<?
require_once('../../../connect/connect.php');
$pu=mysql_query("SELECT * FROM service");
$ppu=mysql_fetch_array($pu);

$id_user=intval($_REQUEST['ik_baggage_fields']);
$summa=floatval($_REQUEST['ik_payment_amount']);

$sing_hash_str = $_REQUEST['ik_shop_id'].':'.
$_REQUEST['ik_payment_amount'].':'.
$_REQUEST['ik_payment_id'].':'.
$_REQUEST['ik_paysystem_alias'].':'.
$_REQUEST['ik_baggage_fields'].':'.
$_REQUEST['ik_payment_state'].':'.
$_REQUEST['ik_trans_id'].':'.
$_REQUEST['ik_currency_exch'].':'.
$_REQUEST['ik_fees_payer'].':'.
$ppu['secret_key'];
$sign_hash = strtoupper(md5($sing_hash_str));
if($_REQUEST['ik_sign_hash'] === $sign_hash) {
	$pdt=1;
} else {
	$pdt=0;
}

if(!$pdt) exit();

$r=mysql_query("SELECT * FROM akk WHERE id_akk='".$id_user."'");
$nr=mysql_num_rows($r);
if(!$nr) exit();

mysql_query("INSERT INTO plateg (summa, id_akk, typ, data, opis)  VALUES ('".$summa."', '".$id_user."', 1, NOW(), 'Пополнение кошелька через Интеркассу')");
include('../../balans.php');
?>