mollie / magento2

Mollie Payments for Magento 2
https://www.mollie.com
Other
98 stars 49 forks source link

Banktransfer returns with error to cart page #760

Closed mdkdev closed 3 months ago

mdkdev commented 3 months ago

Describe the bug When an order is placed with "Banktransfer", the customer is redirected to the cart with an error: "Transaction failed. Please verify your billing information and payment method, and try again."

Used versions

To Reproduce Steps to reproduce the behavior:

  1. Enable "Banktransfer" from the configuration. image
  2. Go to the frontend and place an order.
  3. When in "Test" modus, select the option "Open", and finish the order. When in Live modus: Enter the e-mail details for the payment information, and finish the order.

Expected behavior The customer is redirected to the success page with no errors.

Actual behavior The customer is redirected to the cart with the error: "Transaction failed. Please verify your billing information and payment method, and try again." and a restored quote.

Screenshots image

https://github.com/mollie/magento2/assets/6543944/41ba2519-0222-44d8-9eed-d2a52e496df2

Additional context Orders are processed in Mollie\Payment\Controller\Checkout\Process::execute() methode, but orders placed by "Banktransfer" are giver the status of "open", which is not validated properly in the in_array check on line 129.

if ($result !== null && in_array($result->getStatus(), ['paid', 'authorized']))

Therefor, the code is skipping the success logic, and is handling the last return on line 140: return $this->handleNonSuccessResult($result, $orderIds);

I hope you can help us solve this problem.

Kind Regards, Marcel de Koning

Frank-Magmodules commented 3 months ago

Hello @mdkdev, thank you very much for opening this issue and providing all this relevant information. It's really helpful. We'll investigate the issue and get back to you with our findings.

Frank-Magmodules commented 3 months ago

Hi There @mdkdev ,

I'm glad to inform you that we've addressed the issue you raised by implementing a solution in our latest release. Now, after placing an order using banktransfer, users will be redirected to the success page even if the status of the banktransfer status is still open.

I'm closing this issue for now, but please don't hesitate to reopen it if you have any further concerns or if you believe it's necessary to revisit this matter in the future.

angelique-mollie commented 3 months ago

@Frank-Magmodules We have a merchant that is still experiencing this issue after updating to the latest version of the plugin. The merchant says that the payment becomes the status paid, but they see the error like described above. What do you need from me to further investigate?

Frank-Magmodules commented 3 months ago

Hey @angelique-mollie, weird! Could you reach out to me on Slack? Let's take a look at it together!

mdkdev commented 3 months ago

Hi @Frank-Magmodules,

I can confirm that this issue is resolved now. Thank you for reporting back to us.

Frank-Magmodules commented 3 months ago

Thank you, @mdkdev, for the update! The issue raised by @angelique-mollie seems to be different from this one, so we can maintain the closure on this matter for the time being and I will continue further chat directly with @angelique-mollie . :)