A backend for Stripe's integration into the eCommerce app
This project includes a Node.js server script hosting the backend logic for enabling integration of Stripe’s prebuilt payment UI on the client-side.
It defines 2 endpoints:
/customers
: creates a Stripe Customer object and sends back the Customer's id to the client so that it can be retrieved later on./checkout
: retrieves the Stripe Customer Object associated with the user, creates an Ephemeral Key for the Customer and creates a Payment Intent with the payment amount (in cents) and the currency.
The server then returns the Payment Intent’s client secret, the Ephemeral Key’s secret, the Customer’s id, and the Publishable Key to the app, enabling the client-side to complete the checkout process.