first commit

This commit is contained in:
2024-11-11 18:46:54 +01:00
commit a630d17338
25634 changed files with 4923715 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -0,0 +1,11 @@
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -0,0 +1,150 @@
{if isset($imoje_can_refund) && $imoje_can_refund}
{if isset($ps_version) && $ps_version >= 1770}
{capture assign=refund_fieldset}
<div class="well">
<div class="card" id="imojeRefund">
<div class="card-header">
<h3 class="card-header-title">
{l s='Make a refund' mod='imoje'}
</h3>
</div>
<div class="card-body">
{if isset($imoje_refund_error) && $imoje_refund_error}
<div class="alert alert-danger">
<p class="error">{$imoje_refund_error|escape:'htmlall':'UTF-8'}</p>
</div>
{/if}
{if isset($imoje_refund_message) && $imoje_refund_message}
<div style="margin-top:15px" class="alert alert-success">
<p>{$imoje_refund_message}</p>
</div>
{/if}
{if isset($imoje_amount_refundable)
&& $imoje_amount_refundable
&& ($imoje_amount_refundable > 0)}
<form class="form-horizontal" action="" method="post"
onsubmit="return confirm('{l s='Do you really want to submit the refund request?' mod='imoje'}');">
<div class="form-group row type-text_with_length_counter js-text-with-length-counter">
<label for="imoje_refund_amount" class="form-control-label label-on-top col-12">
{l s='Insert amount to refund' mod='imoje'}
</label>
<div class="col-12">
<div class="input-group js-text-with-length-counter">
<input type="text" class="form-control" id="imoje_refund_amount"
name="imoje_refund_amount" value=""
placeholder="{$imoje_amount_refundable}">
</div>
</div>
</div>
<div class="form-group row type-checkbox ">
<div class="col-sm">
<div class="checkbox">
<div class="md-checkbox md-checkbox-inline">
<label><input type="checkbox" name="imoje_change_status" class=""
value="1">
<i class="md-checkbox-control"></i>{l s='Change status to refund' mod='imoje'}
</label>
</div>
</div>
</div>
</div>
<div class="text-right">
<button name="imoje_submit_refund" disabled type="submit" class="btn btn-primary"
id="imoje_submit_refund" value="1">
{l s='Perform a refund' mod='imoje'}
</button>
</div>
</form>
{/if}
</div>
</div>
</div>
{/capture}
<script>
$(document).ready(function () {
$("{$refund_fieldset|escape:'javascript':'UTF-8'}").insertAfter($('#orderProductsOriginalPosition').first());
$('#imoje_refund_amount').on('keyup change', function () {
$('#imoje_submit_refund').prop('disabled', isNaN($(this).val()) || $(this).val() <= 0 || $(this).val() > {$imoje_amount_refundable});
});
});
</script>
{else}
{capture assign=refund_fieldset}
<div class="well">
<h3>{l s='Make a refund' mod='imoje'}</h3>
{if isset($imoje_refund_error) && $imoje_refund_error}
<br/>
<div style="margin-top:15px" class="alert alert-danger">
<p class="error">{$imoje_refund_error|escape:'htmlall':'UTF-8'}</p>
</div>
{/if}
{if isset($imoje_refund_message) && $imoje_refund_message}
<div style="margin-top:15px" class="alert alert-success">
<p>{$imoje_refund_message}</p>
</div>
{/if}
<div class="row">
{if isset($imoje_amount_refundable)
&& $imoje_amount_refundable
&& ($imoje_amount_refundable > 0)}
<form action="" method="post"
onsubmit="return confirm('{l s='Do you really want to submit the refund request?' mod='imoje'}');">
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-lg-3">
{l s='Insert amount to refund' mod='imoje'}
</label>
<div class="col-lg-9">
<input type="text" class="form-control" id="imoje_refund_amount"
name="imoje_refund_amount" value=""
placeholder="{$imoje_amount_refundable}">
</div>
</div>
<div class="form-group">
<div class="checkbox pull-right">
<div class="md-checkbox md-checkbox-inline">
<label>
<input type="checkbox" name="imoje_change_status" class=""
value="1">
<i class="md-checkbox-control">
</i>{l s='Change status to refund' mod='imoje'}
</label>
</div>
</div>
</div>
</div>
<button disabled type="submit" id="imoje_submit_refund" class="btn btn-primary pull-right"
name="imoje_submit_refund" value="1">
{l s='Perform a refund' mod='imoje'}
</button>
</form>
{/if}
</div>
</div>
{/capture}
<script>
$(document).ready(function () {
$("{$refund_fieldset|escape:'javascript':'UTF-8'}").insertAfter($('.panel-heading').first());
$('#imoje_refund_amount').on('keyup change', function () {
$('#imoje_submit_refund').prop('disabled', isNaN($(this).val()) || $(this).val() <= 0 || $(this).val() > {$imoje_amount_refundable});
});
});
</script>
{/if}
{/if}

View File

@@ -0,0 +1,31 @@
<script type="text/javascript">
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
ga('create', '{$ga_key}', 'auto');
ga('send', 'pageview');
{if isset($ga_conversion) && $ga_conversion}
ga('require', 'ecommerce');
{foreach $ga_conversion as $ga_item}
ga('{$ga_item.command}', {
{foreach $ga_item.properties as $key => $prop}
'{$key}': '{$prop}',
{/foreach}
});
{/foreach}
ga('ecommerce:send');
{/if}
</script>

View File

@@ -0,0 +1,8 @@
{extends file=$layout}
{block name='content'}
{capture name=path}{l s='Payment' mod='imoje'}{/capture}
<div class="text-center">{l s='Your order has been processed. You will be informed via e-mail about it end status' mod='imoje'}</div>
<br>
{/block}

View File

@@ -0,0 +1,9 @@
{extends file=$layout}
{block name='content'}
<div class="alert alert-danger" role="alert">
{foreach from=$imojeErrors key=key item=error}
<p class="text-center">{l s=$error mod='imoje'}</p>
{/foreach}
</div>
{/block}

