amzn / amazon-payments-magento-2-plugin

Extension to enable Amazon Pay on Magento 2
https://amzn.github.io/amazon-payments-magento-2-plugin/
Apache License 2.0
109 stars 77 forks source link

Amazon.Pay is undefined #1010

Closed VladyslavSikailo closed 3 years ago

VladyslavSikailo commented 3 years ago

I have installed "amzn/amazon-payments-magento-2-plugin": "dev-V2checkout" on my Magento 2.4 with custom one step checkout.

What I expected

Everything should work ok

What happened instead

Steps to Reproduce:

There is console error image

In the same time when first loading of checkout I can see that amazon.Pay is not undefined.

After some debug I found that src/PayV2/view/frontend/web/js/view/payment/method-renderer/amazon-payment-method.js in bindEditPaymentAction uses amazon.Pay object which is undefined for me. image

Could you please explain for me from which place amazon.Pay should be loaded? Note: Also I have amazon.Login, which is loaded from https://static-eu.payments-amazon.com/OffAmazonPayments/de/sandbox/lpa/js/Widgets.js?nomin

Your setup

jajajaime commented 3 years ago

Hi @Dren7755,

Do you see a request to get https://static-eu.payments-amazon.com/checkout.js? And if so, does it fail for any reason? This is the script that defines amazon.Pay object. It is required by checkout-address.js in here https://github.com/amzn/amazon-payments-magento-2-plugin/blob/V2checkout/src/PayV2/view/frontend/web/js/view/checkout-address.js#L42

If nothing shows up, we can internally get in touch to take a look at your environment to further debug.

VladyslavSikailo commented 3 years ago

ok, I have merged amazon's checkout_index_index with our custom checkout layout and it works ok. Thank you and excuse for troubling