<?
$callback_url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];

$data = base64_encode(json_encode(array(
    'public_key'        => $PUBLIC_KEY,
    'sandbox'        => '0',
    'version'        => '3',
    'amount'         => $pay_cost,
    'currency'       => 'RUB',
    'description'    => $pay_desc,
    'order_id'       => base64_encode($pay_id.':'.time()), 
    'result_url'     => $callback_url,
)));

$signature = base64_encode(sha1($PRIVATE_KEY . $data . $PRIVATE_KEY, 1));
?>
<form method="POST" action="https://www.liqpay.com/api/checkout" accept-charset="utf-8">
  <input type="hidden" name="data" value="<?= $data?>">
  <input type="hidden" name="signature" value="<?= $signature?>">
  <button type="submit" class="btn btn-success"><?= __('Оплатить')?> <?= $pay_cost?> руб.</button>
</form>