first commit

This commit is contained in:
2025-03-12 17:06:23 +01:00
commit 2241f7131f
13185 changed files with 1692479 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
<div id="payment">
<div class="panel panel-default center-block">
<div id="payu-panel-body" class="panel-body text-center">
<p>
<img src="{$logo}" style="max-width: 200px" alt="{$title}">
</p>
<p>
{$message}
</p>
{if $contact_url}
<p>
<a href="{$contact_url}" class="btn btn-default">
{__ text="Skontaktuj się z nami"}
</a>
</p>
{/if}
</div>
</div>
</div>

View File

@@ -0,0 +1,69 @@
{assign var='payment_info_url' value=$payment_type->getPaymentInformationUrl($amount)}
{assign var='payment_configuration' value=$payment_type->getConfiguration()}
{if $payment_info_url}
<a class="btn btn-default payment-window-open-trigger" href="{$payment_info_url}" rel="nofollow" target="_blank" data-width="{$payment_configuration->getOption('payment_info.width')}" data-height="{$payment_configuration->getOption('payment_info.height')}">{$button_label}</a>
{else}
<a class="btn btn-default" href="#payment-info-modal" data-toggle="modal" data-type="{$type}" data-action="{urlfor internal='@stPayment?action=paymentInformation'}" data-amount="{$amount}" data-title="{$title}">{$button_label}</a>
{/if}
{if !$init}
<div id="payment-info-modal" class="modal fade text-left" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title"></h4>
</div>
<div class="modal-body">
<div class="preloader"></div>
</div>
</div>
</div>
</div>
{literal}
<script>
jQuery(function($) {
$('.payment-window-open-trigger').click(function() {
const link = $(this);
let width = link.data('width') ? link.data('width') : 520;
let height = link.data('height') ? link.data('height') : 500;
let left = 0;
let top = 0;
if (width > screen.width) {
width = screen.width;
height = screen.height;
} else {
left = (screen.width - width) / 2;
top = (screen.height - height) / 4;
}
const popup = window.open(link.attr('href'),
'Policz_rate',
'width='+width+',height='+height+',directories=no,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no,left='+left+',top='+top);
return false;
});
$('#payment-info-modal').on('show.bs.modal', function(event) {
const modal = $(this);
const trigger = $(event.relatedTarget);
modal.find('.modal-title').html(trigger.data('title') ? trigger.data('title') : trigger.html());
const params = {'type': trigger.data('type'), 'amount': trigger.data('amount')};
$.get(trigger.data('action'), params, function(response) {
modal.find('.modal-body').html(response);
});
}).on('hide.bs.modal', function() {
const modal = $(this);
modal.find('.modal-body').html('<div class="preloader"></div>');
});
});
</script>
{/literal}
{/if}

View File

@@ -0,0 +1,4 @@
{set layout="one_column"}
<div id="payment">
{$show_payment}
</div>

View File

@@ -0,0 +1,16 @@
<div id="payment">
<div class="panel panel-default center-block">
<div id="payu-panel-body" class="panel-body text-center">
<p>
<img src="{$logo}" alt="" style="max-width: 150px" />
</p>
<p>
{if $canceled}
<p>{__ text="Płatność anulowana" catalogue="stPayment"}</p>
{else}
<p>{__ text="Dziękujemy za dokonanie płatności." catalogue="stPayment"}</p>
{/if}
</p>
</div>
</div>
</div>

View File

@@ -0,0 +1,60 @@
{if $payment_channels}
<div id="payment-select-channel" data-id="{$payment->getId()}">
{foreach from=$payment_channels item=channel}
<a class="payment-channel" href="#" data-channel="{json_encode data=$channel escape=true}">
<img src="{$channel.logo}" alt="{$channel.name}">
{if $channel.show_name}
<span class="payment-channel-name">{$channel.name}</span>
{/if}
</a>
{/foreach}
</div>
{literal}
<script>
jQuery(function($) {
const selectPaymentChannel = $('#payment-select-channel');
function update(channel) {
const paymentMethod = $('#shopping-cart-payment .payment-method[data-id='+selectPaymentChannel.data('id')+']');
const modal = selectPaymentChannel.closest('.modal');
const jsonChannelData = JSON.stringify(channel);
let selectedChannelTpl = '<img src="'+channel.logo+'" alt="'+channel.name+'">';
if (channel.show_name)
{
selectedChannelTpl += ' ' + channel.name;
}
paymentMethod.find('.selected-payment-channel').html(selectedChannelTpl);
$('#payment_channel').val(JSON.stringify(jsonChannelData));
modal.modal('hide');
paymentRadio = paymentMethod.find('.payment-radio')
.prop('checked', true)
.data('channel', channel)
.change();
}
selectPaymentChannel.find('.payment-channel').click(function() {
const selected = $(this);
let channel = selected.data('channel');
let needUpdate = selectPaymentChannel.triggerHandler('change', channel);
if (false !== needUpdate) {
update(channel);
}
selectPaymentChannel.find('.payment-channel.selected').removeClass('selected');
selected.addClass('selected');
return false;
});
selectPaymentChannel.on('update', function(e, channel) {
update(channel);
});
});
</script>
{/literal}
{else}
{__ text="Wystąpił problem przy próbie połaczenia z serwisem płatności zamknij okno i spróbuj ponownie."}
{/if}

