-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Canceling payment leads to 500 status code #575
Comments
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 ill check it out afterwards 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 |
@ts-mothership the mollie orders API does not allow to cancel payments within order and you cannot create new payments if there is already one which is open. we will move at some point all payment methods to payments API where we can handle the payment in a better way |
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 state is now "open".
=> You are redirected to Mollie https://www.mollie.com/checkout/test-mode?method=giropay&token=...
=> You're redirected first to https://www.mollie.com/checkout/test-mode/cancel
=> then to http://shop.test/mollie/payment/235b2bef5e28416d8e3fc5aef1e95bbb
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":
The text was updated successfully, but these errors were encountered: