Skip to content

Commit

Permalink
Merge pull request #624 from Adyen/develop-3
Browse files Browse the repository at this point in the history
Release version 3.17.8
  • Loading branch information
goran-stamenkovski-logeecom authored Feb 19, 2025
2 parents 955304d + b5061dc commit 3433c41
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}
],
"description": "Official Shopware 6 Plugin to connect to Payment Service Provider Adyen",
"version": "3.17.7",
"version": "3.17.8",
"type": "shopware-platform-plugin",
"license": "MIT",
"require": {
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
data-user-logged-in="{{ adyenFrontendData.userLoggedIn }}"
data-affiliate-code="{{ adyenFrontendData.affiliateCode }}"
data-campaign-code="{{ adyenFrontendData.campaignCode }}"
data-shipping-methods-response="{{ adyenFrontendData.shippingMethodsResponse }}"
data-shipping-methods-response="{{ adyenFrontendData.shippingMethodsResponse|json_encode }}"
data-google-merchant-id="{{ adyenFrontendData.googleMerchantId }}"
data-gateway-merchant-id="{{ adyenFrontendData.gatewayMerchantId }}"
></div>
Expand Down
9 changes: 4 additions & 5 deletions src/Service/PaymentMethodsFilterService.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
use Shopware\Core\Checkout\Payment\PaymentMethodEntity;
use Shopware\Core\Checkout\Payment\SalesChannel\AbstractPaymentMethodRoute;
use Shopware\Core\Framework\Context;
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository;
use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\EqualsAnyFilter;
use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\EqualsFilter;
Expand Down Expand Up @@ -74,9 +73,9 @@ class PaymentMethodsFilterService
/**
* @var AbstractPaymentMethodRoute
*/
private AbstractPaymentMethodRoute $paymentMethodRoute;
private $paymentMethodRoute;

private EntityRepository $paymentMethodRepository;
private $paymentMethodRepository;

/**
* PaymentMethodsFilterService constructor.
Expand All @@ -86,7 +85,7 @@ class PaymentMethodsFilterService
* @param ExpressCheckoutRepository $expressCheckoutRepository
* @param Currency $currency
* @param AbstractPaymentMethodRoute $paymentMethodRoute
* @param EntityRepository $paymentMethodRepository
* @param $paymentMethodRepository
*/
public function __construct(
ConfigurationService $configurationService,
Expand Down Expand Up @@ -415,7 +414,7 @@ public function getAvailableExpressCheckoutPaymentMethods(
$filteredMethods = array_values(
array_filter($paymentMethods, function ($method) use ($allowedMethods) {
$type = $method['type'];
if (!$allowedMethods[$type]) {
if (!array_key_exists($type, $allowedMethods) || !$allowedMethods[$type]) {
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Subscriber/PaymentSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,14 @@ public function onShoppingCartLoaded(PageLoadedEvent $event)
);

$expressCheckoutConfigurationAvailable = true;
$expressCheckoutConfiguration = [];
$googlePayAvailable = $this->configurationService->isGooglePayExpressCheckoutEnabled();
$payPalAvailable = $this->configurationService->isPayPalExpressCheckoutEnabled();
$applePayAvailable = $this->configurationService->isApplePayExpressCheckoutEnabled();

// If express checkout feature is disabled, returns empty payment method response
if (!$googlePayAvailable && !$payPalAvailable && !$applePayAvailable) {
$expressCheckoutConfigurationAvailable = false;
$expressCheckoutConfiguration = [];
}

if ($expressCheckoutConfigurationAvailable) {
Expand Down Expand Up @@ -398,14 +398,14 @@ public function onProductPageLoaded(PageLoadedEvent $event): void
$campaignCode = $this->requestStack->getSession()->get(AffiliateTrackingListener::CAMPAIGN_CODE_KEY);

$expressCheckoutConfigurationAvailable = true;
$expressCheckoutConfiguration = [];
$googlePayAvailable = $this->configurationService->isGooglePayExpressCheckoutEnabled();
$payPalAvailable = $this->configurationService->isPayPalExpressCheckoutEnabled();
$applePayAvailable = $this->configurationService->isApplePayExpressCheckoutEnabled();

// If express checkout feature is disabled, returns empty payment method response
if (!$googlePayAvailable && !$payPalAvailable && !$applePayAvailable) {
$expressCheckoutConfigurationAvailable = false;
$expressCheckoutConfiguration = [];
}

if ($expressCheckoutConfigurationAvailable) {
Expand Down

0 comments on commit 3433c41

Please # to comment.