diff --git a/views/frontend/tpl/payment/adyen_assets.tpl b/views/frontend/tpl/payment/adyen_assets.tpl index 48b0ebc..d497d15 100644 --- a/views/frontend/tpl/payment/adyen_assets.tpl +++ b/views/frontend/tpl/payment/adyen_assets.tpl @@ -59,7 +59,23 @@ [{if $isLog}] console.log(checkout.paymentMethodsResponse); [{/if}] - [{if $isPaymentPage && $oView->isAvailablePayment($adyenCreditCard)}] + [{if $isPaymentPage}] + const apple = checkout.create( + 'applepay', + { + } + ); + apple.isAvailable() + .then(() => { }) + .catch(e => { + [{if $isLog}] + console.error('Apple Pay not available'); + console.error(e); + [{/if}] + hidePaymentOption(); + }); + [{/if}] + [{if $isPaymentPage && $oView->isAvailablePayment($adyenCreditCard)}] const cardComponent = checkout.create( 'card', { @@ -162,6 +178,15 @@ // Call adyenAsync adyenAsync(); + function hidePaymentOption() { + var inputElement = document.getElementById('payment_oscadyenapplepay'); + if (inputElement) { + var parentElement = inputElement.closest('.well.well-sm'); + if (parentElement) { + parentElement.remove(); // remove parent-block + } + } + } [{/capture}] [{if $phpStorm}][{/if}] -[{oxscript add=$adyenJS}] \ No newline at end of file +[{oxscript add=$adyenJS}]