The developer creates a new NestJS payment microservice. They configure Docker, integrate the Stripe API for handling customer charges, and define payment intent logic. The process includes environment variable setup, module configuration, and implementing message patterns to interface with other system services.
Length 14:59
Captions English (Generated), Spanish (Auto-translated), French (Auto-translated), Korean (Auto-translated), Portuguese (Auto-translated), Vietnamese (Auto-translated) #microservice #stripe #nestjs #typescript #payments #docker #api #programming #backend #coding
0:00 Okay, so we're ready to start creating our new 0:02 microservice for processing 0:04 payments for our reservations. We are going to use the 0:07 Stripe API to actually bill customers that book 0:11 reservations using provided payment details. 0:14 We will sign up for Stripe and actually make HTTP calls to the 0:18 API in this microservice, which we'll be calling from the 0:22 reservation service when a new reservation is created. 0:25 So let's go ahead and get started back in the terminal. 0:29 We're gonna use the Nest CLI as usual to m- to 0:33 generate a new app by calling nest generate app, and we'll 0:37 call this payments. And you can see our newly created 0:41 payments application was added to our 0:45 app here. And we have the default controller out of 0:49 the 0:49 box here, as well as the basic payments module that 0:53 sets up the payments controller. So the first thing we're gonna do, 0:56 as we did in 0:56 our reservations and auth services, we're gonna go ahead and 1:00 copy over the Dockerfile from the reservations app, and we'll 1:04 place it inside of the newly created payments app. 1:08 And the only change we'll make here is in our startup command to start the 1:12 app, we will go into the dist 1:15 apps/payments folder. All of the rest of the steps 1:18 will stay the same now. So now we'll go back in the docker-compose 1:22 file in the root of our app, and we'll just copy over the 1:26 existing definition for the auth service, paste it in here 1:31 f- and rename this to the payments service. 1:34 The context is still gonna be in the root, except the Dockerfile now is gonna live 1:38 in the payments directory. And we'll then change the startup command 1:42 here to m p- pnpm run start dev payments. 1:46 We'll change the env file path here to go to
The rest of the transcript is for members.
Sign in