mollie / magento2

Mollie Payments for Magento 2
https://www.mollie.com
Other
98 stars 50 forks source link

BUGFIX - Fix issue where this.applePayPaymentToken may not be defined at checkout #713

Closed Scarraban closed 7 months ago

Scarraban commented 8 months ago

This PR touches code in the following areas (Check what is applicable):

Frontend

Backend

Order Processing (Mollie communication)

Please describe the bug/feature/etc this PR contains:

When loading the payment methods on Safari or Apple Devices, when Apple Pay is enabled the following error may occur:

this.applePayPaymentToken() is not a function

Attached screenshot from Safari DevTools: image

When this occurs it blocks all Mollie Payment methods from being rendered, including Credit Cards. This problem occurs due to this.applePayPaymentToken() not being defined as an observable in the component's defaults on load.

Scenario to test this code:

  1. Open environment on a Safari or Apple device supporting Apple Pay
  2. Add product, go to checkout
  3. Apple Pay should display