-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from buckaroo-it/BP-3715-Add-support-fot-Hyv-C…
…heckout-1.1.23 Bp 3715 add support fot hyv checkout 1.1.23
- Loading branch information
Showing
6 changed files
with
41 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace Buckaroo\HyvaCheckout\Plugin; | ||
|
||
use Hyva\Checkout\Model\MethodMetaData\IconRenderer as IconRendererHyva; | ||
use Magento\Framework\View\Asset\Repository; | ||
|
||
class IconRenderer | ||
{ | ||
protected Repository $assetRepository; | ||
|
||
public function __construct( | ||
Repository $assetRepository | ||
) { | ||
$this->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 '<img style="height:30px" src="' . $logoLink . '">'; | ||
} | ||
|
||
// Otherwise, proceed with the default behavior | ||
return $proceed($icon); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters