diff --git a/Model/MethodMetaData.php b/Model/MethodMetaData.php deleted file mode 100644 index 5583303..0000000 --- a/Model/MethodMetaData.php +++ /dev/null @@ -1,39 +0,0 @@ -assetRepository = $assetRepository; - } - public function renderIcon(): string - { - $icon = parent::getData(self::ICON); - - if (!is_array($icon)) { - return ''; - } - $logoLink = $this->assetRepository->getUrl($icon['svg']); - return ''; - } -} diff --git a/Plugin/IconRenderer.php b/Plugin/IconRenderer.php new file mode 100644 index 0000000..04a328d --- /dev/null +++ b/Plugin/IconRenderer.php @@ -0,0 +1,32 @@ +assetRepository = $assetRepository; + } + + public function aroundRender( + IconRendererHyva $subject, + callable $proceed, + array $icon + ): string { + // Check if this is a Buckaroo method and handle it + if (isset($icon['svg']) && strpos($icon['svg'], 'Buckaroo_') !== false) { + $logoLink = $this->assetRepository->getUrl($icon['svg']); + return ''; + } + + // Otherwise, proceed with the default behavior + return $proceed($icon); + } +} diff --git a/Plugin/MethodList.php b/Plugin/MethodList.php index 89efd80..eb5f1e9 100644 --- a/Plugin/MethodList.php +++ b/Plugin/MethodList.php @@ -8,7 +8,7 @@ use Magento\Payment\Model\MethodInterface as PaymentMethodInterface; use Buckaroo\Magento2\Model\ConfigProvider\Method\ConfigProviderInterface; use Hyva\Checkout\ViewModel\Checkout\Payment\MethodList as HyvaMethodList; -use Buckaroo\HyvaCheckout\Model\MethodMetaDataFactory; +use Hyva\Checkout\Model\MethodMetaDataFactory; class MethodList implements \Magento\Framework\View\Element\Block\ArgumentInterface { diff --git a/etc/di.xml b/etc/di.xml index cfb41fd..35ef475 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -4,4 +4,8 @@ + + + +