Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/PAYPAL-890_OXID7_TakeOver_v252-r…
Browse files Browse the repository at this point in the history
…c4' into PAYPAL-890_OXID7_TakeOver_v252-rc4
  • Loading branch information
mariolorenz committed Jan 10, 2025
2 parents 39d610a + e9bb0af commit 0666747
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 29 deletions.
6 changes: 3 additions & 3 deletions src/Core/ShopControl.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ class ShopControl extends ShopControl_parent
/**
* @param StandardException $exception
*/
protected function _handleBaseException($exception) // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
protected function handleBaseException($exception) // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
{
if ($exception instanceof PayPalException) {
$this->handleCustomPayPalException($exception);
} else {
parent::_handleBaseException($exception);
parent::handleBaseException($exception);
}
} // @codeCoverageIgnore

Expand All @@ -41,7 +41,7 @@ public function handleCustomPayPalException(PayPalException $exception): void
} elseif ($exception instanceof Redirect) {
$this->handlePayPalRedirectException($exception, false);
} else {
parent::_handleBaseException($exception);
parent::handleBaseException($exception);
}
} // @codeCoverageIgnore

Expand Down
45 changes: 19 additions & 26 deletions views/twig/extensions/themes/default/layout/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,21 @@
{{ parent() }}
{% if oViewConf.isPayPalCheckoutActive() %}
{% set className = oViewConf.getTopActiveClassName() %}
{% if oViewConf.isPayPalExpressPaymentEnabled() and
((className == 'order' and not oViewConf.isPayPalACDCSessionActive()) or (className != 'order' and className != 'payment')) and
(
(oxcmp_basket.getProductsCount() and oViewConf.showPayPalMiniBasketButton()) or
(className == 'details' and oViewConf.showPayPalProductDetailsButton()) or
(className == 'basket' and oViewConf.showPayPalBasketButton())
)
%}
<script src="{{ oViewConf.getBaseDir() }}/out/modules/osc_paypal/js/paypal-frontend.min.js?v=1"></script>
<script src="{{ oViewConf.getPayPalJsSdkUrl()|raw }}"
data-partner-attribution-id="{{ oViewConf.getPayPalPartnerAttributionIdForBanner() }}"
onload="window.OxidPayPal.onSDKLoaded()"
></script>
{% set sCountryRestriction = oViewConf.getCountryRestrictionForPayPalExpress() %}
{% if sCountryRestriction %}
<script>
const countryRestriction = [{{ sCountryRestriction }}];
</script>
{% endif %}
{% elseif className == 'order' and oViewConf.isPayPalACDCSessionActive() %}
<script src="{{ oViewConf.getPayPalJsSdkUrlForACDC()|raw }}" data-client-token="{{ oViewConf.getDataClientToken() }}"></script>
{% elseif className == 'payment' %}
<script src="{{ oViewConf.getPayPalJsSdkUrlForButtonPayments()|raw }}" data-partner-attribution-id="{{ oViewConf.getPayPalPartnerAttributionIdForBanner() }}"></script>
{% elseif oViewConf.isPayPalBannerActive() and (className == 'start' or className == 'search' or className == 'details' or className == 'alist' or className == 'basket') %}
<script src="{{ oViewConf.getPayPalApiBannerUrl()|raw }}" data-partner-attribution-id="{{ oViewConf.getPayPalPartnerAttributionIdForBanner() }}"></script>
{% set sFileMTime = oViewConf.getModulePath('osc_paypal', 'js/paypal-frontend.min.js') %}
<script src="{{ oViewConf.getModuleUrl('osc_paypal','js/paypal-frontend.min.js') }}"></script>
<script src="{{ oViewConf.getPayPalJsSdkUrl() }}"
{% if oViewConf.isVaultingEligibility() %}
data-user-id-token="{{ oViewConf.getUserIdForVaulting() }}"
{% endif %}
data-partner-attribution-id="{{ oViewConf.getPayPalPartnerAttributionIdForBanner() }}"
data-client-token="{{ oViewConf.getDataClientToken() }}"
onload="window.OxidPayPal.onSDKLoaded()"
></script>
{% set sCountryRestriction = oViewConf.getCountryRestrictionForPayPalExpress() %}
{% if sCountryRestriction %}
<script>
const countryRestriction = [{{ sCountryRestriction }}];
</script>
{% endif %}
{% if submitCart %}
<script>
Expand All @@ -40,5 +30,8 @@

{% block base_style %}
{{ parent() }}
{{ style({ include: oViewConf.getModuleUrl('osc_paypal', 'css/paypal.css') }) }}
{% if oViewConf.isPayPalCheckoutActive() %}
{{ style({ include: oViewConf.getModuleUrl('osc_paypal', 'css/paypal.min.css') }) }}
{% endif %}

{% endblock %}

0 comments on commit 0666747

Please sign in to comment.