From the course: Next.js Ecommerce: Build a Shopping Platform from Scratch
Unlock this course with a free trial
Join today to access over 25,200 courses taught by industry experts.
Payment method and Zod schemas - Next.js Tutorial
From the course: Next.js Ecommerce: Build a Shopping Platform from Scratch
Payment method and Zod schemas
All right. So now we want to start on this payment method page. And basically, we want to have a form, much like we have for the shipping address, right? We'll show this at the top, the steps. And then we'll have the page. And then we'll have the form, which will submit to an action. So I want to start off with the action, as well as a couple constants that I want to add in the schema. So let's start off with the constants, which I'm also going to have environment variables for. And that's going to be the payment methods and the default payment method. So in your .env, we're going to add payment underscore method, or methods, sorry. And then this is going to be a comma separated list. So we're going to say PayPal, and then comma space. And that's important that you put the space, because we're actually going to be bringing this into our constants file and creating an array from it using split. So PayPal, and then let's say Stripe. And we're also going to have cash on, not that kind of…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
(Locked)
Section intro1m 31s
-
(Locked)
Payment method and Zod schemas9m 27s
-
(Locked)
Payment method page8m 1s
-
(Locked)
Payment method form and update13m 9s
-
(Locked)
Order and OrderItem Prisma models11m 7s
-
(Locked)
Order Zod schemas and types8m 16s
-
(Locked)
Place order page18m 5s
-
(Locked)
Create order action14m 15s
-
(Locked)
Place order form7m 37s
-
(Locked)
Order page and action8m 27s
-
(Locked)
Format utility functions8m 20s
-
(Locked)
Order details table14m 5s
-
(Locked)
-
-
-
-
-
-
-
-
-
-