#joseph01
1 messages · Page 1 of 1 (latest)
HI 👋
Can you tell me more about what action you took that caused this error to be begin being surfaced?
Hello,
Yes sure.
const stripe = require('stripe')('STRIPE-SECRET-KEY');
This I used that was mentioned on docs. After installing with npm install stripe --save
Hm, and what version of our Node library are you using?
Did the suggestion in the error message of adding a polyfill help resolve the behavior that you're encountering?
Node is 18. And no it didn't help. Why is this issue coming any way. It was just stripe to be installed right.
Sorry for not thinking of this sooner, but our Node library is meant to be a server-side library, can you help me understand why you need to include it in your client-side React app?
To connect with the frontend payment.
That's done by your frontend making requests to your backend service.
Couldn't understand. Can you explain a bit more
https://stripe.com/docs/payments/payment-intents
This doc I reffered
The React app portion of your flow is your client-side frontend. It should have minimal communication with Stripe, and most of the interaction with the Stripe API should be performed a separate back-end service that you have.
If you look through this guide that walks through the steps needed to accept a payment, you'll notice that the steps are broken up between server-side steps and client-side steps. Creating Payment Intents, creating Customers, things of this nature should be done by your backend-server (sounds like you're planning to use Node for this).
https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements&client=react
I have a headless cms as a backend. Will that work ?
I'm not entirely certain and assume that depends on the details of the CMS. The core requirements are that your server is able to communicate with the Stripe API, and that it is able to communicate with your frontend.
Okaay. Thank you. I check this out.