View File

@@ -0,0 +1,19 @@
<div id="st_component-st_payment-list" class="st_payment-list-table">
{if $hasPaymentType}
<h3>{__ text="Płatności"}</h3>
<ul>
{foreach key=row item=payment from=$results}
<li class="payment">
{$payment.radio} {$payment.name}
<p style="margin-left: 25px">{$payment.description}</p>
<p style="margin-left: 25px">{$payment.paymentTypeSocket}</p>
</li>
{/foreach}
</ul>
{else}
<h3>{__ text="Płatności"}</h3>
<ul>
<li class="payment">{__ text="Brak dostępnych form płatności."}</li>
</ul>
{/if}
</div>

View File

@@ -0,0 +1 @@
{$show_payment}

View File

@@ -0,0 +1,38 @@
{if $payments}
<li class="highlighted-payment">
<span class="payment-logo">{image src="payment/payments.svg" alt=$payments_label}</span>
<span class="payment-name">
{foreach from=$payments item=payment name=payments}
{$payment}{if !$smarty.foreach.payments.last}, {/if}
{/foreach}
</span>
</li>
{/if}
{foreach from=$highlighted item=current key=id}
<li class="highlighted-payment">
<span class="payment-logo">
{if $current.logo}
<img src="{$current.logo}" alt="{$current.name}">
{else}
{image src="payment/$id.svg" alt=$current.name}
{/if}
</span>
<span class="payment-name">{$current.description}</span>
{if $current.show_info}
{st_get_component module="stPayment" component="paymentInfoButton" amount=$amount payment_type=$current.payment_type}
{/if}
</li>
{/foreach}
{if $lukas}
{st_get_component module="stLukasFrontend" component="calculate" id=$id product=$product amount=$amount}
{/if}
{capture name="name" assign="inbank"}
{st_get_component module="stInBankFrontend" component="calculate" product=$product amount=$amount}
{/capture}
{if $inbank}
<li style="margin-top: 12px">{$inbank}</li>
{/if}

View File

@@ -0,0 +1,69 @@
<div class="modal fade modal-vertical-centered" id="order-payment-process-modal" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" data-keyboard="false" data-action="{$action}" data-autoredirect="{$api->isAutoRedirectEnabled()}">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<p class="text-center"><img src="{$api->getLogoPath()}" style="max-width: 150px" alt=""></p>
<p class="text-center">{__ text="Za chwilę nastąpi przekierowanie na stronę płatności. Proszę czekać."}</p>
<p class="text-center"><strong data-countdown-value="3" data-countdown-unit="{__ text="sek."}"></strong></p>
<div class="preloader"></div>
</div>
</div>
</div>
</div>
<div id="order-payment-process-container" class="hidden"></div>
{literal}
<script type="text/javascript">
jQuery(function($) {
$(document).ready(function () {
var modal = $('#order-payment-process-modal');
function redirect()
{
$.get(modal.data('action'), function(response) {
if (response && response.redirect) {
window.location = response.redirect;
} else if (response && response.content) {
var container = $('#order-payment-process-container');
container.html(response.content);
container.find('form').submit();
}
});
}
modal.on('shown.bs.modal', function() {
if (modal.data('autoredirect')) {
var countdownContainer = modal.find('[data-countdown-value]');
var countdown = countdownContainer.data('countdown-value');
var unit = countdownContainer.data('countdown-unit');
countdownContainer.html(countdown + ' ' + unit);
var timer = setInterval(function() {
countdownContainer.html(countdown + ' ' + unit);
if (countdown == 0) {
clearInterval(timer);
redirect();
}
countdown--;
}, 1000);
} else {
redirect();
}
})
if (modal.data('autoredirect'))
{
modal.modal({ show: true });
}
$('#order-pay-btn').click(function() {
modal.modal({ show: true });
return false;
});
});
});
</script>
{/literal}