From the course: Master Next.js by Building Scalable Apps with Routing, Databases, and Performance

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Introduction

Introduction

In this section, we will implement the checkout flow using the Stripe Payment Gateway. Here we will use the Stripe SDK to implement the checkout flow. They provide an built-in checkout form in which we can add e-mail, shipping address, payment methods, etc. We will use embedded checkout form into our project. So the flow will be that the user will add the product to cart, then the user will select the quantity and the size of the product and click on the checkout button. After that, the Stripe will create a checkout session using the user info and the products in the cart and redirect to the checkout page. Now the checkout form of the Stripe will appear on the screen and you can see the products with its quantity and the price appears along with the checkout form. Now the user will fill the checkout form with valid data along with the test card details provided by the Stripe and submit the form. After the successful payment, user will be redirected to the success page. Here the…

Contents