First upload

This commit is contained in:
Nikolai Fesenko
2025-02-02 13:37:56 +01:00
commit 8d227c9191
3281 changed files with 362319 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 474 B

View File

@@ -0,0 +1,231 @@
/**
* This file is part of O3-Shop Paypal module.
*
* O3-Shop is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* O3-Shop is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with O3-Shop. If not, see <http://www.gnu.org/licenses/>
*
* @copyright Copyright (c) 2022 OXID eSales AG (https://www.oxid-esales.com)
* @copyright Copyright (c) 2022 O3-Shop (https://www.o3-shop.com)
* @license https://www.gnu.org/licenses/gpl-3.0 GNU General Public License 3 (GPLv3)
*/
var PayPalPopUp = (function ($) {
var popUpBlock, popUpOverlay, popUpClose;
var obj = {
init: function () {
popUpOverlay = $('#paypalOverlay');
popUpOverlay.click(PayPalPopUp.hidePopUp);
$('.popUpLink').click(PayPalPopUp.actionHandler);
},
/**
* action handler
* @param e event
*/
actionHandler: function (e) {
var oBlock = $('#' + $(this).data('block'));
PayPalPopUp.showPopUp(oBlock);
e.stopPropagation();
},
showPopUp: function (oBlock) {
popUpBlock = oBlock;
popUpOverlay.show();
popUpBlock.show();
popUpClose = $('<a class="paypalPopUpClose" href="#">x</a>');
popUpClose.click(PayPalPopUp.hidePopUp);
popUpBlock.prepend(popUpClose);
fixBlockPosition(popUpBlock);
},
/**
* hides popUp
*/
hidePopUp: function (e) {
popUpClose.remove();
popUpOverlay.hide();
popUpBlock.hide();
}
};
function fixBlockPosition(oBlock) {
var blockHeight = oBlock.outerHeight();
var blockWidth = oBlock.outerWidth();
var domHeight = $(document).height();
var domWidth = $(document).width();
var topMargin = Math.max((domHeight - blockHeight) / 3, 0);
var leftMargin = Math.max((domWidth - blockWidth) / 2, 0);
oBlock.css({top: topMargin, left: leftMargin});
}
return obj;
})(jQuery);
var PayPalActions = (function ($) {
var popUpBlock, popUpBlockContent, popUpBlocks, popUpOverlay, statusList;
var obj = {
actionOptions: {
'refund': {
refund_amount: 'amount',
refund_type: 'type',
transaction_id: 'transid',
full_amount: 'amount'
},
'capture': {
capture_amount: 'amount',
capture_type: 'type',
full_amount: 'amount'
}
},
/**
* initiates PayPal actions
*/
init: function () {
popUpBlock = $('#paypalActions');
popUpBlockContent = $('#paypalActionsContent', popUpBlock);
popUpBlocks = $('#paypalActionsBlocks');
statusList = $('#paypalStatusList');
popUpBlockContent.delegate('select.amountSelect', 'change', PayPalActions.amountSelectActionHandler);
$('.actionLink').click(PayPalActions.actionHandler);
},
/**
* action handler
* @param e event
*/
actionHandler: function (e) {
var sAction = $(this).data('action');
PayPalActions.showPopUp(sAction, $(this).data());
e.stopPropagation();
},
/**
* shows popUp
* @param sAction
* @param oOptions
*/
showPopUp: function (sAction, oOptions) {
popUpBlockContent.empty();
var sBlock = $('#' + sAction + 'Block', popUpBlocks);
popUpBlockContent.html(sBlock.html());
var oFormOptions = getFormOptions(sAction, oOptions);
setFormOptions(popUpBlock, oFormOptions);
showOrderStatusList(oOptions['statuslist'], oOptions['activestatus']);
PayPalPopUp.showPopUp(popUpBlock);
},
/**
* changes action type in select box
*/
amountSelectActionHandler: function () {
var selected = $(this).find(":selected");
setAmountInputState($(this));
showOrderStatusList(selected.data('statuslist'), selected.data('activestatus'));
}
};
/**
*
* @private
*/
function setAmountInputState(oEl) {
var oInput = $('#' + oEl.data('input'));
var dAmount = $('input[name=full_amount]', popUpBlock).val();
var disabled = ( oEl.find(':selected').data('disabled') == 1 );
oInput.attr('disabled', disabled).val(dAmount);
}
/**
*
* @private
*/
function showOrderStatusList(oStatusList, sActiveStatus) {
var oPlaceholder = $('.paypalStatusListPlaceholder', popUpBlockContent).empty();
if (oStatusList.length <= 1 || $.type(oStatusList) == 'string') {
var sStatus = ($.type(oStatusList) == 'string') ? oStatusList : oStatusList[0];
appendStatusHiddenInput(sStatus, oPlaceholder);
return;
}
oPlaceholder.html(statusList.html());
$('span', oPlaceholder).hide();
$.each(oStatusList, function (key, value) {
var activeStatusBlock = $('#' + value + 'Status', oPlaceholder).show();
$('input[type=radio]', activeStatusBlock).attr('checked', value == sActiveStatus);
});
}
/**
* Appends status hidden input to given placeholder
*
* @param sStatus
* @param oPlaceholder
*/
function appendStatusHiddenInput(sStatus, oPlaceholder) {
var checkbox = $('#' + sStatus + 'StatusCheckbox', statusList);
var input = $('<input type="hidden" />');
input.attr({name: checkbox.attr('name'), value: checkbox.attr('value')});
oPlaceholder.append(input);
}
/**
* Sets given options to given form inputs
*
* @param oForm
* @param oFormOptions
* @private
*/
function setFormOptions(oForm, oFormOptions) {
$('input, select', oForm).each(function (i) {
var inputName = $(this).attr('name');
if (inputName in oFormOptions) {
$(this).val(oFormOptions[inputName]).change();
}
});
}
/**
* forms options array with values for given action
* @param sAction
* @param oAllOptions
* @returns object
*/
function getFormOptions(sAction, oAllOptions) {
var oOptions = {action: sAction};
if (sAction in PayPalActions.actionOptions) {
$.each(PayPalActions.actionOptions[sAction], function (key, value) {
oOptions[key] = oAllOptions[value];
});
}
return oOptions;
}
return obj;
})(jQuery);
$(document).ready(function () {
PayPalPopUp.init();
PayPalActions.init();
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@@ -0,0 +1,87 @@
/**
* This file is part of O3-Shop Paypal module.
*
* O3-Shop is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* O3-Shop is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with O3-Shop. If not, see <http://www.gnu.org/licenses/>
*
* @copyright Copyright (c) 2022 OXID eSales AG (https://www.oxid-esales.com)
* @copyright Copyright (c) 2022 O3-Shop (https://www.o3-shop.com)
* @license https://www.gnu.org/licenses/gpl-3.0 GNU General Public License 3 (GPLv3)
*/
.paypalExpressCheckoutBox {
margin-bottom: 10px;
text-align: center;
}
.paypalExpressCheckoutMsg {
position: relative;
margin: 0;
line-height: 20px;
white-space: nowrap;
}
.paypalExpressCheckoutMsg input {
line-height: 20px;
margin: 0;
}
.payment .paypalDescBox {
position: relative;
margin: 10px 0;
}
.payment .paypalPaymentDesc {
margin: 12px 0 5px;
}
.paypalHelpIcon {
display: inline-block;
width: 18px;
height: 18px;
background: #eee;
border: 1px solid #ccc;
border-radius: 5px;
line-height: 18px;
text-align: center;
font-weight: bold;
color: #777;
}
.paypalHelpIcon.small {
width: 16px;
height: 16px;
line-height: 16px;
}
.paypalDescBox .helpIcon:hover {
color: #777;
border-color: #aaa;
}
.paypalHelpBox {
display: none;
position: absolute;
width: 190px;
white-space: normal;
color: #333;
}
.paypalCheckoutBtn {
height: 35px;
}
.paypalCheckoutBtn[disabled] {
opacity: 0.5;
}
#paypalPartnerLogo {
margin-top: 15px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@@ -0,0 +1,48 @@
/**
* This file is part of O3-Shop Paypal module.
*
* O3-Shop is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* O3-Shop is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with O3-Shop. If not, see <http://www.gnu.org/licenses/>
*
* @copyright Copyright (c) 2022 OXID eSales AG (https://www.oxid-esales.com)
* @copyright Copyright (c) 2022 O3-Shop (https://www.o3-shop.com)
* @license https://www.gnu.org/licenses/gpl-3.0 GNU General Public License 3 (GPLv3)
*/
var oECConfirmation = (function () {
var _oPageContainer, _oConfirmation, _oHideButton, _oPage;
var obj = {
init: function () {
_oPage = $("#page");
_oPageContainer = $("#page .container").first();
_oConfirmation = $("#ECConfirmation");
_oHideButton = $(".hideECConfirmation");
_displayConfirmation();
_oHideButton.click(_displayContent);
}
};
function _displayConfirmation() {
_oPageContainer.hide();
_oConfirmation.appendTo(_oPage).show();
}
function _displayContent() {
_oConfirmation.hide();
_oPageContainer.show();
return false;
}
return obj;
})();

View File

@@ -0,0 +1,164 @@
/**
* This file is part of O3-Shop Paypal module.
*
* O3-Shop is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* O3-Shop is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with O3-Shop. If not, see <http://www.gnu.org/licenses/>
*
* @copyright Copyright (c) 2022 OXID eSales AG (https://www.oxid-esales.com)
* @copyright Copyright (c) 2022 O3-Shop (https://www.o3-shop.com)
* @license https://www.gnu.org/licenses/gpl-3.0 GNU General Public License 3 (GPLv3)
*/
.paypalExpressCheckoutBox {
min-width: 145px;
float: right;
padding-right: 15px;
margin-right: 18px;
border-right: 1px solid #ccc;
}
.paypalExpressCheckoutMsg {
position: relative;
margin: 0;
line-height: 20px;
font-size: 11px;
white-space: nowrap;
}
.paypalExpressCheckoutMsg input {
float: left;
line-height: 20px;
}
.payment .paypalDescBox {
position: relative;
margin: 10px 0;
}
.payment .paypalPaymentDesc {
margin: 12px 0 5px;
}
.paypalHelpIcon {
position: absolute;
left: 163px;
top: 23px;
display: block;
width: 18px;
height: 18px;
background: #eee;
border: 1px solid #ccc;
border-radius: 5px;
line-height: 18px;
text-align: center;
font-weight: bold;
color: #777;
}
.paypalHelpIcon.small {
top: 0;
left: -20px;
width: 16px;
height: 16px;
line-height: 16px;
}
.paypalDescBox .helpIcon:hover {
color: #777;
border-color: #aaa;
}
.paypalHelpBox {
top: 22px;
left: -20px;
width: 190px;
white-space: normal;
color: #333;
}
#paypalPartnerLogo {
margin-top: 15px;
}
/*Express checkout in mini basket*/
#paypalExpressCheckoutMiniBasketImage {
height: 32px;
}
#paypalExpressCheckoutMiniBasketBox {
border: none;
float: left;
height: auto;
margin-top: 10px;
}
#paypalExpressCheckoutMiniBasketBox .paypalExpressCheckoutMsg {
margin-left: 20px;
}
/*Express checkout in checkout user step page*/
.oePayPalECSForm {
padding: 10px;
position: relative;
}
.lineBox.paypalExpressCheckoutBoxUser {
height: auto;
background-color: #f2f4f5;
}
.paypalExpressCheckoutBoxUser .paypalExpressCheckoutMsg {
margin-left: 0px;
}
/*Express checkout in details page*/
.paypalExpressCheckoutDetailsBox {
border: none;
float: left;
height: auto;
margin: 0;
padding: 0;
width: 100%;
}
.paypalExpressCheckoutDetailsBox .paypalExpressCheckoutMsg {
float: left;
margin-left: 22px;
}
.paypalExpressCheckoutDetailsButton {
padding-top: 10px;
}
.paypalExpressCheckoutDetailsButton[disabled] {
opacity: 0.5;
}
#productPrice, #amountToBasket {
float: left;
}
/*Express checkout popup*/
.oePayPalPopupNav {
text-align: right;
margin-top: 10px;
}
.oePayPalPopupNav a {
font-weight: bold;
}
.oePayPalPopupNav button {
margin-left: 15px;
}
#details_container #paypal-installment-banner-container {
padding-bottom: 20px;
}

