#tarik-PI

1 messages · Page 1 of 1 (latest)

rain plume
#

👋 happy to help

#

what you shared is the backend code

#

vuejs is only a frontend framework

bronze otter
#

I know but what is the problem in that I try first to display the form and after having it ready then call the site API after-post!

rain plume
#

You're using stripe.value.paymentIntents instead of stripe.paymentIntents

#

in your backend

bronze otter
#

yes that just because of Vue reactivity: const stripe = ref(null)

rain plume
#

this code cannot be used on the front-end

bronze otter
#

why it is ES proxy which is stripe.paymentIntents equivalent to stripe.value.paymentIntents!

rain plume
#

the code you're using can only be run on the server side

#

you cannot create Payment Intents on the browser

bronze otter
#

that means for me it is not a call to stripe api?

#

because I knew the aim is to get the clientsecret!

rain plume
#

it will be a call to the Stripe API, one that shouldn't be done from the browser

#

yes but you need your secret key to generate a Payment Intent

#

if you ship your secret key to the front end

#

then any client of yours would have access to all of your APIs since they have access to the secret key

#

this is why this code should never be used in the front-end code and why it won't work

bronze otter
#

clear now @rain plume

thank you for your nearest support