#Amazing Parent from Brown Sea
1 messages · Page 1 of 1 (latest)
Hi! Let me help you with this.
Normally, a checkout session must be created on the backend. If you use one of our SDKs, it will suggest the correct format. What backend language are u using?
I'm using Vue as front and node as back, i'm trying to make the api call to the endpoint with fetch
Please, use stripe-node SDK to create a Checkout Session on the backend: https://stripe.com/docs/api/checkout/sessions/create?lang=node
You can follow this guide that covers both frontend and backend implementation, your case is very common: https://stripe.com/docs/payments/accept-a-payment?platform=web
Ok but if i want to make the api call from vue it's a bad thing? Actually i installed the vue stripe module for the checkout button also
Yes. You need to set the price on the backend, as it is safer. Otherwise, a malicious customer could temper with the frontend call, and send an arbitrary amount.
Stripe needs to be used both on frontend and on the backend, as each has it's own responsibilities. Backend creates the PaymentIntent/Checkout Session and frontend collects the Payment Method.
so i have to install the stripe cli on the backend?
That's different. Only if you want to test your webhook endpoints.
the module to require in the backend is stripejs?
Most importantly you need to install stripe-node: https://github.com/stripe/stripe-node
It is all described in the doc I shared, please follow it step by step: https://stripe.com/docs/payments/accept-a-payment?platform=web
Ok thanks
Happy to help. Let me know if you have any other questions.
Hey, taking over here. Let me know if there's any follow-up Qs I can answer!