File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,19 +5,21 @@ import { PaymentService } from "../service/payment.service.js";
55
66export const paymentConfirm = async ( req , res , next ) => {
77 try {
8- const dto = new CreatePaymentDto ( {
9- impUid : req . body . impUid ,
10- merchantUid : req . body . merchantUid ,
11- productId : req . body . productId ,
12- userId : req . body . userId ,
13- } ) ;
8+ const userId = req . user . id ;
9+
10+ const dto = new CreatePaymentDto ( {
11+ impUid : req . body . impUid ,
12+ merchantUid : req . body . merchantUid ,
13+ productId : req . body . productId ,
14+ userId : userId ,
15+ } ) ;
1416
15- const payment = await PaymentService . createPayment ( dto ) ;
16- const responseData = parseWithBigInt ( stringifyWithBigInt ( payment ) ) ;
17- res . status ( StatusCodes . CREATED ) . success ( responseData ) ;
18- } catch ( err ) {
19- next ( err ) ;
20- }
17+ const payment = await PaymentService . createPayment ( dto ) ;
18+ const responseData = parseWithBigInt ( stringifyWithBigInt ( payment ) ) ;
19+ res . status ( StatusCodes . CREATED ) . success ( responseData ) ;
20+ } catch ( err ) {
21+ next ( err ) ;
22+ }
2123}
2224
2325export const getPayments = async ( req , res , next ) => {
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import { authenticate } from "../middlewares/auth.middleware.js";
66const router = express . Router ( ) ;
77
88// 결제 정보 저장 API
9- router . post ( "/complete" , paymentConfirm ) ;
9+ router . post ( "/complete" , authenticate , paymentConfirm ) ;
1010
1111// 결제 정보 조회 API
1212router . get ( "" , authenticate , getPayments ) ;
You can’t perform that action at this time.
0 commit comments