#JCoDog - Checkout Prices

1 messages · Page 1 of 1 (latest)

feral briar
#

Hey JCoDog. What's the exact error/issue you are seeing?

warm elbow
#

It then isn't sending to the checkout

feral briar
warm elbow
#

yes

#

its whenever I use the define price instead of just putting the price in

feral briar
#

So if you just manually put the ID in the create checkout session call it redirects properly? It's only when you define a variable that it doesn't?

warm elbow
#

No its not now...

#

any idea?

feral briar
#

I don't see a redirect statement anywhere in your code

warm elbow
#

it is there...

#

I am getting a 500 error with this code...

feral briar
#

What does the 500 message say?

warm elbow
feral briar
#

That is a 500 post to your site

#

You'll have to check your logs

warm elbow
#

hmm

#

ok

#

nothing since dec 2

feral briar
#

You need to improve your logging then. You need to see the message returned by that 500 error

#

That will help you debug

warm elbow
#

I have all the logs enabled... I am contacting the host.

#

While I wait for them is there anything obviously wrong with my code?

#

It doesn't even show any echo statements

feral briar
#

Your call to create the checkout session looks okay to me

#

I'd just work on getting those logs working so you can debug

warm elbow
#

Working on it. The support of my webhost are not responding.

warm elbow
#

Issue sorted... It was a problem with the .env not being found

feral briar
#

Gotcha. Glad you were able to sort out the issue!

warm elbow
#

I just tried to test a webhook, if there was anything wrong with how the webhook on my server was set up to receive would it say an error in the dashboard?

feral briar
#

The webhooks section within your dashboard shows a success and failure rate for calls to your webhook. You can monitor that to detect any issues

warm elbow
#

Thanks. Seems all working then. I am just swapping all pages to use .env instead of in code stripe keys

feral briar
#

Yes that is the proper pattern. You shouldn't put any secret keys in your code as that's sensitive data. In fact, if you've checked that code into Github at any point, then I'd recommend rolling those keys to be safe: https://stripe.com/docs/keys#rolling-keys

Manage your API keys to authenticate requests with Stripe.

warm elbow
#

It has never been on github

#

Nevermind it seems a developer has put it into a private repo. Is there a way to roll enpoint secrets?

feral briar
warm elbow
#

All done. Thanks