lyra / plugin-magento

An open source plugin that links Magento based e-commerce websites to PayZen secure payment gateway developed by Lyra Network.
https://lyra.com/fr/guides/magento/
Open Software License 3.0
10 stars 12 forks source link

Payment attempt with a quote already processed #7

Closed matthieu2607 closed 5 years ago

matthieu2607 commented 6 years ago

Hi, We have a lot of customers who have a problem with the payment of the order with the Payzen plugin. I activated the logs and I have this message that appears:

[2018-04-24 05:37:19] payzen.INFO: PayZen 2.1.4 - Lyranetwork\Payzen\Controller\Payment\Redirect::getAndCheckOrder : Payment attempt with a quote already processed. [Order = xxxx] [IP = xx.xxx.xx.xxx]. [] []
[2018-04-24 05:37:19] payzen.INFO: PayZen 2.1.4 - Lyranetwork\Payzen\Controller\Payment\Redirect::back : Order payment already processed. Redirecting to cart page. [] []

This message is fired in the Redirect controller with the getAndCheckOrder method

The customer sees his basket empty and the order is created on the back office.

I have a lot of commands that have this problem.

The version of magento is version 2.2.3.

Thanks for your feedback

nabil509 commented 6 years ago

Hi,

We have not meet this problem before. We are about to install the last version of Magento 2 to test over.

Please, reply to these questions in order to help you :

Thank you.

matthieu2607 commented 6 years ago

Is there any thing common to all orders with that error (same carrier, discount coupon, ...) ? > No, we do not have coupons and it does it with any carrier

Are you using third-party extension for checkout (3 steps checkout, one page checkout, ...) ? > No

Thank you

nabil509 commented 6 years ago

OK. I don't think there is a bug with this part. I tested plugin over the last Magento version and it seems to work correctly.

For information, deleting cart from session after redirection to the payment gateway is the normal working of Magento system. It is a security mecanism to avoid data consistency problems between the CMS and the gateway. So if the buyer returns from gateway using browser "Go back" button, the cart is emptied and cannot be submitted again. The order in this case stay in "Pending payment" status.

You can modify this behavior in the source code at your own risk.

matthieu2607 commented 6 years ago

can i comment on the following lines in the controller redirection of the getAndCheckOrder method?

if (! $checkout->getLastSuccessQuoteId()) {
            $this->dataHelper->log("Payment attempt with a quote already processed. [Order = {$order->getId()}]" .
                     " [IP = {$this->dataHelper->getIpAddress()}].");
            throw new OrderException('Order payment already processed.');
        }
nabil509 commented 5 years ago

I close issue since there is no error. This is about the standard behaviour of Magento.