#dev_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฑ๏ธ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime!
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1212753327708835841
๐ Have more to share? You can add more detail below, including code, screenshots, videos, etc.
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question. Thank you for your patience!
๐ happy to help
do you happen to have a request that is failing?
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
this means that there's a missing environment variable or something
but it's not Stripe related but rather a configuration on your side
i use Stripe::setApiKey() for the secret key, its right no?
try to test whether the key exist or not
or an empty string or something
oh wait
that's the Stripe Checkout page
would you mind sending me the link?
i sending it to you in pm
you can send it here
this means that the checkout session you're trying to access has expired
oh no actually it's something else
the url is missing a part of it
ok what can i do?
how are you redirecting to the Checkout Session?
I think it's better if you send the url to the frontend and redirect from there
for some reason the redirection from the backend is splicing the URL
i have this too
๐ stepping in
So you see that error when you attempt to redirect after the Checkout Session is created?
hello ,when i tried to pay the bills
When you try to complete the Checkout Session?
when i tried to access the check out this message appears: Something went wrong
The page you were looking for could not be found. Please check the URL or contact the merchant.
So when your frontend attempts to redirect?
its the same
You aren't really giving me much information to work with here. I need you to be more detailed to help you.
What happens when you use:
header("Location: " . $checkout_session->url);```
Instead of `return $this->redirect()` in your code?
what is $checkout_session ?
Sorry that would be $session in your case
no problem i have a error with symfony framework
Ah symfony won't let you use that to redirect?
So you have to use redirect() specifically when using symfony?
I'm not familiar with symfony at all
ok i tried with return header("Location: " . $session->url); but i have an error
What is the error?
App\Controller\PurchaseController::pay(): Return value must be of type Symfony\Component\HttpFoundation\Response, null returned
yes with my older website it work!
Can you just return an empty response to symfony after you perfrom that redirect?
What do you mean "with my older website it work"?
It sounds like the issue really is around how you are setting your API key for this code in that case.
Have you hardcoded the API key in the same file for a test?
i use \Stripe\Stripe::setApiKey('mysecretAPIkey) in my function
i mean i used the same function and it work!
i mean i use the same function and its working!
If the only thing you replaced is your secret key then I'd recommend checking on that secret key in the Dashboard and ensuring that you are grabbing the full key
its grabbing the full key
Alright well I can't really help you any further then. It is something with your framework not grabbing that API key as it is a clear error about that. So I can only recommend at this point building a clean project and testing that way to ensure that works, and then doing a deeper comparison to the project that you have already built.
ok thank you