#DeathNote
1 messages ยท Page 1 of 1 (latest)
or at least I think
I created a button on the front that returns the items in the cart correctly, but when directing to the stripe, it won't
Hello ๐
What error are you getting? Can you share the request ID?
https://support.stripe.com/questions/finding-the-id-for-an-api-request
Do you see any errors in your console?
Not much we can debug without the error but sure, you can share the relevant code
Is your server sending back json? If so, you may need to parse it.
Can you print what res is on line 11 in PayButton.jsx?
yes
which line can i put it on?
Can you print what res is on line 11
yes
there's nothing
Then you'd want to look into if your code is even running correctly
because there should be some logs
Try restarting the servers
Is there a way I can generate this checkout at the front?
move stripe.js file from back to front
No, we used to have client-only checkout but we deprecated it a while ago. You should really be using your server for ythat
Checkout creation requires your secret key, you shouldn't be using your secret API key on client-side
That's a huge security risk
if you can answer me in your private thank you
Sorry we don't do private chats/DMs
We can talk here ๐ Take as much time as you need to explain things
and because I'm not understanding anything anymore lol, I needed codes
all my attempts fail
do you see your cartItems being printed when you click on the button?
Looks like your axios request itself is failing..
Look at the error in red
Your backend is returning a 500
this error appeared when i restarted back
i restart it again and the error also appears
So now check your backend server log to see what error you're getting
still no errors
but wait, you asked to put the print on the PayButton?
or was it to print the PayButton res?
Your client-side code isn't getting a successful response from the server any way so console.log wouldn't have worked.
Do you have multiple backend servers running on your machine?
no, just one
the PayButton file is on the client side and the print is also there so the print will appear in my browser
when i restart my back i have several errors in the client
is the url correct?
Could you help me to make the code from scratch again the back part because as the front is already showing the items I believe everything is right with it, the problem must be in the back
The URL seems find. The error is coming from your server-side code, unless you find what that is, no changes on your client-side code is going to make a difference.
Sorry, we can't help write code from scratch. We can help unblock you if you get stuck ๐ฆ
We have a partner directory that you can look at to hire a developer (if you haven't done that already)
https://stripe.com/partners/directory
Other options would be to look for freelancers on fiverr etc.
does the stripe have a video that teaches me how to do the back meeting the requirements of my front?
but in this video does he use products registered on the stripe website?
my products are in my mongo database
In the video they're creating a price/product using the CLI but you should be able to use the price ID from your Stripe account instead