mollie / magento2

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

Multiple orders with change of payment method #695

Closed in-session closed 8 months ago

in-session commented 9 months ago

Describe the bug In test mode, there is also the problem that as soon as you want to have another payment method and go back, an order is already created with pending payment. If the customer then performs the checkout with payment, a second order is generated. I have not yet been able to test this in production mode.

Used versions

To Reproduce Steps to reproduce the behavior:

  1. Add item to shopping cart
  2. Checkout to the Mollie Payment page
  3. Select another payment method in the footer

Expected behavior Back to the set page without creating an order and the customer can then edit and submit the order. Maybe it would be better to open a popup on the checkout page during the place order process like Paypal.

Frank-Magmodules commented 8 months ago

Hello @in-session,

Thanks for opening this issue and pointing this out.

This situation started long ago when we first developed the Mollie extension. Back then, the options to integrate a payment method were way more limited than nowadays are available. One of the big reasons we chose this implementation is that we are always sure that an order is available when a payment has occurred. Implementing this differently sometimes does not result in an actual order when a payment has been completed. This is a situation that we are trying to prevent.

That said, There are more options nowadays to implement payment methods, for example, using the Payment Gateway that Magento offers. We are exploring the possibilities to implement this. However, as the current implementation relies heavily on the availability of an order, this is a challenging task. If we ever implement it this way, it will take a long time before we release this.

in-session commented 8 months ago

Hi @Frank-Magmodules Thank you for the answer to my question. I can absolutely understand your statement, it is of course not so practical for some areas. For example, through external interfaces that lead to an ERP system. Through this, one would basically receive two orders. But there is also the problem that the first order is not canceled. after place the second order. And, of course, that the database contains many additional records, which may not be cleaned, due to the retention period of the legal requirement.

I don't know the Mollie API that well yet. But maybe as another idea that one cancelsUrl refers to the checkout, and the redirectUrl perhaps contains a checkout url + parameter (like &payment_token=xxx&order_id=xxx?transferred) that then executes the order after redirect and send an Update order to Mollie. I think that would be the easiest and fastest solution which is then also implementable for all themes like Luma or Hyva. Especially as a PSP provider I think you should provide this possibility, all other functions would then be unaffected and remain the same.

Frank-Magmodules commented 8 months ago

Hi There @in-session ,

Thank you again for reaching out to us with your concerns. I would like to clarify a few points regarding your statement about orders staying open.

Your statement that orders stay open is not correct: There a systems in place to close orders that are cancelled. There is a Magento cronjob that cancels all orders that haven’t reached the paid status in a configurable amount of time.

Next to that: Mollie also cancels orders when they don’t reach the payment state. However, due to the nature of payment, this can take quite a long time for certain payment methods.

Regarding the presence of multiple orders in your ERP, I’d like to highlight that our primary responsibility is ensuring the efficient operation and integrity of order management within Magento. If orders are transferred to your ERP system, it would be prudent to only include those orders marked as ‘paid’ to prevent any confusion or redundancy. The management of how orders are sent or read by your ERP is beyond the scope of this extension.

We are closing this issue now, feel free to post any questions you still have.