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

OSC & missing parameter value + partially signature errors #1082

Closed gewaechshaus closed 3 years ago

gewaechshaus commented 3 years ago

Hey @christianzichichi @jaybeckr,

we were in contact in sep 2020, see ASD-509 in your Jira. I am already in contact with the amazon guys in germany. We were nearly ready to launch, as we stumbled upon a real strange thing.

We are 2 developers working on the task, both using valet for local development. In my case, everything is working as it should, while my colleague is getting the parameter missing value on the first call, and the signature error on the second (we did clean the setup and provided new credentials multiple times). Our DEV system (I will send the link to payments-cp-devel@amazon.com) has the missing parameter value on the first call, while the signature error isn't reproducible. On the 2nd call the error is gone in most cases. The shippingAddress in quote_address table is updated on the 2nd call, but I can't see any significant changes in the data. We are using gitlab and custom deployment scripts, so everything is synced (except little differences in our environments). Our OSC(modified version of Gomage LightCheckout) has an inverted logic in terms of addresses, which means the billing address is on first place, which might cause errors.

The behaviour above is only related to the amazon payment method, for guests and logged in customers, even with existing addresses. I hooked into the generatePayNowButtonPayload method (with xdebug) and had a look at the generated payload which is able to fetch $quote->getShippingAddress(); and has the correct address details in $payload. I had a look at the documentation and found out that the email is needed in scope, buyer (or address details?)... Maybe you can help us to clarify this.

We are triggering the click to the payment method paynow button in a custom place-order-mixin as

            payNow: function () {
                $('#PayWithAmazonButton')
                    .find('div')
                    .trigger('click');
            },

is never triggered in our case. Due to this, it's the amazonPayButton.onClick(function() { from amazon-button.js which is getting triggered, and we aren't able to debug initCheckout method. amazonPayButton.initCheckout(initConfig);

I am at a point were some help would be really appreciated.

What happened instead

Bildschirmfoto 2021-09-27 um 13 21 56

It's really hard to debug that way, I would be a great enhancement to throw out more detailed exceptions, such as MissingParameterValue for fieldName x y z. How can we find out exactly which parameter is missing?

Steps to reproduce the issue

Checkout as guest in our DEV system, while using the amazon payment method.

Your setup

Magento version: 2.3.3 Amazon Pay Extension Version: 5.8.0 Magento Edition: Community

Cheers, Jan

jaybeckr commented 3 years ago

Hi @gewaechshaus - We have created a new ticket for this issue and added you to it, please follow up there.

The error you have in the screenshot, unfortunately we don't have any control over that in the Magento module. Will pass the feedback along though!

gewaechshaus commented 3 years ago

@jaybeckr - big thx!