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

Order "Processing" without payment #1186

Closed mohammedTBB closed 1 year ago

mohammedTBB commented 1 year ago

What I expected

The order should have the status 'pending' if the payment is not received (not captured).

What happened instead

The Order placed with status processing

Your setup

Details and screenshots

Order with no payment captured order-1

order-1-status

Order with payment captured order-2

order-2-status

sgabhart22 commented 1 year ago

Hello @mohammedTBB ,

This is the expected progression of order statuses with Amazon Pay as a payment method. If the module is configured to use Automatic authorization mode, then the order status may be 'Payment Review' until authorization can be attempted asynchronously via a cron job. Once Authorized, the status will become 'Processing'. Even after capture, the order status should remain 'Processing', until the order is shipped (which will make the order 'Complete') or refunded ('Closed').

Is the processing status upon authorization causing integration issues in your store?

Thanks, Spencer

mohammedTBB commented 1 year ago

Hello @sgabhart22

Yes, As the screenshots show, there is an order that is in status processing although it does not have payment (invoice), which is a problem for us because we send these orders to another platform for management treating processing orders as already having payment.

We have authorization mode "immediate", I understood that changing it to "automatic" will place the order in the status "payment review" and after confirming the payment using the cron job the order status will be processing, is this correct?

sgabhart22 commented 1 year ago

Hi @mohammedTBB ,

Yes, generally speaking if the auth mode is Automatic, then the order status will become Payment Review immediately after the order is placed. There is a chance that the order may be authorized immediately if possible, as the Automatic mode passes a value of true to a property called canHandlePendingAuthorization, which means the auth may not happen right away.

I'm curious to know what value you have set for Payment Action? If it is set to 'Charge when the order is shipped', then the module will not attempt to capture/invoice automatically, meaning that the farthest the module will take a transaction is through the authorization. If you continue to have issues after setting auth mode to Automatic, you may need to set up a custom cron job to adjust the order status of outstanding Authorized Amazon Pay orders to Pending, if that is what your ERP/external order management system requires before invoicing.

Thanks, Spencer

mohammedTBB commented 1 year ago

Hi @sgabhart22

The payment is set to "Charge when the order is placed". and we change the Authorization mode to "Automatic", I am going to monitor the orders and let you know if the automatic mode works for us.

Thanks, Mohammed.

mohammedTBB commented 1 year ago

Hi @sgabhart22

I confirm that changing the Authorization mode to "Automatic" solve the problem, thanks for your support!

Regards.

darektw commented 6 months ago

Hello @sgabhart22

Today we are seeing a similar problem to the one described in this ticket. Module versron: 5.17.0 Magento: 2.4.6-p5

I see that there are also errors such as this

var/log/paywithamazon.log-[2024-04-25T22:04:45.899437+00:00] amazonClientLogger.ERROR: 
Exception: Warning: Undefined variable $order in 
/var/www/magento/releases/20240424T160438/vendor/amzn/amazon-pay-magento-2-module/Model/CheckoutSessionManagement.php on line 781 
in /var/www/magento/releases/20240424T160438/vendor/magento/framework/App/ErrorHandler.php:62

Previously we had version 5.16.1 and everything worked fine.

dimitriBouteille commented 6 months ago

@darektw I think you Can open new issue :)