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

Closing an order using MSI, reservations are not cleared #1109

Closed ganeddact closed 2 years ago

ganeddact commented 2 years ago

What I expected

When an order paid through Amazon Pay is closed, if Magento is configured to use MSI, the inventory reservation for the items purchased should be cleared.

What happened instead

The Inventory Reservation line(s) stay in the database table, potentially preventing sales

Steps to reproduce the issue

Place an order through Amazon Pay then cancel it. Order should then be marked with status "closed". Check inventory_reservation table, it will have a line (or more) reserving the items

Your setup

Using Braintree replicating the same scenario, for example, reservations are being cleared.

sgabhart22 commented 2 years ago

Hello @ganeddact ,

Unfortunately, I'm unable to reproduce this on a 2.4.3 installation with multiple inventory sources. When I cancel an order placed with Amazon Pay, the order status becomes 'Canceled', not 'Closed', and a corresponding line is added to the inventory_reservation table with a quantity to offset the quantity of the order.

Would you be willing to test this scenario with the up-to-date version of the Amazon Pay module and see if this resolves your issue? You can find upgrade/installation instructions here.

If you believe you are still seeing incorrect behavior, please let us know, and we may request access to a staging/dev environment where we can see this happening.

Thanks, Spencer

ganeddact commented 2 years ago

My apologies, what I meant with "then cancel it" was to refund entirely the order. That should put the order on "closed" status

sgabhart22 commented 2 years ago

I am still unable to reproduce when refunding; whether I complete the refund online or offline. If the order status is not changing to 'Closed' once the refund id complete, it sounds like something is interfering with the order processing. Are you using any extensions to manage your inventory sources, or any custom order statuses? Also, did you get a chance to test with version 5.10.0 of the Amazon Pay module?

ganeddact commented 2 years ago

Thanks for trying again. So you can't see any line in the table inventory_reservations? It's odd, there shouldn't be any other extensions that may interfere, and issuing an online refund moved the status of the order to "Closed".

We'll have a look at the 5.10.0 version of the module asap. Is 5.10.0 going to be added to the upcoming version 2.4.4 of Magento?

Thank you

sgabhart22 commented 2 years ago

I am seeing expected adjustments in the inventory_reservation table whether I cancel or refund (+1 to offset the -1 from the order). We don't have any special allowances for inventory updates; if the order status is correct, the inventory adjustments should be as well.

The Amazon Pay module will not be bundled with Magento 2.4.4, but can be installed via Magento Marketplace.

zichicc commented 2 years ago

Hi @ganeddact , do you still need assistance with this issue? Version 5.11.1 of our extension is available on Magento Marketplace.

Thanks Best

Christian

ganeddact commented 2 years ago

Hi Christian, not at the moment, it can be closed for now