You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have encountered an error. When we cancel an order for a customer in the administration, we receive an error indicating that the payment cannot be canceled because the payment is already expired.
The error:
[2024-08-13T12:02:15.944658+02:00] request.CRITICAL: Uncaught PHP Exception Symfony\Component\Messenger\Exception\HandlerFailedException: "Handling "FluxSE\SyliusPayumStripePlugin\Command\CancelPayment" failed: Request Cancel{model: ArrayObject} is not supported. Make sure the gateway supports the requests and there is an action which supports this request (The method returns true). There may be a bug, so look for a related issue on the issue tracker." at DoctrineTransactionMiddleware.php line 42 {"exception":"[object] (Symfony\Component\Messenger\Exception\HandlerFailedException(code: 0): Handling "FluxSE\SyliusPayumStripePlugin\Command\CancelPayment" failed: Request Cancel{model: ArrayObject} is not supported. Make sure the gateway supports the requests and there is an action which supports this request (The method returns true). There may be a bug, so look for a related issue on the issue tracker. at /var/www/project/vendor/symfony/doctrine-bridge/Messenger/DoctrineTransactionMiddleware.php:42)\n[previous exception] [object] (Payum\Core\Exception\RequestNotSupportedException(code: 0): Request Cancel{model: ArrayObject} is not supported. Make sure the gateway supports the requests and there is an action which supports this request (The method returns true). There may be a bug, so look for a related issue on the issue tracker. at /var/www/project/vendor/payum/payum/src/Payum/Core/Exception/RequestNotSupportedException.php:57)"} []
Steps to replicate:
Create a new order.
Initiate payment, but do not complete it.
Cancel the order in the administration.
Possible Solution:
This could be resolved if the CancelOrderProcessor does not attempt to cancel the payment if the payment is in the state new, or if the CancelPaymentHandler checks whether the transaction is already expired.
This issue interferes with canceling orders because when the cancellation fails, the order is also not canceled, as the transaction is rolled back.
The text was updated successfully, but these errors were encountered:
I'm aware of this issue but frankly I postponed to fix it due to lack of time right now.
However it can be easily ignored by sending the CancelPayment command to an async task with this config :
# config/packages/messenger.yamlframework:
messenger:
routing:
'FluxSE\SyliusPayumStripePlugin\Command\CancelPayment': main'FluxSE\SyliusPayumStripePlugin\Command\CaptureAuthorizedPayment': main'FluxSE\SyliusPayumStripePlugin\Command\RefundPayment': main
It is far from perfect but can allow you to wait for the fix.
What you suggested is one way to fix this issue, if you can submit a PR I would be glad to review it and help you doing so.
Hello,
We have encountered an error. When we cancel an order for a customer in the administration, we receive an error indicating that the payment cannot be canceled because the payment is already expired.
The error:
Steps to replicate:
Possible Solution:
This could be resolved if the CancelOrderProcessor does not attempt to cancel the payment if the payment is in the state new, or if the CancelPaymentHandler checks whether the transaction is already expired.
This issue interferes with canceling orders because when the cancellation fails, the order is also not canceled, as the transaction is rolled back.
The text was updated successfully, but these errors were encountered: