#nathan9745354
1 messages · Page 1 of 1 (latest)
Thanks for that.
Hi Bro
Before this page is fine until I changed the Live Key
and as you saw it.
shopwing this
So when you attempt to create a Checkout Session the page just shows that screenshot instead of redirecting to Checkout?
Okay so sounds like your backend is echo'ing an Array to your frontend instead of redireting to the Checkout Session
Have you looked at your server logs?
server not changed.
except API key.
the checkout site is created.
But the page not redirect to checkout page.
I have no idea what happening on new account
Yeah the API key has no affect here.
Array is my all product
How are you redirecting?
yes, old account is fine
Are you redirecting server-side or client-side?
client side.
when user click the plan
and call create-checkout session.php
the weird thing is this php never change
I only change the stripe account and api key
Can you show me your PHP code here for creating the Checkout Session?
Hmm okay so yeah looks like you commented out the echo but that seems to still be running based on what you are seeing client-side...
Possible things are cached here?
I used incognito mode of google
but no lucj
luck
Is that stripe account problem?
but checkout page is fine.
I have 2 php file
1 of price
1 of orderconfirm.php
price is for logged user. -> this can check out
orderconfirm for not register user. -> this redirect to link=xxxxx , array page.
Okay so you are going to need to walk through the orderconfirm.php code then
Have you removed all of your echo from that code?
this is my oderconfirm code
as you see, the checkout is really created.
but in client side user redirect to array.
That is a bunch of code but from a quick skim your ```if($isAuthenticated){
echo "<script> location.href='/price'; </script>";
exit;
}```
code looks suspicious to me.
Seems like it is doing a redirect to a certain URL, no?
the prodcut api in price.php
so the page will go to price and lookup the product api key
My recommendation here is to add a bunch of logs throughout this code to see what fires before you get redirected to this unexpected page.
You are much more familiar with this code than I am and you as the developer need to debug here. I can help provide suggestions but I really can't do this for you.
Well if you change the API key back does it still work?
Do you have code that is dependent on the API key?
Like the API key on its own has no affect -- we don't do anything different in the Stripe API when you use our test key vs. our live key.
yes. But the main point is array
why will list the array of my all product?
and it's a vulnerability ?
Your own code is doing that.
Just want to redirect customer to that.
You need to debug why from your end.
any suggestion?
Add logs throughout each step of your code to see where the redirect is occurring.
Hi 👋 I'm stepping in for @edgy forum . Give me a sec to catch up
Thanks.
What API key were you using when the redirect was working?
old stripe account
So the redirect worked with an old Stripe account? Are the products & prices structured the same for the new account?
yes.
No worries
this api key already gone
I have price.php
and when user logged their account and checkout
this is fine.
that mean the checkout-session is fine, can check out
but orderconfrim.php can't redirect user to checkout
but in API logs, it's worked.
I'm sorry but that description does not make much sense at all. What specific step is failing? What are the error messages you receive?
When user make the payment, it show https://cdn.discordapp.com/attachments/841573134531821616/1127986319486890056/image.png
orderconfirm.php
When the user makes a payment? So after the Checkout session?
yes.
select plan
and check
out
So. the create-checkout-session.php is fine and orderconfirm never change the code.
What happening?
Whatever page you are redirecting your customer to after they complete the Checkout session is displaying an array of products for some reason
when created user account after.
if you access the link and it's won't work without user account
when user logged their account
and use the link to checkout.
suppose redirect to checkout page.
but now it's showing array rather than checkout page
That sounds like something in your PHP redirect isn't working. I would add logging to that orderconfirm.php to clearly identify how the code is executing and where the array is coming from
No I was suggesting what you should do to fix this. I am not available to edit your code for you
Just want to clarify not a prodcut problem and account problem?
But when I changed the live key and product api key,
this page never changed but why will make like this
But it' is your file that is displaying this array. Ultimately you need to understand why this is happening.
I cannot because I don't have enough understanding of what your code is doing. I very much doubt it is a problem on Stripe's end but before I can investigate you would need to have a very clear idea of exactly why your code is displaying an array to the customer
I don't know why too.
So you need to review that code, add more logging statements to determine how the code is executing and what variable values are at each step of flow control.