54 lines
2.0 KiB
PHP
54 lines
2.0 KiB
PHP
<?
|
|
$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
|
|
|
|
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) {
|
|
$('#error').html('Ñóììà äîëæíà áûòü áîëüøå '+min);
|
|
$('#submit').attr("disabled", "disabled");
|
|
return false;
|
|
} else {
|
|
$('#error').html('');
|
|
}
|
|
if (desc.length < 1) {
|
|
$('#error').html('Íåîáõîäèìî ââåñòè íîìåð çàÿâêè');
|
|
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>
|
|
|
|
<h2>Îïëàòà ÷åðåç <a href="https://wwww.free-kassa.ru">free-kassa.ru</a></h2>
|
|
<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?>">
|
|
<input type="text" name="oa" id="sum" id="oa" onchange="calculate()" onkeyup="calculate()" onfocusout="calculate()" onactivate="calculate()" ondeactivate="calculate()"> Ââåäèòå ñóììó äëÿ îïëàòû
|
|
<input type="hidden" name="s" id="s" value="0">
|
|
<br>
|
|
<input type="text" name="o" id="desc" value="" onchange="calculate()" onkeyup="calculate()" onfocusout="calculate()" onactivate="calculate()" ondeactivate="calculate()"> Íîìåð çàÿâêè*
|
|
<br>
|
|
<input type="submit" id="submit" value="Îïëàòèòü" disabled>
|
|
</form>
|
|
|