#tarik-PI
1 messages · Page 1 of 1 (latest)
👋 happy to help
what you shared is the backend code
vuejs is only a frontend framework
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!
You're using stripe.value.paymentIntents instead of stripe.paymentIntents
in your backend
yes that just because of Vue reactivity: const stripe = ref(null)
this code cannot be used on the front-end
why it is ES proxy which is stripe.paymentIntents equivalent to stripe.value.paymentIntents!
the code you're using can only be run on the server side
you cannot create Payment Intents on the browser
that means for me it is not a call to stripe api?
because I knew the aim is to get the clientsecret!
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
clear now @rain plume
thank you for your nearest support