Файл: payment/index.php
Строк: 103
<?php
declare(strict_types=1);
/* by Метриум (Стэлп) */
require_once '../system/common.php';
require_once '../system/functions.php';
require_once '../system/user.php';
require_once 'sett.php';
if (!$user) { header('Location:/'); exit; }
$title = 'Покупка золота';
require '../system/h.php';
$gold = max(0, (int)($_GET['gold'] ?? 0));
?>
<div class="title">Покупка золота</div>
<div class="content center">У вас: <img src="/images/icon/gold.png" alt=""> <?=n_f((int)$user['g'])?></div>
<?php if (!payment_ready()): ?>
<div class="block_zero center"><span class="grey">Пополнение сейчас недоступно.</span></div>
<div class="menuList"><li><a href="/trade/">← Вернуться</a></li></div>
<?php elseif ($gold > 0 && isset($payment_gold_packages[$gold])):
$amount = payment_amount($payment_gold_packages[$gold]);
$nonce = (string)time();
$signature = hash_hmac('sha256', $payment_merchant_id.'|'.$amount.'|'.$nonce.'|'.(int)$user['id'].'|'.$gold, $payment_secret);
?>
<div class="block center"><b>Пакет: <img src="/images/icon/gold.png" alt=""> <?=$gold?> золота</b><br>Цена: <?=$amount?> руб.</div>
<form method="POST" action="<?=security_html($payment_gateway_url)?>" class="center">
<input type="hidden" name="merchant_id" value="<?=security_html($payment_merchant_id)?>">
<input type="hidden" name="amount" value="<?=security_html($amount)?>">
<input type="hidden" name="nonce" value="<?=security_html($nonce)?>">
<input type="hidden" name="signature" value="<?=security_html($signature)?>">
<input type="hidden" name="user_id" value="<?=(int)$user['id']?>">
<input type="hidden" name="product" value="gold">
<input type="hidden" name="count" value="<?=$gold?>">
<button class="old-btn" type="submit">Перейти к оплате</button>
</form>
<div class="menuList"><li><a href="/payment/">← Выбрать другой пакет</a></li></div>
<?php else:
$i = 0;
foreach ($payment_gold_packages as $key => $value):
$i++;
?>
<div class="main"><div class="block_zero">
<img class="left mr8" src="/images/pay/<?=min($i,10)?>.png" width="50" height="50" alt="">
<b><img src="/images/icon/gold.png" alt=""> <?=n_f((int)$key)?> золота</b><br>
Цена: <b><?=security_html((string)$value)?> руб.</b><div class="clr"></div>
<a class="btn" href="/payment/?gold=<?=(int)$key?>"><span class="end"><span class="label">Купить</span></span></a>
</div></div>
<?php endforeach; endif; require '../system/f.php'; ?>