При создании платежа пишет
Подпись запроса "ik_sign" не верна
Я уже все перепроверил, в чем может быть проблема?
Сам скрипт >
result.php
<?php
define("TKM", true);
require(realpath("../../engine.php"));
if ($_SERVER['REQUEST_METHOD'] == "POST") {
function ikSign($params, $ikKey) {
unset($params['ik_sign']);
foreach ($params as $key => $value)
if (!preg_match("/^ik_/is", $key))
unset($params[$key]);
ksort($params, SORT_STRING);
array_push($params, $ikKey);
$signString = implode(":", $params);
$sign = base64_encode(md5($signString, true));
return $sign;
}
$kassaId = trim($_POST['ik_co_id']);
$PayID = trim(strip_tags($_POST['ik_pm_no']));
$summ = intval($_POST['ik_am']);
$paySystem = trim($_POST['ik_pw_via']);
$payStatus = trim($_POST['ik_inv_st']);
$sign = trim($_POST['ik_sign']);
$ik_payment_timestamp = trim($_POST['ik_inv_prc']);
$secretKey = $123['settings']['secret_key'];
$PayID = explode("_", $PayID);
$PayID = $PayID['1'];
if ($123['settings']['testing'] && ($paySystem == "test_123_test_xts")) {
$secretKey = $123['settings']['testing_key'];
} elseif ($paySystem == "test_123_test_xts") {
exit("OK");
}
if ($kassaId != $interkasa['settings']['shop_id']) {
exit("Not valid shop ID!");
}
if ($sign != ikSign($_POST, $secretKey)) {
exit("Bad sign");
}
$payment = new Payment;
$status = $payment->select($PayID, $summ);
if (!$status) {
exit($status);
}
$status = $payment->give();
if (!$status) {
exit($status);
}
}
exit("OK");
form.php
<?php
if (!defined("TKM")) die("<pre>Access denied!</pre>");
//$sign = md5($123['settings']['secret_key'].md5($123['settings']['shop_id'].':'.$cost.':RUB:'.$desc.':'.$payid.'::::'.$интеркасса['settings']['secret_key']));
$sign = base64_encode(md5(implode(':', [
'ik_am' => $cost,
'ik_co_id' => $123['settings']['shop_id'],
'ik_cur' => 'RUB',
'ik_desc' => $desc,
'ik_pm_no' => 'ID_'.$payid,
'secret_key' => $123['settings']['secret_key']
]), true));
exit(header("Location: https://sci.123/?ik_co_id={$123['settings']['shop_id']}&ik_pm_no=ID_{$payid}&ik_am={$cost}&ik_cur=RUB&ik_desc={$desc}&ik_sign={$sign}"));