#JCoDog - Checkout Prices
1 messages · Page 1 of 1 (latest)
It then isn't sending to the checkout
Are you redirecting to checkout: https://stripe.com/docs/js/checkout/redirect_to_checkout
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?
No its not now...
https://sourceb.in/hjIIFxFpLr Something about this is breaking the page
any idea?
I don't see a redirect statement anywhere in your code
What does the 500 message say?
You need to improve your logging then. You need to see the message returned by that 500 error
That will help you debug
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
Your call to create the checkout session looks okay to me
I'd just work on getting those logs working so you can debug
Working on it. The support of my webhost are not responding.
Issue sorted... It was a problem with the .env not being found
Gotcha. Glad you were able to sort out the issue!
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?
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
Thanks. Seems all working then. I am just swapping all pages to use .env instead of in code stripe keys
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
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?
All done. Thanks