View File

@@ -0,0 +1,9 @@
{extends file=$layout}
{block name='content'}
{capture name=path}{l s='Payment' mod='imoje'}{/capture}
<div class="text-center">{l s='Unable to complete your payment request. Try again later or contact with shop staff.' mod='imoje'}</div>
<br>
{if isset($ga_key) && $ga_key}{include file="module:imoje/views/templates/front/_ga.tpl" ga_key=$ga_key}{/if}
{/block}

View File

@@ -0,0 +1,11 @@
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -0,0 +1,36 @@
{extends file=$layout}
{block name='content'}
<style>
#submit-payment-form {
display: none;
}
</style>
{capture name=path}{l s='Payment' mod='imoje'}{/capture}
<div class="text-center" style="text-align:center">
<span id="text-tip">
{if isset($blik_msg) && $blik_msg}
{l s='Please wait, you will be redirected to BLIK payment page.' mod='imoje'}
{elseif isset($pbl_msg) && $pbl_msg}
{l s='Please wait, in the next step you will be redirected to the bank.' mod='imoje'}
{else}
{l s='Please wait, in the next step you will choose a payment method.' mod='imoje'}
{/if}
</span>
</div>
<br>
<div id="imoje-payment-form">
{$form nofilter}
</div>
<br>
{if isset($ga_key) && $ga_key}{include file="module:imoje/views/templates/front/_ga.tpl" ga_key=$ga_key}{/if}
<script type="text/javascript">
if (window.location.hash === '#processed') {
window.location.replace("{$checkout_link}");
document.getElementById('text-tip').innerHTML = '{$text_return_to_checkout}';
} else {
window.location.hash = '#processed';
document.getElementById("submit-payment-form").click();
}
</script>
{/block}

View File

