/
blikForm.phtml
68 lines (68 loc) · 3.34 KB
/
blikForm.phtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php use Tpay\Locale\Lang; ?>
<link rel="stylesheet" type="text/css" href="<?php echo $data['static_files_url'] ?>View/Styles/style.css"/>
<div class="tpay-insidebg" id="main-payment">
<div class="tpay-header-wrapper">
<div class="tpay-header-logo">
<img class="tpay-logo" src="https://tpay.com/img/banners/tpay_logo_white.svg" alt="logo-tpay"/>
</div>
<div class="tpay-header-belt"></div>
</div>
<div class="tpay-panel-inside-content">
<div class="tpay-channel-form-wrapper tpay-content-wrapper-class">
<img src="https://secure.tpay.com/_/banks/b64.png" alt="logo-blik"/>
<form action="<?php echo $data['action_url'] ?>" method="post" id="tpay-blik-form">
<div class="tpay-row">
<div class="tpay-input-blik-code">
<div class="tpay-input-wrapper">
<div class="tpay-input-label"
title="<?php Lang::lang('blik_info') ?>"><?php Lang::lang('codeInputText') ?></div>
<input id="blik_code"
name="blik_code"
pattern="\d*"
type="tel"
autocomplete="off"
maxlength="6"
minlength="6"
placeholder="000000"
tabindex="1"
value=""
class="tpay-input-value tpay-blik-input"
/>
</div>
</div>
</div>
<div class="tpay-amPmCheckbox">
<input id="tpay-accept-regulations-checkbox" type="checkbox" name="regulations" value="0">
<label for="tpay-accept-regulations-checkbox" class="tpay-info-label">
<?php Lang::lang('accept') ?> <a href="<?php echo $data['regulation_url'] ?>"
target="_blank"><?php Lang::lang('regulations_url') ?></a>
<?php Lang::lang('regulations'); ?>
</label>
</div>
</form>
</div>
<div class="tpay-buttons-holder">
<input class="tpay-pay-button" id="tpay-payment-submit" type="submit" value="<?php Lang::lang('pay') ?>">
</div>
</div>
</div>
<script type="text/javascript">
var regulation_checkbox = document.getElementById('tpay-accept-regulations-checkbox'),
submit_form_input = document.getElementById('tpay-payment-submit'),
blik_code_input = document.getElementById('blik_code');
submit_form_input.onclick = function () {
if (regulation_checkbox.value == 0) {
alert('<?php Lang::lang('acceptance_is_required') ?>');
return false;
}
if (blik_code_input.value.length !== 6 || /^\d+$/.test(blik_code_input.value) === false) {
alert('<?php Lang::lang('blik_code_error') ?>');
return false;
}
document.getElementById('tpay-blik-form').submit();
return true;
};
regulation_checkbox.onchange = function () {
regulation_checkbox.value = (this.checked) ? 1 : 0;
};
</script>