30 lines
1.1 KiB
PHP
30 lines
1.1 KiB
PHP
<?php
|
|
// the function returns an MD5 of parameters passed
|
|
// функция возвращает MD5 переданных ей параметров
|
|
function ref_sign() {
|
|
$params = func_get_args();
|
|
$prehash = implode("::", $params);
|
|
return md5($prehash);
|
|
}
|
|
|
|
// the function prints a request form
|
|
// функция печатает форму запроса
|
|
function print_form($purse, $order_id, $amount, $clear_amount, $description, $secret_code, $submit) {
|
|
// making signature
|
|
// создаем подпись
|
|
$sign = ref_sign($purse, $order_id, $amount, $clear_amount, $description, $secret_code);
|
|
|
|
// printing the form
|
|
// печатаем форму
|
|
echo <<<Form
|
|
<form action="http://bank.smscoin.com/bank/" method="post" id=f1>
|
|
|
|
<input name="s_purse" type="hidden" value="$purse" />
|
|
<input name="s_amount" type="hidden" value="$amount" />
|
|
<input name="s_clear_amount" type="hidden" value="$clear_amount" />
|
|
<input name="s_description" type="hidden" value="$description" />
|
|
<input name="s_sign" type="hidden" value="$sign" />
|
|
|
|
Form;
|
|
}
|
|
?>
|