diff --git a/src/Service/PaymentMethodsService.php b/src/Service/PaymentMethodsService.php index c8aa71e0..e1fe7f11 100644 --- a/src/Service/PaymentMethodsService.php +++ b/src/Service/PaymentMethodsService.php @@ -127,7 +127,7 @@ public function getPaymentMethods(SalesChannelContext $context, $orderId = ''): return CacheValueCompressor::uncompress($paymentMethodsResponseCache->get()); } - $responseData = []; + $responseData = new PaymentMethodsResponse(); try { $paymentsApiService = new PaymentsApi( $this->clientService->getClient($context->getSalesChannelId()) diff --git a/src/Subscriber/PaymentSubscriber.php b/src/Subscriber/PaymentSubscriber.php index a586cc94..8b04500f 100644 --- a/src/Subscriber/PaymentSubscriber.php +++ b/src/Subscriber/PaymentSubscriber.php @@ -238,7 +238,7 @@ public function onShoppingCartLoaded(PageLoadedEvent $event) $giftcards = []; if ($paymentMethod && $paymentMethod->getActive()) { $giftcards = $this->paymentMethodsFilterService->filterAdyenPaymentMethodsByType( - $paymentMethods->getPaymentMethods(), + $paymentMethods->getPaymentMethods() ?? [], 'giftcard' ); }