#nathan9745354

1 messages · Page 1 of 1 (latest)

tight beaconBOT
zinc vault
#

Thanks for that.

edgy forum
#

Hello there

#

What error are you seeing exactly?

zinc vault
#

Hi Bro

#

Before this page is fine until I changed the Live Key

#

and as you saw it.

#

shopwing this

edgy forum
#

So when you attempt to create a Checkout Session the page just shows that screenshot instead of redirecting to Checkout?

zinc vault
#

yes.

#

before old account it's fine

edgy forum
#

Okay so sounds like your backend is echo'ing an Array to your frontend instead of redireting to the Checkout Session

zinc vault
edgy forum
#

Have you looked at your server logs?

edgy forum
#

Yeah the API key has no affect here.

zinc vault
#

Array is my all product

edgy forum
#

How are you redirecting?

zinc vault
#

yes, old account is fine

edgy forum
#

Are you redirecting server-side or client-side?

zinc vault
#

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

edgy forum
#

Can you show me your PHP code here for creating the Checkout Session?

zinc vault
#

create-checkout-session?

edgy forum
#

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?

zinc vault
#

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

tight beaconBOT
zinc vault
#

orderconfirm for not register user. -> this redirect to link=xxxxx , array page.

edgy forum
#

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?

zinc vault
#

this is my oderconfirm code

#

as you see, the checkout is really created.

#

but in client side user redirect to array.

edgy forum
#

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?

zinc vault
#

the prodcut api in price.php

#

so the page will go to price and lookup the product api key

edgy forum
#

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.

zinc vault
#

ah..

#

the weired thing is same code is work before.

#

until I changed the API key...

edgy forum
#

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.

zinc vault
#

yes. But the main point is array

#

why will list the array of my all product?

#

and it's a vulnerability ?

edgy forum
#

Your own code is doing that.

zinc vault
#

Just want to redirect customer to that.

edgy forum
#

You need to debug why from your end.

zinc vault
#

any suggestion?

edgy forum
#

Add logs throughout each step of your code to see where the redirect is occurring.

zinc vault
#

as you can see, the link= is the lasty.

#

I don't know what triggering this.

crystal owl
#

Hi 👋 I'm stepping in for @edgy forum . Give me a sec to catch up

zinc vault
#

Thanks.

crystal owl
#

What API key were you using when the redirect was working?

zinc vault
#

old stripe account

crystal owl
#

So the redirect worked with an old Stripe account? Are the products & prices structured the same for the new account?

zinc vault
#

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.

crystal owl
#

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?

zinc vault
#

orderconfirm.php

crystal owl
#

When the user makes a payment? So after the Checkout session?

zinc vault
#

yes.

#

select plan

#

and check

#

out

#

So. the create-checkout-session.php is fine and orderconfirm never change the code.

#

What happening?

crystal owl
#

Whatever page you are redirecting your customer to after they complete the Checkout session is displaying an array of products for some reason

zinc vault
#

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

crystal owl
#

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

zinc vault
#

yes.

#

please send me

crystal owl
#

No I was suggesting what you should do to fix this. I am not available to edit your code for you

zinc vault
#

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

crystal owl
#

But it' is your file that is displaying this array. Ultimately you need to understand why this is happening.

zinc vault
#

ok.

#

and had you confirm this not a product or account problems?

crystal owl
#

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

zinc vault
#

I don't know why too.

crystal owl
#

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.

tight beaconBOT
zinc vault
#

talk later.

#

of.

#

off

#

thanks for that, will request help if need.