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

Paypal Checkout redirects Checkout Page so AmazonPay dont work #1204

Open aurel5542 opened 1 year ago

aurel5542 commented 1 year ago

When customers click on AmazonPay button they will be redirected to Amazon, confirm their data there and then will be redirected to our store with the /checkout/ in url.

Paypal in Europe "forces" us to use Dominate Checkout (because their new Paypal Checkout is not available else with Magento2 in our region) which has their own hosted Checkout Page and use /checkout_page/ with redirect of /checkout/ so AmazonPay can not redirect to normal checkout. There is a similar issue with other payment providers checkouts as KLARNA.

I could solve it maybe if I create a new store view where I disable Dominate Checkout but need to add "?___store=AmazonPay" to the url which has the Amazon Session id &amazonCheckoutSessionId=77c453-4e3a-48f23-xxx-f9xxd019932 but I can not add it at Magento Checkout URL Path because it adds it before to sessionId and so it leads to 404 not found. Can I add the storeid code somewhere in the AmazonPay Module Code which generates the url?

This solution is not so good but maybe working but it would be best of course if there is a better fix directly from AmazonPay.

Thank you

Your setup

sgabhart22 commented 1 year ago

Hello @aurel5542 ,

Sorry for the delayed response on this. If I'm understanding correctly, I think what you're suggesting is possible, but I'm not sure how extensive the effort might end up being. The Amazon Pay module does offer a configuration option to define the base checkout URL upon which the redirect will be built (located under Advanced > Developer Options > Magento Checkout URL Path). If you could manage to configure a non-Dominate checkout experience to function at this same checkout URL only in the case that Amazon Pay is being used, then you may be able to offer AP alongside Dominate.

Unfortunately there's not much we can do directly from the Amazon module since Dominate checkout defines which payment methods are available. But for what it's worth, we did reach out to the Dominate development team some months ago to see if we could work together to offer Amazon Pay through Dominate. As far as I know discussions are still ongoing there.

Thanks, Spencer

aurel5542 commented 1 year ago

Hello, thanks for your answer.

Checkouts like this Paypal/Dominate or Klarna use a url rewrite to get the checkout to another url and there is nothing I can see so far to change it without breaking the whole checkout. Thats why "Magento Checkout URL Path" does not work.

It would however work if it would be possible to just add a custom store ID to the end of the final amazon pay link including the Session ID. Isn't there any code in the module which defines the path with a variable for the SessionID where I can just place "?_store" behind?

I understand this is not a problem by the module but I think more and more payment providers want to switch to their own checkouts so I think its also in the interest of AmazonPay Module to find a workaround for this.

Thank you