buckaroo-it / Magento2_Hyva_Checkout

This repository contains the additional module to support Hyvä Checkout
2 stars 3 forks source link

BP-3655 Apple Pay functionality #29

Open elzekool opened 1 month ago

elzekool commented 1 month ago

For one of our clients we want to implement Apple Pay however we noticed that the implementation had some issues. I am wondering if this is something that is known and on the radar to fix.

One issue we found during debugging is that in the method register() the method checkPaySupport() is called without a merchan tIdentifier (https://github.com/buckaroo-it/Magento2_Hyva_Checkout/blob/master/view/frontend/templates/component/payment/after.phtml#L262) while the original method defined in https://github.com/buckaroo-it/Magento2_Hyva_Checkout/blob/master/view/frontend/web/js/applepay.js#L15 requires it. This is an issue we could fix with providing this.config.guid to the BuckarooApplePay.checkPaySupport() method.

However that leaded to a situation where there first appears an unstyled payment link ("Plaats bestelling" = "Place order" in Dutch): image

And only after clicking that an Apple Pay button appears which also has a broken styling: image

Our expectations were that the customer selects Apple Pay and then continue placing the order and if Apple Pay is not supported the method is not visible. Currently two situations happen:

Buckaroo-Rene commented 1 month ago

Goodmorning @elzekool ,

Thank you for contacting us about this issue. We'll take a look at this

Just to be sure, did you also register the domain in the Buckaroo Plaza as well? This is needed for Apple Pay, also to host the Apple Pay Domain Association file as written on the Apple Pay configuration page in the Buckaroo Plaza.

image

elzekool commented 1 month ago

Hey @Buckaroo-Rene ,

Yes, that is configured. Not entirely sure how it works between Buckaroo and Apple but I imagine that Buckaroo configures a merchant with Apple Pay with the Buckaroo GUID.

At least that what I think is happening in the regular Magento 2 module at https://github.com/buckaroo-it/Magento2/blob/master/view/frontend/web/js/view/checkout/applepay/pay.js#L69, there BuckarooSdk.ApplePay.checkApplePaySupport is called with window.checkoutConfig.payment.buckaroo.applepay.guid the definition of this function in https://checkout.buckaroo.nl/api/buckaroosdk/script is the same as the function defined in https://github.com/buckaroo-it/Magento2_Hyva_Checkout/blob/master/view/frontend/web/js/applepay.js#L15.