Skip to content

Commit

Permalink
Hide applepay in windows
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbinaBaraliu committed Dec 4, 2024
1 parent 1bf1b05 commit 8d85de0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions view/frontend/layout/hyva_checkout_index_index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
layout="checkout"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"
>
<head>
<script src="Buckaroo_HyvaCheckout::js/hide-applepay.js" />
</head>
<body>
<referenceContainer name="hyva.checkout.api-v1.after">
<block name="checkout.buckaroo_after_api-v1"
Expand Down
13 changes: 13 additions & 0 deletions view/frontend/web/js/hide-applepay.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
document.addEventListener('DOMContentLoaded', function() {
const checkPaySupport = function () {
if (!('ApplePaySession' in window)) return false;
if (typeof ApplePaySession === 'undefined') return false;
return true;
};

const applePaySupported = checkPaySupport();
const applePayContainer = document.getElementById('payment-method-option-buckaroo_magento2_applepay');
if (!applePaySupported && applePayContainer) {
applePayContainer.style.display = 'none';
}
});

0 comments on commit 8d85de0

Please sign in to comment.