From 14557364c755c5b461d129d7627d3fcb8ed2a025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20H=C3=BCsken?= Date: Thu, 16 Jan 2025 12:51:51 +0100 Subject: [PATCH] Don't display old klarna GWs on Settings page --- src/Settings/Page/Section/PaymentMethods.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/Settings/Page/Section/PaymentMethods.php b/src/Settings/Page/Section/PaymentMethods.php index 11fc8f67..16cfaded 100644 --- a/src/Settings/Page/Section/PaymentMethods.php +++ b/src/Settings/Page/Section/PaymentMethods.php @@ -41,13 +41,13 @@ public function renderGateways(): string 'mollie-payments-for-woocommerce' ); $descriptionActivePaymentMethods = __( - 'These payment methods are active in your Mollie profile. + 'These payment methods are active in your Mollie profile. You can enable these payment methods in their settings to make them available for your customers.', 'mollie-payments-for-woocommerce' ); $titleInactivePaymentMethods = __('Inactive Payment Methods', 'mollie-payments-for-woocommerce'); $descriptionInactivePaymentMethods = __( - 'These payment methods are available in your Mollie profile but are + 'These payment methods are available in your Mollie profile but are not currently active. Activate them to offer more payment options to your customers.', 'mollie-payments-for-woocommerce' ); @@ -61,6 +61,13 @@ public function renderGateways(): string $gatewayKey = 'mollie_wc_gateway_' . $paymentMethodId; $enabledInMollie = array_key_exists($gatewayKey, $this->mollieGateways); + //don't display old klarna GWs + if (isset($this->paymentMethods['klarna']) && in_array($paymentMethodId, ['klarnasliceit', 'klarnapaylater', 'klarnapaynow'], true)) { + if (!$enabledInMollie) { + continue; + } + } + $paymentGatewayButton = $this->paymentGatewayButton($paymentMethod, $enabledInMollie); if ($enabledInMollie) { $activatedGateways .= $paymentGatewayButton; @@ -88,7 +95,7 @@ protected function paymentGatewaysBlock(string $title, string $description, stri

- +
- getIconUrl(); // WPCS: XSS ok.?> + getIconUrl(); // phpcs:ignore XSS ok.?> title());?> - - + +