#jacko-react-node-cjs
1 messages ยท Page 1 of 1 (latest)
๐ give me a moment to catch up and I'll respond as soon as I can ๐ thanks
Not really familiar with Common JS
Are you performing server-side rendering or is your react app completely separate from your server?
I think that our front end and back end are separate. We built out our front end and backend logic of our app with react. We are using google firebase to host our website and store our data in firestore. Then when implementing stripe we decided to use use express and node for our stripe server backend. This is what we saw in tutorials. Then for the client for stripe we also wrote that in react.
Should the stripe server be on an es6/ react module/file?
I would honestly recommend hiring a developer who is experienced in this
With client-server completely separate, you don't export variables to your front-end.
Ideally, you'd make a HTTP request and your server will respond with the information that you want to pass to your client-side
Ok I think I understand. Let me rephrase what I think you are saying. We to configure our server to contain customer data like the customer Id variable.
Also here is more important information about our backend
When a user makes an account with us we also create a customer with them in stripe. Then we store that stripe Id in our data base. When it comes time to enter credit card information for the user. We need to call that customer Id for that current customer. Then tell our stripe backend to include that in the set up intent
@coarse narwhal where should I call the stripe id for the current user? In the client file then perform a fetch request to the backend to get the setup intent? Or in the server file where we configure those app.post requests to stripe for the set up intent?
you should do it server-side before you create the setup intent as your server should have access to your database