#DeathNote

1 messages ยท Page 1 of 1 (latest)

acoustic timberBOT
sharp rock
#

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

buoyant hull
sharp rock
#

no error appears in the front or back console

#

Can I show you how the code is?

buoyant hull
#

Not much we can debug without the error but sure, you can share the relevant code

sharp rock
buoyant hull
#

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?

sharp rock
#

that console.log(res)

#

?

buoyant hull
#

yes

sharp rock
#

which line can i put it on?

buoyant hull
#

Can you print what res is on line 11

sharp rock
#

it should show up in the bakc console right?

buoyant hull
#

yes

sharp rock
#

there's nothing

buoyant hull
#

Then you'd want to look into if your code is even running correctly

#

because there should be some logs
Try restarting the servers

sharp rock
#

Is there a way I can generate this checkout at the front?

#

move stripe.js file from back to front

buoyant hull
#

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

sharp rock
#

if you can answer me in your private thank you

buoyant hull
#

Sorry we don't do private chats/DMs
We can talk here ๐Ÿ™‚ Take as much time as you need to explain things

sharp rock
#

and because I'm not understanding anything anymore lol, I needed codes

#

all my attempts fail

buoyant hull
#

do you see your cartItems being printed when you click on the button?

sharp rock
#

yes I see

buoyant hull
#

Looks like your axios request itself is failing..
Look at the error in red

#

Your backend is returning a 500

sharp rock
#

this error appeared when i restarted back

#

i restart it again and the error also appears

buoyant hull
#

So now check your backend server log to see what error you're getting

sharp rock
#

still no errors

#

but wait, you asked to put the print on the PayButton?

#

or was it to print the PayButton res?

buoyant hull
#

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?

sharp rock
#

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

buoyant hull
#

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.

sharp rock
#

does the stripe have a video that teaches me how to do the back meeting the requirements of my front?

buoyant hull
sharp rock
#

but in this video does he use products registered on the stripe website?

#

my products are in my mongo database

buoyant hull
#

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