Не получается подключить free kassa

A1
На сайте с 14.05.2020
Offline
0
297

Когда режим интеграции с робокасой включен пишет ошибку - Неверная электронная подпись#1 (но сумму цепляет)

Когда режим интеграции отключен (ставлю нет) пишет ошибку - сумма платежа указана неверно (сумму не цепляет)

В чем косяк не знаю. Я уже голову сломала.:confused: Помогите все настроить пожалуйстоооо.

Есть три файла

файл callback

<?php


session_start();
define('unisitecms', true);

include_once("../../../systems/config.php");
include_once("{$_SERVER['DOCUMENT_ROOT']}/systems/classes/UniSite.php");

$languages_content = json_decode( ob_get($_SERVER["DOCUMENT_ROOT"]."/lang/".$settings["lang_site_default"].".php"), true );

$title_payment = $languages_content["payment-replenishment-title"];
$param = paymentParams('robokassa');
$bonus = bonusProgram("balance_profile");

if($param["test"] == 1){
$param["pass2"] = $param["test_pass2"];
}

$out_summ = $_REQUEST["OutSum"];
$inv_id = $_REQUEST["InvId"];
$crc = strtoupper($_REQUEST["SignatureValue"]);

$my_crc = strtoupper(md5("$out_summ:$inv_id:".$param["pass2"].":Shp_id_user=".$_REQUEST["Shp_id_user"]));

if ($my_crc != $crc)
{
echo "bad sign\n";
exit();
}


$Profile->profileBalance(array("id_user"=>intval($_REQUEST["Shp_id_user"]),"summa"=>round($out_summ,2),"method"=>"RoboKassa","title"=>$title_payment,"id_order"=>$inv_id),"+");

if($bonus["procent"]){
$summa = (($out_summ / 100) * $bonus["procent"]);
$Profile->profileBalance(array("id_user"=>intval($_REQUEST["Shp_id_user"]),"summa"=>round($summa,2),"method"=>"RoboKassa","title"=>$bonus["title"],"id_order"=>$inv_id),"+");
}

echo "OK$inv_id\n";

?>

файл form

<?php


$out_summ = number_format($summa, 2, ".", "");

if($param["test"] == 1){
$param["pass1"] = $param["test_pass1"];
$test = '<input type=hidden name=IsTest value=1>';
}

$shp_item = 1;
$in_curr = "";
$culture = "ru";
$encoding = "utf-8";

$OutSumCurrency = $param["curr"];

$param["id_shop"] = strtolower($param["id_shop"]);

$crc = md5($param["id_shop"].":$out_summ:$format_order:$OutSumCurrency:{$param["pass1"]}:Shp_id_user={$_SESSION['profile']['id']}");

print
"<form action='https://www.free-kassa.ru/merchant/cash.php' method=POST>".
"<input type=hidden name=MrchLogin value={$param["id_shop"]}>".
"<input type=hidden name=OutSum value=$out_summ>".
"<input type=hidden name=InvId value=$format_order>".
"<input type=hidden name=Desc value='{$title_payment}'>".
"<input type=hidden name=SignatureValue value=$crc>".

"<input type=hidden name=IncCurrLabel value=$in_curr>".
"<input type=hidden name=Culture value=$culture>".

"<input type=hidden name=ExpirationDate value=>".
"<input type=hidden name=OutSumCurrency value=$OutSumCurrency>".
"<input type=hidden name=Shp_id_user value={$_SESSION['profile']['id']}>"
.$test.
"<input type=submit value='Pay' class='pay-trans' >".
"</form>";
?>

файл inputs

<div class="param-payment" >


<div class="form-group row d-flex align-items-center mb-5">
<label class="col-lg-3 form-control-label"><?php echo $lang["payment_title1"]; ?></label>
<div class="col-lg-5">
<span><?php echo URL; ?>systems/payment/<?php echo $sql["code"]; ?>/callback.php</span>
</div>
</div>

<div class="form-group row d-flex align-items-center mb-5">
<label class="col-lg-3 form-control-label"><?php echo $lang["payment_title2"]; ?></label>
<div class="col-lg-5">
<label>
<input class="toggle-checkbox" type="checkbox" <?php if($param["test"] == 1){ echo ' checked=""'; } ?> name="payment_param[test]" value="1" >
<span><span></span></span>
</label>
</div>
</div>

<div class="form-group row d-flex align-items-center mb-5">
<label class="col-lg-3 form-control-label">Testing password 1</label>
<div class="col-lg-5">
<input type="text" class="form-control" value="<?php echo $param["test_pass1"]; ?>" name="payment_param[test_pass1]" >
</div>
</div>

<div class="form-group row d-flex align-items-center mb-5">
<label class="col-lg-3 form-control-label">Testing password 2</label>
<div class="col-lg-5">
<input type="text" class="form-control" value="<?php echo $param["test_pass2"]; ?>" name="payment_param[test_pass2]" >
</div>
</div>

<div class="form-group row d-flex align-items-center mb-5">
<label class="col-lg-3 form-control-label">ID Shop</label>
<div class="col-lg-5">
<input type="text" class="form-control" value="<?php echo $param["id_shop"]; ?>" name="payment_param[id_shop]" >
</div>
</div>

<div class="form-group row d-flex align-items-center mb-5">
<label class="col-lg-3 form-control-label">Password 1</label>
<div class="col-lg-5">
<input type="text" class="form-control" value="<?php echo $param["pass1"]; ?>" name="payment_param[pass1]" >
</div>
</div>

<div class="form-group row d-flex align-items-center mb-5">
<label class="col-lg-3 form-control-label">Password 2</label>
<div class="col-lg-5">
<input type="text" class="form-control" value="<?php echo $param["pass2"]; ?>" name="payment_param[pass2]" >
</div>
</div>

<div class="form-group row d-flex align-items-center mb-5">
<label class="col-lg-3 form-control-label"><?php echo $lang["payment_title3"]; ?></label>
<div class="col-lg-5">

<select name="payment_param[curr]" class="selectpicker" >
<option <?php if($param["curr"] == "RUR"){ echo ' selected=""'; } ?> value="RUR" >RUR</option>
<option <?php if($param["curr"] == "USD"){ echo ' selected=""'; } ?> value="USD" >USD</option>
<option <?php if($param["curr"] == "EUR"){ echo ' selected=""'; } ?> value="EUR" >EUR</option>
<option <?php if($param["curr"] == "UAH"){ echo ' selected=""'; } ?> value="UAH" >UAH</option>
<option <?php if($param["curr"] == "KZT"){ echo ' selected=""'; } ?> value="KZT" >KZT</option>
</select>

</div>
</div>

<div class="form-group row d-flex align-items-center mb-5">
<label class="col-lg-3 form-control-label"><?php echo $lang["payment_title4"]; ?></label>
<div class="col-lg-5">
<input type="text" class="form-control" value="<?php echo $param["link_success"]; ?>" name="payment_param[link_success]" >
</div>
</div>

<div class="form-group row d-flex align-items-center mb-5">
<label class="col-lg-3 form-control-label"><?php echo $lang["payment_title5"]; ?></label>
<div class="col-lg-5">
<input type="text" class="form-control" value="<?php echo $param["link_cancel"]; ?>" name="payment_param[link_cancel]" >
</div>
</div>


</div>

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий