white-nl / commerce-mollie-plus

Mollie Klarna integration for Craft Commerce
Other
3 stars 5 forks source link

Order is created multiple times in Mollie when retyring after failed/canceled #2

Closed rbrv closed 2 years ago

rbrv commented 2 years ago

We've been testing the plugin and ran into this issue:

If a visitor orders something, and the Mollie payment is not successful (failed, canceled, ...), the visitor is sent back to the website checkout like it should be.
If the visitor then tries again to pay with Mollie, a new order is created in Mollie instead of reusing the existing one.

So if a visitor tries to pay unsuccessfully multiple times, multiple orders are created. The original order should be reused for this.

Example in Mollie of the same order trying to be paid multiple times:

Screenshot 2022-01-28 at 14 47 14

WHITE-developer commented 2 years ago

We couldn’t reproduce the behavior based on your description.

In our case the order in Mollie stays open only when you close the Mollie payment tab after you’ve been redirected from Craft and then manually go back to the Craft checkout page and start again. Which I assume is a very rare situation.

When the payment is failed or cancelled within the Mollie interface and the user is sent back to the website, the Mollie order status changes accordingly: to failed or cancelled. It’s done automatically on Mollie side. If that doesn’t happen, you may want to contact Mollie to resolve this problem.

We can’t reuse previously created orders because Mollie API is very limiting when you want to update the order. You can only change some basic information like shipping/billing address. It won’t allow you to change the payment method (which I assume would be the most used scenario: when let’s say your PayPal payment is failed and you want to pay with a credit card instead).

Please don’t treat Mollie Orders as mirrored/exported orders from Craft, those are different entities and they serve different purposes. Mollie orders are more like a grouped transactions with additional order line information that can be used by Klarna or other payment systems.

rbrv commented 2 years ago

I understand. Thank you for clarifying your chosen approach and the Craft limitations!

However, the problem still stands: multiple payment attempts will result in multiple orders with status "created" with identical order numbers, as seen in the screenshot.

If it's not possible to re-use the same Mollie-order, could the other/older orders be canceled? This way, there will be only 1 order with status "created". This should make it way more easy to see wich of the Mollie-orders is the actual order.