game/freekassa2.php

54 lines
2.1 KiB
PHP
Raw Permalink Normal View History

2022-12-19 20:22:19 +00:00
<?
2023-01-10 16:29:32 +00:00
$fk_merchant_id = '65643'; //merchant_id ID мазагина в free-kassa.ru https://free-kassa.ru/merchant/cabinet/help/
$fk_merchant_key = 'qtzl0igb'; //Секретное слово https://free-kassa.ru/merchant/cabinet/profile/tech.php
2022-12-19 20:22:19 +00:00
if (isset($_GET['prepare_once'])) {
$hash = md5($fk_merchant_id.":".$_GET['oa'].":".$fk_merchant_key.":".$_GET['l']);
echo '<hash>'.$hash.'</hash>';
exit;
}
?>
<script src="https://yandex.st/jquery/1.6.0/jquery.min.js"></script>
<script type="text/javascript">
var min = 1;
function calculate() {
var re = /[^0-9\.]/gi;
var url = window.location.href;
var desc = $('#desc').val();
var sum = $('#sum').val();
if (re.test(sum)) {
sum = sum.replace(re, '');
$('#oa').val(sum);
}
if (sum < min) {
2023-01-10 16:29:32 +00:00
$('#error').html('Сумма должна быть больше '+min);
2022-12-19 20:22:19 +00:00
$('#submit').attr("disabled", "disabled");
return false;
} else {
$('#error').html('');
}
if (desc.length < 1) {
2023-01-10 16:29:32 +00:00
$('#error').html('Необходимо ввести номер заявки');
2022-12-19 20:22:19 +00:00
return false;
}
$.get(url+'?prepare_once=1&l='+desc+'&oa='+sum, function(data) {
var re_anwer = /<hash>([0-9a-z]+)<\/hash>/gi;
$('#s').val(re_anwer.exec(data)[1]);
$('#submit').removeAttr("disabled");
});
}
</script>
2023-01-10 16:29:32 +00:00
<h2>Оплата через <a href="https://wwww.free-kassa.ru">free-kassa.ru</a></h2>
2022-12-19 20:22:19 +00:00
<div id="error"></div>
<form method=GET action="https://www.free-kassa.ru/merchant/cash.php">
<input type="hidden" name="m" value="<?=$fk_merchant_id?>">
2023-01-10 16:29:32 +00:00
<input type="text" name="oa" id="sum" id="oa" onchange="calculate()" onkeyup="calculate()" onfocusout="calculate()" onactivate="calculate()" ondeactivate="calculate()"> Введите сумму для оплаты
2022-12-19 20:22:19 +00:00
<input type="hidden" name="s" id="s" value="0">
<br>
2023-01-10 16:29:32 +00:00
<input type="text" name="o" id="desc" value="" onchange="calculate()" onkeyup="calculate()" onfocusout="calculate()" onactivate="calculate()" ondeactivate="calculate()"> Номер заявки*
2022-12-19 20:22:19 +00:00
<br>
2023-01-10 16:29:32 +00:00
<input type="submit" id="submit" value="Оплатить" disabled>
2022-12-19 20:22:19 +00:00
</form>