Open ts-mothership opened 1 year ago
I think I found the culprit: With #520 the new setting automaticCancellation has been introduced which is enabled per default. When the customer cancels payment, he is redirected to shop and the order state changes to cancelled in https://github.com/mollie/Shopware6/blob/v3.6.0/src/Facade/MollieOrderPaymentFlow.php#L73. This triggers the CancelOrderSubscriber, which also cancels the mollie order. However, MollieOrderPaymentFlow continues to execute and tries to create a new payment in https://github.com/mollie/Shopware6/blob/v3.6.0/src/Facade/MollieOrderPaymentFlow.php#L114 which then fails.
As workaround I can disable automatic cancellation in shop settings.
Hi
thank you for this really sorry for the late replies, ...shopware 6.5....
ill check it out afterwards but the interesting thing is, that automatic-cancellation did always exist :D its now only possible to turn it off, because it led to troubles in a project we had
so good it helps for now :)
@boxblinkracer No problem. We were using an old version before, at that time auto cancellation did not exist yet. ;) I'm glad that the disable setting exists, so there's no pressure.
fun fact...that did always exist, i actually didnt know of it either when we took over :D but could be we fixed it one day haha
Summary
When customer cancels Mollie payment, the order is canceled too. Somehow Mollie tries to create a new payment, which leads to an ApiException "Cannot create a new payment for order ord_6ljr39 when the order status is "canceled"".
Shopware Version: 6.4.20.1 Mollie Plugin Version: 3.6.0
Reproduce
The order is correctly canceled but an error is displayed.
Should be
You should not see an error page. Instead there should be a page where you can change your Mollie payment method or retry again. If you choose to retry, the order status should change back to open, and then a new payment should be created.
More Details and Background
We're currently trying to upgrade the shop from 6.4.16.0 to 6.4.20.1 and with it, the Mollie plugin from 3.1.0 to 3.6.0. In the old version there was no problem when you cancel the payment. I'm not sure what could've caused it, but from current analysis it looks like the plugin tries to create a new payment when it should not do (yet). In the old version the order status and payment was changed on URL /mollie/payment/retry/...
Exception trace on URI "/mollie/payment/247eb01c16bf4bd4bbffc2dd379c7cb6":