Home > Back-end >  No route found for
No route found for

Time:11-22

i have a little problem. I do an E-commerce Website with Stripe. For my Success page i have an error

No route found for "GET http://..........:8000//commande/merci/cs_test_b1YFH01tTs7d5uQplLjAzlx8KLtdhMgXITQIyAFmNhcvnjW1m21nChFX8u"

This in my code in my StripeController :

 $checkout_session = Session::create([
                'customer_email' => $this->getUser()->getEmail(),
                'line_items' => [
                    $productsForStripe
                ],
    
                'mode' => 'payment',
    
                'success_url' => $YOUR_DOMAIN . 'commande/merci/{CHECKOUT_SESSION_ID}',
    
                'cancel_url' => $YOUR_DOMAIN . 'commande/erreur/{CHECKOUT_SESSION_ID}',
    
            ]);
    
            $order->setStripeSessionId($checkout_session->id);
    
            $entityManager->flush();

And My code in my OrderValidateController :

 public function index($stripeSessionId): Response
{
    
    $order = $this->entityManager->getRepository(Order::class)->findOneByStripeSessionId($stripeSessionId);

    if(!$order) {
        return $this->redirectToRoute('home');
    }

    return $this->render('order_validate/index.html.twig');

I need you for find why he said me Route not found pls.

Thanks for all

Aurélien

CodePudding user response:

http://..........:8000//commande/merci/cs_test_b1YFH01tTs7d5uQplLjAzlx8KLtdhMgXITQIyAFmNhcvnjW1m21nChFX8u"

there is 2 // after :8000

try and delete one / in your StripeController

  • Related