View File

@@ -0,0 +1,23 @@
/**
* This file is part of OXID eSales PayPal module.
*
* OXID eSales PayPal module is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OXID eSales PayPal module is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OXID eSales PayPal module. If not, see <http://www.gnu.org/licenses/>.
*
* @link http://www.oxid-esales.com
* @copyright (C) OXID eSales AG 2003-2020
*/
#paypal-installment-banner-container {
margin-bottom: 1rem;
}

View File

@@ -0,0 +1,43 @@
/**
* This file is part of O3-Shop Paypal module.
*
* O3-Shop is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* O3-Shop is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with O3-Shop. If not, see <http://www.gnu.org/licenses/>
*
* @copyright Copyright (c) 2022 OXID eSales AG (https://www.oxid-esales.com)
* @copyright Copyright (c) 2022 O3-Shop (https://www.o3-shop.com)
* @license https://www.gnu.org/licenses/gpl-3.0 GNU General Public License 3 (GPLv3)
*/
(function ($) {
/**
* Changes form function name and submits.
*/
var oePayPalOnClickProceedAction = {
options: {
sAction: 'actionExpressCheckoutFromDetailsPage',
sForm: '#detailsMain form.js-oxProductForm'
},
_create: function () {
var self = this;
$(self.element).click(function (e) {
e.preventDefault();
$(self.options.sForm + ' input[name="fnc"]').val(self.options.sAction);
$(self.options.sForm).submit();
});
}
};
$.widget("ui.oePayPalOnClickProceedAction", oePayPalOnClickProceedAction);
})(jQuery);