Skip to content
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

Error canceling order after abandoning Stripe checkout page #53

Closed
FlorentCupillard opened this issue Mar 20, 2024 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@FlorentCupillard
Copy link

When a customer returns from the Stripe Checkout portal without paying using the back button, a new payment is recorded

image

and in this case, when canceling the order from the admin, it gives us this error

image

image

Sylius : 1.12
flux-se/sylius-payum-stripe-plugin : v2.0.9

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 vendor/symfony/doctrine-bridge/Messenger/DoctrineTransactionMiddleware.php:42
  at Symfony\Bridge\Doctrine\Messenger\DoctrineTransactionMiddleware->handleForManager()
     (vendor/symfony/doctrine-bridge/Messenger/AbstractDoctrineMiddleware.php:45)
  at Symfony\Bridge\Doctrine\Messenger\AbstractDoctrineMiddleware->handle()
     (vendor/symfony/messenger/Middleware/ValidationMiddleware.php:45)
  at Symfony\Component\Messenger\Middleware\ValidationMiddleware->handle()
     (vendor/symfony/messenger/Middleware/FailedMessageProcessingMiddleware.php:34)
  at Symfony\Component\Messenger\Middleware\FailedMessageProcessingMiddleware->handle()
     (vendor/symfony/messenger/Middleware/DispatchAfterCurrentBusMiddleware.php:68)
  at Symfony\Component\Messenger\Middleware\DispatchAfterCurrentBusMiddleware->handle()
     (vendor/symfony/messenger/Middleware/RejectRedeliveredMessageMiddleware.php:41)
  at Symfony\Component\Messenger\Middleware\RejectRedeliveredMessageMiddleware->handle()
     (vendor/symfony/messenger/Middleware/AddBusNameStampMiddleware.php:37)
  at Symfony\Component\Messenger\Middleware\AddBusNameStampMiddleware->handle()
     (vendor/symfony/messenger/Middleware/TraceableMiddleware.php:40)
  at Symfony\Component\Messenger\Middleware\TraceableMiddleware->handle()
     (vendor/symfony/messenger/MessageBus.php:70)
  at Symfony\Component\Messenger\MessageBus->dispatch()
     (vendor/symfony/messenger/TraceableMessageBus.php:38)
  at Symfony\Component\Messenger\TraceableMessageBus->dispatch()
     (vendor/flux-se/sylius-payum-stripe-plugin/src/StateMachine/CancelOrderProcessor.php:36)
  at FluxSE\SyliusPayumStripePlugin\StateMachine\CancelOrderProcessor->__invoke()
  at call_user_func_array()
     (vendor/winzou/state-machine/src/SM/Callback/Callback.php:75)
  at SM\Callback\Callback->call()
     (vendor/winzou/state-machine-bundle/Callback/ContainerAwareCallback.php:55)
  at winzou\Bundle\StateMachineBundle\Callback\ContainerAwareCallback->call()
     (vendor/winzou/state-machine/src/SM/Callback/Callback.php:84)
  at SM\Callback\Callback->__invoke()
  at call_user_func()
     (vendor/winzou/state-machine/src/SM/StateMachine/StateMachine.php:217)
  at SM\StateMachine\StateMachine->callCallbacks()
     (vendor/winzou/state-machine/src/SM/StateMachine/StateMachine.php:135)
  at SM\StateMachine\StateMachine->apply()
     (vendor/winzou/state-machine/src/SM/Callback/CascadeTransitionCallback.php:58)
  at SM\Callback\CascadeTransitionCallback->apply()
  at call_user_func_array()
     (vendor/winzou/state-machine/src/SM/Callback/Callback.php:75)
  at SM\Callback\Callback->call()
     (vendor/winzou/state-machine-bundle/Callback/ContainerAwareCallback.php:55)
  at winzou\Bundle\StateMachineBundle\Callback\ContainerAwareCallback->call()
     (vendor/winzou/state-machine/src/SM/Callback/Callback.php:84)
  at SM\Callback\Callback->__invoke()
  at call_user_func()
     (vendor/winzou/state-machine/src/SM/StateMachine/StateMachine.php:217)
  at SM\StateMachine\StateMachine->callCallbacks()
     (vendor/winzou/state-machine/src/SM/StateMachine/StateMachine.php:135)
  at SM\StateMachine\StateMachine->apply()
     (vendor/sylius/resource-bundle/src/Bundle/Controller/StateMachine.php:53)
  at Sylius\Bundle\ResourceBundle\Controller\StateMachine->apply()
     (vendor/sylius/resource-bundle/src/Bundle/Controller/ResourceUpdateHandler.php:34)
  at Sylius\Bundle\ResourceBundle\Controller\ResourceUpdateHandler->handle()
     (vendor/sylius/sylius/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/Handler/ResourceUpdateHandler.php:41)
  at Sylius\Bundle\CoreBundle\Doctrine\ORM\Handler\ResourceUpdateHandler->handle()
     (vendor/sylius/resource-bundle/src/Bundle/Controller/ResourceController.php:482)
  at Sylius\Bundle\ResourceBundle\Controller\ResourceController->applyStateMachineTransitionAction()
     (vendor/symfony/http-kernel/HttpKernel.php:181)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:76)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:197)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (vendor/autoload_runtime.php:29)
  at require_once('/home/florent/projet/acme/vendor/autoload_runtime.php')
     (public/index.php:5) ````
@Prometee
Copy link
Member

Hello @FlorentCupillard !

You have two ways to solve this issue:

  1. Add this action as a service tagged as a payum action https://github.com/FLUX-SE/PayumStripe/blob/master/src/Action/StripeCheckoutSession/LegacyCancelAction.php
  2. Or update you Stripe API version in the Stripe API management dashboard.

Let me know if you need more info and if it fixed your issue.

@Prometee Prometee added the bug Something isn't working label Mar 24, 2024
@FlorentCupillard
Copy link
Author

Thank you for the answer,
I looked at the different solutions you offered me, but it turns out that I am already on the latest version of Stripe Api (2023-10-16).
I think there is something else.

@Prometee
Copy link
Member

Prometee commented Apr 8, 2024

Are you sure the checkout session you are trying to cancel have been created by the same API version ?

If not just apply the first point I suggested.

@FlorentCupillard
Copy link
Author

I tested the Fix #54, it solved the problem for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants