Skip to content

Commit

Permalink
Bypass generic gateway for blocks for the moment
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaymo committed Jan 30, 2025
1 parent 81be08e commit f9c612d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/Assets/AssetsModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions src/PaymentMethods/AbstractPaymentMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f9c612d

Please sign in to comment.