Liqpay: відмінності між версіями
Sv (обговорення | внесок) Немає опису редагування |
(Немає відмінностей)
|
Поточна версія на 13:44, 15 березня 2019
Анонимное пополнение
Необходимо создать администратора с любым именем, например «гость» и дать ему только такие привилегии:
- Доступ включен
- Гостевой режим
В разделе «Документы» создать папку «Шаблоны» (если не создана) с тегом system. В ней создать документ с именем, например, «Гостевой шаблон» с тегами:
system template=guest_base
и содержимым:
<!doctype html>
<html>
<head>
<title>{{ cfg::net_title }}</title>
<meta http-equiv='Cache-Control' content='no-cache'>
<meta http-equiv='Pragma' content='no-cache'>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
<meta name='copyright' content='NoDeny Plus http://nodeny.com.ua'>
<link rel='stylesheet' href='{{cfg::img_dir}}/user.css?v=7' type='text/css'>
{{ template::base.head }}
</head>
<body class='{{body_class}}'>
<div id='modal_window'></div>
{% if made_msg %}<div class='usr_top_made_msg {{made_msg_class}}'>{{ made_msg }}</div>{% endif %}
<div id='main_block'>
<div>{{ main_block }}</div>
</div>
</body>
</html>
Анонимное пополнение будет доступно по урлу:
http://xxx/cgi-bin/stat.pl?a=_guest&cmd=guest_lpay&_noguest=u_lpay
Если пользователь будет залогинен, его перекинет на обычную оплату через Liqpay.
В шаблоне идет подгрузка user.css, идущего в поставке NoDeny. Вы можете его не использовать, а сформировать абсолютно свой дизайн, изменив не только css, но и шаблоны для окон пополнения счета. Читайте об этом здесь
Давайте кардинально изменим дизайн страницы оплаты. В документе «Гостевой шаблон», который мы создали выше, удалим строчку с user.css:
<!doctype html>
<html>
<head>
<title>{{ cfg::net_title }}</title>
<meta http-equiv='Cache-Control' content='no-cache'>
<meta http-equiv='Pragma' content='no-cache'>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
<meta name='copyright' content='NoDeny Plus http://nodeny.com.ua'>
{{ template::base.head }}
</head>
<body class='{{body_class}}'>
<div id='modal_window'></div>
{% if made_msg %}<div class='usr_top_made_msg {{made_msg_class}}'>{{ made_msg }}</div>{% endif %}
<div id='main_block'>
<div>{{ main_block }}</div>
</div>
</body>
</html>
Создадим документ «Оплата base» c тегами:
system template=user/pay_base
и содержимым:
<div class='user__ps__main_block'>
<div class='title_block'>
<table><tr>
<td>{% if param.logo %}<img src='{{ cfg::img_dir }}/{{ param.logo }}'>{% endif %}</td>
<td>{{ param.lang.title }}</td>
</tr></table>
</div>
{{ template::pay_base.main }}
</div>
{% global_block template::base.head %}
<style>
.user__ps__main_block {
max-width: 800px;
display: table;
margin: 0 auto;
border-radius: 7px;
padding: 15px 50px;
background-color: #d6e2ef;
}
.user__ps__main_block .title_block {
text-align: center;
padding: 30px 0;
font-size: 146%;
border-bottom: solid 1px #eeeeee;
}
.user__ps__main_block .title_block td {
padding: 10px;
}
.user__ps__main_block .text_input_block {
margin-top: 50px;
font-size: 146%;
text-align: center;
}
.user__ps__main_block .amount_input {
text-align: right;
width: 80pt;
}
.user__ps__main_block .submit_block {
}
.user__ps__main_block .info_block {
text-align: center;
font-size: 146%;
margin: 50px 0;
}
.user__ps__main_block .info_block .amount {
font-weight: bold;
font-size: 120%;
color: #4caf50;
}
.user__ps__main_block input[type=submit] {
text-decoration: none;
text-shadow: 0 1px 1px #ffffff;
color: #4381bb;
border-top: solid 2px #d0d0d0;
border-left: solid 2px #d0d0d0;
border-right: solid 2px #909090;
border-bottom: solid 2px #909090;
border-radius: 8px;
margin-right: 1px;
padding: 9px 20px;
font-size: 20px;
background-image: -moz-linear-gradient(bottom, #d0d5e0 0%, #ffffff 100%);
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, rgb(208,213,224)), color-stop(1, rgb(255,255,255)));
}
.user__ps__main_block .submit_block {
margin: 30px auto 15px auto;
text-align: center;
}
.user__ps__main_block input[type=text] {
color: #660000;
font-size: 18px;
padding: 3px;
border: 1px solid #c2d9f1;
background-color: #ffffff;
}
.user__ps__main_block .result_info_block {
text-align: left;
}
</style>
{% endblock %}
Кроме шаблонов для оплаты, необходимо кастомизировать шаблон с ошибкой. К примеру, введите некорректный логин пользователя и вы увидите неоформленное сообщение об ошибке. Давайте изменим и его. Создадим документ «Окно с ошибкой», теги:
system template=user/error_box
содержимое:
<div style='color: #ff0000; text-align: center; padding: 30px;'>{{ msg }}</div>