@@ -0,0 +1,641 @@
{extends file=$layout}
{block name='content'}
<style>
.loading_gif {
display: block;
margin-left: auto;
margin-right: auto;
}
#blik_code {
width: 230px;
}
#content_blik_code {
padding: .9375rem;
}
.modal_blik {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 50000;
background: rgba(0, 0, 0, .5)
}
.modal_blik-content {
background: #fbfbfb none;
border: 1px solid #d6d4d4;
border-radius: 4px;
transform: translate(-50%, -50%);
position: absolute;
top: 50%;
left: 50%;
color: black;
padding: 20px;
}
#modal_blik_code-content {
max-width: 274px;
}
.remember_code-content {
margin-bottom: 10px;
}
.blik-alias, .alias-deactivate {
margin-right: 5px;
margin-bottom: 5px;
}
#modal_processing {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 50000;
background: rgba(0, 0, 0, .5)
}
.d--none {
display: none;
}
.alias-deactivate {
font-weight: 600;
text-transform: uppercase
}
.fr {
float: right;
}
#text-tip {
margin-top: 2rem;
margin-left: 2rem;
}
#insert_blik_code-text:after {
float: right;
content: "\25bc";
}
#insert_blik_code-text.is-active:after {
content: "\25b2";
}
</style>
<section class="clearfix">
<div class="card col-xs-12 col-lg-8">
<div id="text-tip" class="d--none"></div>
<div id="content_blik_code">
{if $active_profile}
<div id="content_blik_oneclick">
<p>
<h2 class="h3">{l s='Debit profile' mod='imoje'}</h2>
<hr/>
<div data-profile-id="{$active_profile.id}"
data-profile-name="{$active_profile.label}"
class="div_profile">
{foreach $active_profile.aliasList as $alias}
<div data-blik-key="{$alias.key}"
data-blik-name="{$alias.label}" class="blik-alias-div">
<button class="btn btn-primary blik-alias">
{$alias.label}
</button>
<button class="btn btn-danger alias-deactivate">
{l s='Deactivate' mod='imoje'}
</button>
</div>
{/foreach}
</div>
<hr/>
</div>
{/if}
<h2 class="h3 mt-2 mb-2" id="insert_blik_code-text">
{l s='Insert BLIK code' mod='imoje'}
</h2>
<div class="content_insert_code d--none">
<input id="blik_code"
placeholder="{l s='BLIK code' mod='imoje'}"
class="form-control"
type="text"
name="blik_code"
required
autocomplete="off"
maxlength="6">
<br/>
{if $is_customer_logged && $is_imoje_blik_oneclick}
<div class="remember_code-content">
<div class="float-xs-left">
<span class="custom-checkbox">
<input id="remember_code-checkbox" type="checkbox">
<span>
<i class="material-icons checkbox-checked"></i>
</span>
</span>
</div>
<div class="remember_code">
<label for="remember_code-checkbox">
{l s='I want to remember this shop' mod='imoje'}
</label>
</div>
</div>
{/if}
<button id="blik_submit" class="btn btn-primary btn-submit-code disabled"
style="display: inline-block" disabled>
{l s='Pay' mod='imoje'}
</button>
</div>
<br/>
</div>
</div>
<div class="col-xs-12 col-lg-4">
{block name='cart_summary'}
{include file='checkout/_partials/cart-summary.tpl' cart = $cart}
{/block}
{block name='hook_display_reassurance'}
{hook h='displayReassurance'}
{/block}
</div>
<div class="modal_blik" id="modal_processing">
<div class="modal_blik-content" id="modal_processing-content">
<img class="loading_gif" src="{$loading_gif}" alt="{l s='Loading' mod='imoje'}"/>
<br/>
<span id="modal_tip"></span>
</div>
</div>
<div class="modal_blik" id="modal_blik_code">
<div class="modal_blik-content" id="modal_blik_code-content">
<p id="proceed_payment_code"></p>
<label for="blik_code_modal" class="d--none">
</label>
<input placeholder="{l s='BLIK code' mod='imoje'}"
id="blik_code_modal"
class="form-control"
type="text"
name="blik_code"
required autocomplete="off"
maxlength="6">
<br/>
<button id="blik_submit_modal" class="btn btn-primary btn-submit-code disabled blik_submit" disabled>
{l s='Pay' mod='imoje'}
</button>
<button class="btn btn-secondary btn-modal-close">
{l s='Close' mod='imoje'}
</button>
</div>
</div>
<div class="modal_blik" id="modal_blik_alias_deactivate-modal">
<div class="modal_blik-content" id="modal_blik_alias_deactivate-modal-content">
<h2 class="h3">{l s='Deactivate profile' mod='imoje'}</h2>
<label for="blik_code" class="">
</label>
<p>
{l s='Are you sure that you want deactivate profile ' mod='imoje'}
<span id="deactivate_profile_name-text"></span>?
</p>
<button id="deactivate_profile_accept-btn" class="btn btn-primary">
{l s='Deactivate' mod='imoje'}
</button>
<button class="btn btn-secondary btn-modal-close">
{l s='Close' mod='imoje'}
</button>
</div>
</div>
</section>
<br>
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function (event) {
(function () {
// region vars
var $blikCode = $("#blik_code"),
$blikSubmit = $('#blik_submit'),
$contentBlikCode = $('#content_blik_code'),
$contentBlikOneclick = $('#content_blik_oneclick'),
$modalProcessing = $('#modal_processing'),
isSubmitted = false,
$rememberCodeCheckbox = $('#remember_code-checkbox'),
$aliasDeactivateButton = $('.alias-deactivate'),
$blikProfile = $('.blik-alias'),
$modalBlikAliasDeactivateModal = $('#modal_blik_alias_deactivate-modal'),
$deactivateProfileNameText = $('#deactivate_profile_name-text'),
$modalTip = $('#modal_tip'),
$deactivateProfileAcceptButton = $('#deactivate_profile_accept-btn'),
$textTip = $('#text-tip'),
$modalBlik = $('.modal_blik'),
dontProcessing = false,
dontProcessingTimeout = null,
$insertBlikCodeText = $('#insert_blik_code-text'),
$modalBlikCode = $('#modal_blik_code'),
$btnModalClose = $('.btn-modal-close'),
$blikSubmitModal = $('#blik_submit_modal'),
$blikCodeModal = $('#blik_code_modal'),
$proceedPaymentCodeText = $('#proceed_payment_code'),
timeoutAppendResultText = null,
tempKey = null,
profileId = null,
tempThis = null,
tempNewParamAlias = null,
msAppendResultText = 60000,
msBlikSubmit = 90000;
// endregion
{if !$active_profile}
toggleContentInsertCode();
{/if}
{if $profile_id}
profileId = "{$profile_id}";
{/if}
$insertBlikCodeText.on('click', function () {
toggleContentInsertCode();
});
if (!isSubmitted) {
$blikCode.on('input', function () {
if ($blikCode.val().length === 6) {
$blikSubmit.removeClass('disabled');
$blikSubmit.removeAttr("disabled");
} else {
disableBlikSubmit();
}
});
$blikCodeModal.on('input', function () {
if ($blikCodeModal.val().length === 6) {
$blikSubmitModal.removeClass('disabled').removeAttr("disabled");
} else {
disableBlikSubmit();
}
});
}
function toggleContentInsertCode() {
$insertBlikCodeText.toggleClass('is-active').next(".content_insert_code").stop().slideToggle(500);
}
function appendResultText(text, color) {
clearTimeout(timeoutAppendResultText);
if ({$create_order_arrangement}) {
$textTip.show();
$textTip.html(text).css('color', color);
timeoutAppendResultText = setTimeout(function () {
$textTip.hide();
}, msAppendResultText)
return;
}
$contentBlikCode.html(text)
}
function blikSubmit(data) {
disableBlikSubmit();
isSubmitted = true;
$modalBlik.hide();
clearDontProcessingTimeout()
dontProcessingTimeout = setTimeout(
function () {
dontProcessing = true
}, msBlikSubmit);
processForm(data);
}
$blikSubmit.on('click', function () {
var data = {
blikCode: $blikCode.val(),
}
if ($rememberCodeCheckbox.is(":checked")) {
data.rememberBlikCode = 1;
data.profileId = profileId;
}
blikSubmit(data);
});
$blikSubmitModal.on('click', function () {
var data = {
blikCode: $blikCodeModal.val(),
}
if ($('.blik-alias').length > 1) {
data.profileId = profileId
}
if (tempNewParamAlias) {
data.rememberBlikCode = 1
}
blikSubmit(data);
});
function disableBlikSubmit() {
$blikSubmit.addClass('disabled').attr("disabled", true);
$blikSubmitModal.addClass('disabled').attr("disabled", true);
}
// region deactivate profile
$aliasDeactivateButton.on('click', function () {
$deactivateProfileNameText.html($(this).parent().data("blik-name"))
tempThis = $(this);
$modalBlikAliasDeactivateModal.show();
});
$deactivateProfileAcceptButton.on('click', function () {
$modalBlikAliasDeactivateModal.hide();
if (!tempThis) {
return;
}
var blikKey = tempThis.parent().data('blik-key');
processForm({
profileId: profileId,
blikKey: blikKey,
deactivate: 1
},
'{l s='Please wait, deactivation is in progress' mod='imoje'}',
function (response) {
$modalProcessing.hide();
if (response.status) {
$('div[data-blik-key=' + blikKey + ']').remove();
appendResultText("{l s='Successfully deactivated profile' mod='imoje'}" + " " + tempThis.parent().data('blik-name'), 'green');
if ($('.blik-alias-div').length === 0) {
toggleContentInsertCode();
$('div[data-profile-id=' + profileId + ']').remove();
$contentBlikOneclick.remove();
return;
}
return;
}
appendResultText('{l s='Could not deactivate profile. Try again later or contact with shop staff.' mod='imoje'}', 'red')
})
})
// endregion
function clearDontProcessingTimeout() {
clearTimeout(dontProcessingTimeout);
dontProcessing = null;
}
function checkPayment(transactionId) {
$.ajax({
data: {
transactionId: transactionId,
checkTransaction: true
},
method: "POST",
url: "{$payment_blik_url nofilter}"
})
.then(function (data) { // done
if (dontProcessing) {
$modalProcessing.hide();
appendResultText('{l s='Response timed out. Try again.' mod='imoje'}', 'red');
clearDontProcessingTimeout();
return;
}
if (!data.status) {
$modalProcessing.hide();
appendResultText('{l s='Something went wrong. Please contact with shop staff' mod='imoje'}', 'red');
clearDontProcessingTimeout();
return;
}
if (data.body && data.body.error) {
$modalProcessing.hide();
clearDontProcessingTimeout();
if (data.body.code) {
$proceedPaymentCodeText.html(data.body.error);
if (data.body.newParamAlias) {
tempNewParamAlias = true;
}
$modalBlikCode.show();
return;
}
appendResultText(data.body.error, 'red');
return;
}
if (data.body.transaction.status === 'pending') { // state inny niz pending
if (dontProcessing) {
$modalProcessing.hide();
appendResultText('{l s='Response timed out. Try again.' mod='imoje'}', 'red');
clearDontProcessingTimeout();
return;
}
setTimeout(function () {
checkPayment(transactionId)
}, 1000);
return;
}
clearDontProcessingTimeout();
$modalProcessing.hide();
if (data.body.transaction.status === 'settled') {
$contentBlikCode.html('{l s='Your payment has been processed correctly. We will inform you about the progress of the order by e-mail.' mod='imoje'}');
return;
}
$contentBlikCode.html('{$failure_tip1} <br/><br/> {$failure_tip2}');
}, function () { // fail
});
}
// region debit profile
$blikProfile.on("click", function () {
dontProcessingTimeout = setTimeout(
function () {
dontProcessing = true
}, msBlikSubmit);
var parent = $(this).parent(),
key = parent.data("blik-key")
? parent.data("blik-key")
: null;
tempKey = key;
processForm({
profileId: profileId,
blikKey: key,
},
'',
function (response) {
if (response.status && response.body.transaction.id) {
checkPayment(response.body.transaction.id);
return;
}
$modalProcessing.hide();
appendResultText('{l s='Could not debit profile. Try again later or contact with shop staff.' mod='imoje'}', 'red');
}
);
});
// endregion
$btnModalClose.on('click', function () {
$modalBlik.hide();
}
)
// region show modal processing
function showModalProcessing(text) {
$modalTip.html(text);
$modalProcessing.show();
}
// endregion
function clearInputs(){
$blikCode.val('');
$blikCodeModal.val('');
}
// region process form
function processForm(data, modalTipText = '', funcAtDone = null, funcAtAlways = null) {
document.activeElement.blur();
$.ajax({
method: "POST",
url: "{$payment_blik_url nofilter}",
data: data,
beforeSend: function () {
$textTip.hide();
clearInputs();
showModalProcessing(modalTipText ? modalTipText : '{l s='Now accept payment in your bank application' mod='imoje'}');
}
})
.done(function (data) {
if (typeof data !== "object") {
$modalProcessing.hide();
appendResultText('{l s='Something went wrong. Please contact with shop staff' mod='imoje'}', 'red');
return;
}
if (!data.status) {
$modalProcessing.hide();
appendResultText('{l s='Something went wrong. Please contact with shop staff' mod='imoje'}', 'red');
return;
}
if (data.body && data.body.error) {
$modalProcessing.hide();
clearDontProcessingTimeout();
if (data.body.code) {
$('#proceed_payment_code').html(data.body.error);
if (data.body.newParamAlias) {
tempNewParamAlias = true;
}
$modalBlikCode.show();
return;
}
appendResultText(data.body.error, 'red');
return;
}
if (funcAtDone) {
funcAtDone(data);
return;
}
if (data.body.transaction.status === 'settled') {
$modalProcessing.hide();
$contentBlikCode.html('{l s='Your payment has been processed correctly. We will inform you about the progress of the order by e-mail.' mod='imoje'}');
return;
}
if (data.body.transaction.status === 'rejected') {
$modalProcessing.hide();
$contentBlikCode.html('{$failure_tip1} <br/><br/> {$failure_tip2}');
return;
}
if (data.body.transaction.id) {
checkPayment(data.body.transaction.id);
return;
}
$modalProcessing.hide();
appendResultText('{l s='Something went wrong. Please contact with shop staff' mod='imoje'}', 'red');
})
.fail(function () {
$modalProcessing.hide();
appendResultText('{l s='Something went wrong. Please contact with shop staff' mod='imoje'}', 'red');
})
.always(function (response) {
if (funcAtAlways) {
funcAtAlways(response);
}
});
}
// endregion
})()
});
</script>
{/block}

View File

@@ -0,0 +1,128 @@
{extends file=$layout}
{block name='content'}
<style>
.box-pm {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-webkit-box-pack: start;
-ms-flex-pack: start;
justify-content: flex-start;
}
.title {
margin-bottom: 30px;
}
.pm {
margin: 0 .8125rem;
}
.pm-content {
position: relative;
margin-bottom: 1.563rem;
height: 165px;
width: 161px;
background: #fff;
box-shadow: 2px 2px 8px 0 rgb(0 0 0 / 20%)
}
.pm-content:hover {
border: 1px solid green
}
.pm-logo {
max-height: 50%;
max-width: 65%;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
}
.pm-description {
bottom: 1.25rem;
padding-top: .625rem;
z-index: 2;
text-align: center;
height: 3.125rem;
transition: bottom .3s;
color: black;
}
.hidden {
display: none;
}
.pbl_loading-content {
background: #fbfbfb none;
border: 1px solid #d6d4d4;
border-radius: 4px;
transform: translate(-50%, -50%);
position: absolute;
top: 50%;
left: 50%;
color: black;
padding: 20px;
}
#pbl_loading {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 50000;
background: rgba(0, 0, 0, .5)
}
</style>
<section class="clearfix" style="display:block">
<h2 class="h3 text-uppercase title">
{l s='Choose payment channel' mod='imoje'}
</h2>
<div class="box-pm row">
<div id="pbl_loading" class="hidden">
<div class="pbl_loading-content">
<img id="loading-gif" src="{$loading_gif}" alt="{l s='Loading' mod='imoje'}"
style="display: block; margin-left: auto; margin-right: auto;"/><br/>
{l s='Please wait, you will be redirected to next step.' mod='imoje'}
</div>
</div>
{foreach from=$payment_method_list key=id item=payment_method}
<div class="pm">
<a class="pm-link"
href="{$payment_link}?pm={$payment_method.paymentMethod}&pmc={$payment_method.paymentMethodCode}">
<div class="pm-content">
{if $payment_method.logo}
<img class="pm-logo" src="{$payment_method.logo}"
alt="{$payment_method.description}">
{/if}
<div class="pm-description">
<p>
{$payment_method.description}
</p>
</div>
</div>
</a>
</div>
{/foreach}
</div>
</section>
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function (event) {
$('.pm-link').click(function () {
$('#pbl_loading').removeClass('hidden');
});
})
</script>
{/block}

View File

@@ -0,0 +1,108 @@
{extends file=$layout}
{block name='content'}
{capture name=path}{l s='Payment' mod='imoje'}{/capture}
<div class="text-center">{l s='Please wait, in the next step you will choose a payment method...' mod='imoje'}
<br>
<form action="{$payment_url}" id="imoje_method_form" method="post">
<input type="hidden" name="imoje_method" value="PAYMENTPAGE"/>
<input type="hidden" name="imoje_order_id" value="{$order_id}"/>
<input type="hidden" name="imoje_customer_id" value="{$customer_id}"/>
<input type="hidden" name="imoje_address_invoice_id" value="{$address_invoice_id}"/>
<input type="hidden" name="imoje_address_delivery_id" value="{$address_delivery_id}"/>
<input type="hidden" name="twisto_data" id="twisto_data" value=""/>
<br/>
<button style="display:none" type="submit" name="submit" id="twisto_submit">{$continue}</button>
</form>
<br>
<script type="text/javascript">
document.getElementById('twisto_submit').classList.add("btn", "btn-warning", "button-medium");
(function () {
var twistoConfig = {
public_key: '{$payment_methods.twisto.pk}',
script: '{$twisto_script_url}'
};
(function (e, g, a) {
function h(a) {
return function () {
b._.push([a, arguments])
}
}
var f = ["check"], b = e || {}, c = document.createElement(a);
a = document.getElementsByTagName(a)[0];
b._ = [];
for (var d = 0; d < f.length; d++) {
b[f[d]] = h(f[d]);
}
this[g] = b;
c.type = "text/javascript";
c.async = !0;
c.src = e.script;
a.parentNode.insertBefore(c, a);
delete e.script
}).call(window, twistoConfig, "Twisto", "script");
document.addEventListener("DOMContentLoaded", function (event) {
var twistoTimeout,
twistoTimeoutFlag = false,
timeBeforeCheck;
function timeout() {
return setTimeout(function () {
processForm({
"details": "timeout"
});
}, {$payment_methods.twisto.timeout});
}
function processForm(response) {
clearTimeout(twistoTimeout);
response.timeResponse = (new Date()).getTime() - timeBeforeCheck;
document.getElementById('twisto_data').value = JSON.stringify(response);
$("#twisto_submit").show().click();
}
timeBeforeCheck = (new Date()).getTime();
twistoTimeout = timeout();
Twisto.check("{$twisto_payload}", function (response) {
processForm(response);
}, function (response) {
if (!response) {
response = {
"details": "errorCallback"
}
}
processForm(response);
}, {
"processingStarted": function () {
if (twistoTimeoutFlag) {
return;
}
twistoTimeoutFlag = true;
clearTimeout(twistoTimeout);
twistoTimeout = timeout();
}
}
);
});
})();
</script>
</div>
{/block}

View File

@@ -0,0 +1,9 @@
{extends file=$layout}
{block name='content'}
{capture name=path}{l s='Payment' mod='imoje'}{/capture}
<div class="text-center">{l s='Your order has been processed. You will be informed via e-mail about it end status.' mod='imoje'}</div><br>
{if isset($ga_key) && $ga_key}{include file="module:imoje/views/templates/front/_ga.tpl" ga_key=$ga_key ga_conversion=$ga_conversion}{/if}
{/block}

View File

