Stripe is an American financial services and software as a service (SaaS) firm. The company offers payment processing software and application programming interfaces (APIs) for e-commerce websites and mobile applications. Follow the steps in this guide to set up Stripe payments and connect it to your frontend.
Most likely with Stripe, you will need a minimum of 3 keys that you can retrieve after you sign up for their services. After getting an account, you need to use API keys to get access to them.
Stripe has its own flow and concepts that you can read about within Stripe’s documentation.
The Remix Run Furniture v2 boilerplate includes a full Stripe Integration, including a confirmation webhook.
On the checkout page, we render the Stripe component, which does 3 things:
In this boilerplate, we decided to save the cart in our own service layer, so we push the order to Crystallize only when the payment is successful.
Upon Stripe confirmation (client-side), we redirect to the `/order/cart/${cartId}` page. This page is actually waiting for the cart to be saved as an order in Crystallize.
Indeed, while everything is happening, Stripe (with a correctly configured webhook) will be triggered and the endpoint will be called.
The endpoint, when the event is a `payment_intent.succeeded` event:
This boilerplate is also using our Node Service API Request Handlers that include 2 handlers to speed up your Stripe integration.
This NextJS eCommerce boilerplate includes Stripe Integration.
The most interesting parts are:
Note: As mentioned in the code, this boilerplate does not rely on webhooks.