Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Adgower's avatar
Level 14

Route Not working with Stripe

I am trying to pass the checkout session id to have a customized checkout page on stripe (https://stripe.com/docs/payments/checkout/custom-success-page).

When I pass the route in as a string it works great no problems:

'success_url' => "https://example.test/checkout/success?session_id={CHECKOUT_SESSION_ID}",

but if I use the route helper it returns:

'https://example.test/checkout/success?session_id=%7BCHECKOUT_SESSION_ID%7D'

instead of the correct session id

'success_url' => route('checkout.success', ['session_id' => '{CHECKOUT_SESSION_ID}']),

Any tips?

0 likes
0 replies

Please or to participate in this conversation.