From f9c612d3c8fbf0e8878b1c4b5bff09d5e6c2c33e Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Thu, 30 Jan 2025 17:58:35 +0100 Subject: [PATCH] Bypass generic gateway for blocks for the moment --- src/Assets/AssetsModule.php | 8 ++++---- src/PaymentMethods/AbstractPaymentMethod.php | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Assets/AssetsModule.php b/src/Assets/AssetsModule.php index 82c735bc..b5644901 100644 --- a/src/Assets/AssetsModule.php +++ b/src/Assets/AssetsModule.php @@ -27,7 +27,7 @@ public function run(ContainerInterface $container): bool return true; } - public function enqueueBlockCheckoutScripts(Data $dataService, array $gatewayInstances): void + public function enqueueBlockCheckoutScripts(Data $dataService, array $gatewayInstances, ContainerInterface $container): void { if (!has_block('woocommerce/checkout')) { return; @@ -36,7 +36,7 @@ public function enqueueBlockCheckoutScripts(Data $dataService, array $gatewayIns wp_enqueue_style('mollie-gateway-icons'); wp_enqueue_style('mollie-block-custom-field'); - MollieCheckoutBlocksSupport::localizeWCBlocksData($dataService, $gatewayInstances); + MollieCheckoutBlocksSupport::localizeWCBlocksData($dataService, $gatewayInstances, $container); } public function registerButtonsBlockScripts(string $pluginUrl, string $pluginPath): void @@ -603,8 +603,8 @@ function () use ($container, $hasBlocksEnabled, $settingsHelper, $pluginUrl, $pl /** @var array */ $gatewayInstances = $container->get('__deprecated.gateway_helpers'); self::registerBlockScripts($pluginUrl, $pluginPath); - add_action('wp_enqueue_scripts', function () use ($dataService, $gatewayInstances) { - $this->enqueueBlockCheckoutScripts($dataService, $gatewayInstances); + add_action('wp_enqueue_scripts', function () use ($dataService, $gatewayInstances, $container) { + $this->enqueueBlockCheckoutScripts($dataService, $gatewayInstances, $container); }); $this->registerButtonsBlockScripts($pluginUrl, $pluginPath); } diff --git a/src/PaymentMethods/AbstractPaymentMethod.php b/src/PaymentMethods/AbstractPaymentMethod.php index 14dfc557..d0dddeba 100644 --- a/src/PaymentMethods/AbstractPaymentMethod.php +++ b/src/PaymentMethods/AbstractPaymentMethod.php @@ -411,8 +411,8 @@ public function optionKey(ContainerInterface $container): string public function registerBlocks(ContainerInterface $container): bool { - //override in method - return true; + //we handle it outside for the moment + return false; } public function orderButtonText(ContainerInterface $container): string