@@ -0,0 +1,328 @@
<style>
#sandbox_text_enabled {
color: red;
}
.t--strong {
font-weight: bold;
}
</style>
<div class="imoje-wrap bootstrap">
{if $imoje_msg != ''}
<div class="bootstrap">
<div class="{if $imoje_msg.type == 'error'}alert alert-danger{else}alert alert-success{/if}">{$imoje_msg.message}</div>
</div>
{/if}
<div class="imoje-header">
<span class="imoje-intro">
<img width="85" alt="imoje" src="{$module_dir}logo.svg"/>
</span>
</div>
<div class="imoje-half">
<form id="imoje-configuration" method="post" name="imoje-configuration">
<h3>
<img src="{$module_dir}assets/img/icon-config.gif" alt="config icon"
class="config-icon"/>{l s='Configuration' mod='imoje'}
</h3>
<p class="t--strong">{l s='The module requires a configuration in the imoje administration panel. Go to imoje.ing.pl and log in to the administration panel. Go to stores tab and enter the notification address in the appropriate field and copy the configuration keys. Copy the keys into the fields described below.' mod='imoje'}</p>
<hr/>
{if $imoje_sandbox == 1}
<h3 id="sandbox_text_enabled">{l s='Sandbox mode is enabled' mod='imoje'}!</h3>
<hr/>
<br/>
{/if}
<div id="imoje">
<label for="imoje_debug_mode">{l s='Debug mode' mod='imoje'}</label>
<div class="margin-form">
<select name="imoje_debug_mode" class="imoje-sel-en">
<option value="0" {if $imoje_debug_mode == 0}selected{/if}>{l s='Off' mod='imoje'}</option>
<option value="1" {if $imoje_debug_mode == 1}selected{/if}>{l s='On' mod='imoje'}</option>
</select>
</div>
<label for="imoje_sandbox">{l s='Sandbox' mod='imoje'}</label>
<div class="margin-form">
<select name="imoje_sandbox" class="imoje-sel-en">
<option value="0" {if $imoje_sandbox == 0}selected{/if}>{l s='Off' mod='imoje'}</option>
<option value="1" {if $imoje_sandbox == 1}selected{/if}>{l s='On' mod='imoje'}</option>
</select>
</div>
<label for="imoje_create_order_arrangement">{l s='Create order' mod='imoje'}</label>
<div class="margin-form">
<select name="imoje_create_order_arrangement" class="imoje-sel-en">
<option value="0"
{if $imoje_create_order_arrangement == 0}selected{/if}>{l s='After checkout' mod='imoje'}</option>
<option value="1"
{if $imoje_create_order_arrangement == 1}selected{/if}>{l s='After IPN' mod='imoje'}</option>
</select>
</div>
<br/>
<div id="imoje_data">
<label for="imoje_merchant_id">{l s='Merchant ID' mod='imoje'}</label>
<div class="margin-form">
<input type="text" class="text" name="imoje_merchant_id" id="imoje_merchant_id"
value="{$imoje_merchant_id|escape:'htmlall':'UTF-8'}" required
data-error-msg="{l s='Merchant ID is not a valid key' mod='imoje'}"/>
</div>
<label for="imoje_service_id">{l s='Service ID' mod='imoje'}</label>
<div class="margin-form">
<input type="text" class="text" name="imoje_service_id" id="imoje_service_id"
value="{$imoje_service_id|escape:'htmlall':'UTF-8'}" required
data-error-msg="{l s='Service ID is not a valid key' mod='imoje'}"/>
</div>
<label for="imoje_service_key">{l s='Service key' mod='imoje'}</label>
<div class="margin-form">
<input type="text" class="text" name="imoje_service_key" id="imoje_service_key"
value="{$imoje_service_key|escape:'htmlall':'UTF-8'}" required
data-error-msg="{l s='Service Key is not a valid key' mod='imoje'}"/>
</div>
<label for="imoje_token">{l s='Authorization token' mod='imoje'}</label>
<div class="margin-form">
<input type="text" class="text" name="imoje_token" id="imoje_token"
value="{$imoje_token|escape:'htmlall':'UTF-8'}"/>
</div>
<br/>
<label for="imoje_ga_key">{l s='Google Analytics key' mod='imoje'}</label>
<div class="margin-form">
<input type="text" class="text" name="imoje_ga_key" id="imoje_ga_key"
value="{$imoje_ga_key|escape:'htmlall':'UTF-8'}"
data-error-msg="{l s='Google Analytics key is not a valid' mod='imoje'}"/>
</div>
<hr/>
<h3>
{l s='imoje' mod='imoje'}
</h3>
<hr/>
<br/>
<label for="imoje_payment_title">{l s='Payment title' mod='imoje'}</label>
<div class="margin-form">
<input type="text" class="text" name="imoje_payment_title" id="imoje_payment_title"
placeholder="{$imoje_payment_title_default}"
value="{if $imoje_payment_title}{$imoje_payment_title|escape:'htmlall':'UTF-8'}{/if}"/>
</div>
<label for='imoje_button'>{l s='Show payment button (checkout)' mod='imoje'}</label>
<div class="margin-form">
<input value="0"
name='imoje_imoje_button' type="hidden">
<input {if $imoje_imoje_button}checked{/if} value="1" class="checkbox"
name='imoje_imoje_button' type="checkbox">
{l s='Enable' mod='imoje'}
</div>
<label for='imoje_hide_brand'>{l s='Hide brand' mod='imoje'}</label>
<div class="margin-form">
<input value="0"
name='imoje_hide_brand' type="hidden">
<input {if $imoje_hide_brand}checked{/if} value="1" class="checkbox"
name='imoje_hide_brand' type="checkbox">
{l s='Enable' mod='imoje'}
</div>
<label for="imoje_currencies[]">{l s='Available currencies' mod='imoje'}
({l s='if you want pick more currency hold CTRl and press left button mouse on each one' mod='imoje'}
)</label>
<div class="margin-form">
<select class="imoje_currencies" name="imoje_currencies[]" multiple="multiple">
{foreach from=$imoje_available_currencies item=foo}
<option value="{$foo}"
{if in_array($foo, $imoje_currencies)}selected{/if}>{$foo}</option>
{/foreach}
</select>
</div>
<hr/>
<h3>
{l s='BLIK' mod='imoje'}
</h3>
<hr/>
<br/>
<label for="imoje_blik_payment_title">{l s='Payment title' mod='imoje'}</label>
<div class="margin-form">
<input type="text" class="text" name="imoje_blik_payment_title"
id="imoje_blik_payment_title"
placeholder="{$imoje_blik_payment_title_default}"
value="{if $imoje_blik_payment_title}{$imoje_blik_payment_title|escape:'htmlall':'UTF-8'}{/if}"/>
</div>
<label for='imoje_blik_button'>{l s='Show payment button (checkout)' mod='imoje'}</label>
<div class="margin-form">
<input value="0"
name='imoje_blik_button' type="hidden">
<input {if $imoje_blik_button}checked{/if} value="1" class="checkbox"
name='imoje_blik_button' type="checkbox">
{l s='Enable' mod='imoje'}
</div>
<label for='imoje_blik_hide_brand'>{l s='Hide brand' mod='imoje'}</label>
<div class="margin-form">
<input value="0"
name='imoje_blik_hide_brand' type="hidden">
<input {if $imoje_blik_hide_brand}checked{/if} value="1" class="checkbox"
name='imoje_blik_hide_brand' type="checkbox">
{l s='Enable' mod='imoje'}
</div>
<label for='imoje_blik_code_checkout'>{l s='Display code field to pay in store' mod='imoje'}</label>
<div class="margin-form">
<input value="0"
name='imoje_blik_code_checkout' type="hidden">
<input {if $imoje_blik_code_checkout}checked{/if} value="1" class="checkbox"
name='imoje_blik_code_checkout' type="checkbox">
{l s='Enable' mod='imoje'}
</div>
{* <label for='imoje_blik_oneclick'>{l s='Activate OneClick' mod='imoje'}</label>*}
{* <div class="margin-form">*}
{* <input value="0"*}
{* name='imoje_blik_oneclick' type="hidden">*}
{* <input {if $imoje_blik_oneclick}checked{/if} value="1" class="checkbox"*}
{* name='imoje_blik_oneclick' type="checkbox">*}
{* {l s='Enable' mod='imoje'}*}
{* </div>*}
<label for="imoje_blik_currencies[]">{l s='Available currencies' mod='imoje'}
({l s='if you want pick more currency hold CTRl and press left button mouse on each one' mod='imoje'}
)</label>
<div class="margin-form">
<select class="imoje_blik_currencies" name="imoje_blik_currencies[]" multiple="multiple">
{foreach from=$imoje_available_currencies item=foo}
<option value="{$foo}"
{if in_array($foo, $imoje_blik_currencies)}selected{/if}>{$foo}</option>
{/foreach}
</select>
</div>
<hr/>
<h3>
{l s='PBL' mod='imoje'}
</h3>
<hr/>
<br/>
<label for="imoje_pbl_payment_title">{l s='Payment title' mod='imoje'}</label>
<div class="margin-form">
<input type="text" class="text" name="imoje_pbl_payment_title" id="imoje_pbl_payment_title"
placeholder="{$imoje_pbl_payment_title_default}"
value="{if $imoje_pbl_payment_title}{$imoje_pbl_payment_title|escape:'htmlall':'UTF-8'}{/if}"/>
</div>
<label for='imoje_pbl_button'>{l s='Show payment button (checkout)' mod='imoje'}</label>
<div class="margin-form">
<input value="0"
name='imoje_pbl_button' type="hidden">
<input {if $imoje_pbl_button}checked{/if} value="1" class="checkbox"
name='imoje_pbl_button' type="checkbox">
{l s='Enable' mod='imoje'}
</div>
<label for='imoje_pbl_hide_brand'>{l s='Hide brand' mod='imoje'}</label>
<div class="margin-form">
<input value="0"
name='imoje_pbl_hide_brand' type="hidden">
<input {if $imoje_pbl_hide_brand}checked{/if} value="1" class="checkbox"
name='imoje_pbl_hide_brand' type="checkbox">
{l s='Enable' mod='imoje'}
</div>
<label for="imoje_pbl_currencies[]">{l s='Available currencies' mod='imoje'}
({l s='if you want pick more currency hold CTRl and press left button mouse on each one' mod='imoje'}
)</label>
<div class="margin-form">
<select class="imoje_pbl_currencies" name="imoje_pbl_currencies[]" multiple="multiple">
{foreach from=$imoje_available_currencies item=foo}
<option value="{$foo}"
{if in_array($foo, $imoje_pbl_currencies)}selected{/if}>{$foo}</option>
{/foreach}
</select>
</div>
<hr/>
<h3>
{l s='Cards' mod='imoje'}
</h3>
<hr/>
<br/>
<label for="imoje_cards_payment_title">{l s='Payment title' mod='imoje'}</label>
<div class="margin-form">
<input type="text" class="text" name="imoje_cards_payment_title" id="imoje_cards_payment_title"
placeholder="{$imoje_cards_payment_title_default}"
value="{if $imoje_cards_payment_title}{$imoje_cards_payment_title|escape:'htmlall':'UTF-8'}{/if}"/>
</div>
<label for='imoje_cards_button'>{l s='Show payment button (checkout)' mod='imoje'}</label>
<div class="margin-form">
<input value="0"
name='imoje_cards_button' type="hidden">
<input {if $imoje_cards_button}checked{/if} value="1" class="checkbox"
name='imoje_cards_button' type="checkbox">
{l s='Enable' mod='imoje'}
</div>
<label for='imoje_cards_hide_brand'>{l s='Hide brand' mod='imoje'}</label>
<div class="margin-form">
<input value="0"
name='imoje_cards_hide_brand' type="hidden">
<input {if $imoje_cards_hide_brand}checked{/if} value="1" class="checkbox"
name='imoje_cards_hide_brand' type="checkbox">
{l s='Enable' mod='imoje'}
</div>
<label for="imoje_cards_currencies[]">{l s='Available currencies' mod='imoje'}
({l s='if you want pick more currency hold CTRl and press left button mouse on each one' mod='imoje'}
)</label>
<div class="margin-form">
<select class="imoje_cards_currencies" name="imoje_cards_currencies[]" multiple="multiple">
{foreach from=$imoje_available_currencies item=foo}
<option value="{$foo}"
{if in_array($foo, $imoje_cards_currencies)}selected{/if}>{$foo}</option>
{/foreach}
</select>
</div>
<hr/>
<h3>
{l s='imoje pay later' mod='imoje'}
</h3>
<hr/>
<br/>
<label for="imoje_paylater_payment_title">{l s='Payment title' mod='imoje'}</label>
<div class="margin-form">
<input type="text" class="text" name="imoje_paylater_payment_title"
id="imoje_paylater_payment_title"
placeholder="{$imoje_paylater_payment_title_default}"
value="{if $imoje_paylater_payment_title}{$imoje_paylater_payment_title|escape:'htmlall':'UTF-8'}{/if}"/>
</div>
<label for='imoje_paylater_button'>{l s='Show payment button (checkout)' mod='imoje'}</label>
<div class="margin-form">
<input value="0"
name='imoje_paylater_button' type="hidden">
<input {if $imoje_paylater_button}checked{/if} value="1" class="checkbox"
name='imoje_paylater_button' type="checkbox">
{l s='Enable' mod='imoje'}
</div>
<label for='imoje_paylater_hide_brand'>{l s='Hide brand' mod='imoje'}</label>
<div class="margin-form">
<input value="0"
name='imoje_paylater_hide_brand' type="hidden">
<input {if $imoje_paylater_hide_brand}checked{/if} value="1" class="checkbox"
name='imoje_paylater_hide_brand' type="checkbox">
{l s='Enable' mod='imoje'}
</div>
<label for="imoje_paylater_currencies[]">{l s='Available currencies' mod='imoje'}
({l s='if you want pick more currency hold CTRl and press left button mouse on each one' mod='imoje'}
)</label>
<div class="margin-form">
<select class="imoje_paylater_currencies" name="imoje_paylater_currencies[]"
multiple="multiple">
{foreach from=$imoje_available_currencies item=foo}
<option value="{$foo}"
{if in_array($foo, $imoje_paylater_currencies)}selected{/if}>{$foo}</option>
{/foreach}
</select>
</div>
<hr/>
<p>
{l s='Your addres for notifications' mod='imoje'}: <span
class="imoje-text-bold">{$imoje_notification_url}</span>
</p>
<hr/>
</div>
<div class="margin-form">
<input id="submit-imoje-configuration" type="submit" class="btn btn-primary" name="submitiMoje"
value="{l s='Save' mod='imoje'}"/>
</div>
</div>
</form>
</div>
</div>

