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.

Basic configurations of Stripe

Basic configurations of Stripe

In this lecture, we will implement the embedded checkout form using Stripe SDK. For that, we will create a dedicated page for the checkout. So let me navigate to the client directory, create a checkout route by creating the respective folder in the with layout folder group and create the page JSX file inside it. Now in the page JSX file, I will quickly create the checkout page component. Next let me create the checkout folder in the screens folder along with the index JSX file. Now let me quickly create the checkout component which will display the text checkout in the div and will also export it. Let me render this component inside the page JSX also. Now I will open the cart component and will add the redirection to the checkout page when clicked on the checkout button. So I will use the useRouter hook to control the routing. Let me take an instance of the useRouter hook, creating the function handleCheckout. Here I will say router.push slash checkout. All right, now I will navigate…

Contents