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
108 stars 76 forks source link

No shipping methods found after returning from Amazon Pay login #1145

Closed liamfirth closed 1 year ago

liamfirth commented 1 year ago
  1. Add product to cart and proceed to checkout.
  2. Fill in customer details on shipping step and continue to payment step
  3. Select Amazon Pay as payment method and continue to Amazon Pay
  4. Press "Continue as Customer Name" and return to checkout
  5. Customer to be presented with a preselected address and a list of shipping options

<-- What actual results you or customer got -->

No shipping options are shown on return to checkout, instead "Sorry, no quotes are available for this order at this time" is shown and customer can't continue past shipping step.

Your setup

sgabhart22 commented 1 year ago

Hello @liamfirth ,

There seems to be some issue with the template that's being used to render the Amazon Pay payment method; the AP button at the last step of checkout should be a Pay Now button, not an Express Checkout button. That is, once the user authenticates with Amazon, they should be presented with an Amazon-hosted payment screen where they can select the payment instrument to use and click a 'Pay Now' button to complete the transaction. Since the user already entered their address details in the shipping section of checkout, there's no need to redirect the user back there with Amazon address data. The address details that the user entered are supplied to Amazon in this flow.

The behavior of the button is determined by an attribute passed to the javascript component in the knockout template. If you look at the screenshot below: image

You can see that in the highlighted div (id 'PayWithAmazonButton'), the value for placement being passed to the amazon-button component is 'Checkout', when it should be 'PayNow' so that the button will use the correct payload to initiate a Pay Now checkout flow. Is it possible that any custom modules or theme code are overriding the default amazon-payment-method.html template? If not, then it may be possible that something odd happened with js bundling or minification that caused the confusion. If you don't believe any custom code could be responsible, it may be worthwhile to clear your static assets and redeploy your frontend code to see if this issue can resolve itself.

Let me know if this helps, Spencer

liamfirth commented 1 year ago

Hi @sgabhart22

That's right - I thought the custom templates had all been removed, but it looks like there was one with the Checkout and PayNow placements reversed. Thanks for your help!

Liam

sgabhart22 commented 1 year ago

@liamfirth No problem at all! Glad it was a simple solution, and please don't hesitate to reach out with any future issues regarding the plugin.

Thanks, Spencer