View File

@@ -0,0 +1,11 @@
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -0,0 +1,8 @@
<section>
<p>
{l s='I declare that I have read and accepted' mod='imoje'}
<a href="https://data.imoje.pl/docs/imoje_regulamin_platnosci.pdf" target="_blank">{l s='imoje terms and conditions' mod='imoje'}</a>
{l s='and' mod='imoje'}
<a href="https://data.imoje.pl/docs/imoje_informacja_administratora_danych_osobowych.pdf" target="_blank">{l s='imoje privacy information' mod='imoje'}</a>
</p>
</section>

View File

@@ -0,0 +1,129 @@
{if !$imoje_twisto_arrangement_call_js }
<style>
.hidden {
display:none;
}
</style>
<div id="twisto_loading" class="hidden" style="position:fixed; top:0; left:0; right:0; bottom:0; z-index:50000; background: rgba(0,0,0,.5)">
<div style="background: #fbfbfb none; border: 1px solid #d6d4d4; border-radius: 4px; transform:translate(-50%, -50%); position:absolute; top:50%; left:50%; color:black;padding:20px;">
<img id="loading-gif"
src="{$loading_gif}" alt="Loading"
style="display: block; margin-left: auto; margin-right: auto;"/><br/>
{$twisto_hint}
</div>
</div>
<script type="text/javascript">
var twistoConfig = {
public_key: '{$imoje_payment_methods.twisto.pk}',
script: '{$imoje_twisto_script_url}'
},
$form,
twistoTimeout,
twistoTimeoutFlag = false,
timeBeforeCheck,
isClicked = false,
$button,
$twistoData;
(function (e, g, a) {
function h(a) {
return function () {
b._.push([a, arguments])
}
}
var f = ["check"], b = e || {}, c = document.createElement(a);
a = document.getElementsByTagName(a)[0];
b._ = [];
for (var d = 0; d < f.length; d++) {
b[f[d]] = h(f[d]);
}
this[g] = b;
c.type = "text/javascript";
c.async = !0;
c.src = e.script;
a.parentNode.insertBefore(c, a);
delete e.script
}).call(window, twistoConfig, "Twisto", "script");
function timeout() {
return setTimeout(function () {
processForm({
"details": "timeout"
});
}, {$imoje_payment_methods.twisto.timeout});
}
function processForm(response) {
clearTimeout(twistoTimeout);
response.timeResponse = (new Date()).getTime() - timeBeforeCheck;
$button = $('<button type="submit" id="twisto-send-form" class="hidden"></button>');
$twistoData = $('<input name="twistoData" type="hidden" id="twisto-data" />');
$form.append($button, $twistoData);
$twistoData.val(JSON.stringify(response));
$button[0].click();
}
document.addEventListener("DOMContentLoaded", function (event) {
$form = $("form[action='{$imoje_link_twisto}']");
$form[0].onsubmit = function (e) {
if (!$(`[data-module-name='twisto']`)[0].checked || isClicked) {
return;
}
e.preventDefault();
document.getElementById('twisto_loading').classList.remove("hidden");
// region support for one-page checkout
var cgv = document.getElementById("cgv");
if (cgv && !cgv.checked) {
return false;
}
// endregion
if (isClicked) {
return false;
}
isClicked = true;
timeBeforeCheck = (new Date()).getTime();
twistoTimeout = timeout();
Twisto.check("{$imoje_twisto_payload}", function (response) {
processForm(response);
}, function (response) {
if (!response) {
response = {
"details": "errorCallback"
}
}
processForm(response);
}, {
"processingStarted": function () {
if (twistoTimeoutFlag) {
return;
}
twistoTimeoutFlag = true;
clearTimeout(twistoTimeout);
twistoTimeout = timeout();
}
}
);
}
})
</script>
{/if}

View File

@@ -0,0 +1,11 @@
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;