@@ -17,8 +17,8 @@ const router = Router();
1717 * @swagger
1818 * /api/prompts/purchases/requests:
1919 * post:
20- * summary: 결제 요청 생성
21- * description: 결제 시작을 위한 요청을 생성합니다 .
20+ * summary: 결제 요청 생성 (사전 검증)
21+ * description: 프론트엔드에서 결제창을 띄우기 전, 주문 번호 생성 및 사전 검증을 수행합니다 .
2222 * tags: [Purchase]
2323 * security:
2424 * - jwt: []
@@ -28,55 +28,48 @@ const router = Router();
2828 * application/json:
2929 * schema:
3030 * type: object
31+ * required:
32+ * - prompt_id
33+ * - merchant_uid
34+ * - amount
35+ * - buyer_name
36+ * - redirect_url
3137 * properties:
3238 * prompt_id:
3339 * type: integer
34- * pg:
35- * type: string
36- * enum: [kakaopay, tosspayments]
3740 * merchant_uid:
3841 * type: string
42+ * description: 가맹점 주문 번호
3943 * amount:
4044 * type: integer
45+ * description: 결제 예정 금액
4146 * buyer_name:
4247 * type: string
4348 * redirect_url:
4449 * type: string
4550 * responses:
4651 * 200:
47- * description: 결제 요청 생성 성공
52+ * description: 요청 성공
4853 * content:
4954 * application/json:
5055 * schema:
5156 * type: object
5257 * properties:
5358 * message:
5459 * type: string
55- * payment_gateway:
56- * type: string
5760 * merchant_uid:
5861 * type: string
59- * redirect_url:
60- * type: string
6162 * statusCode:
6263 * type: integer
63- * 400:
64- * description: 잘못된 요청
65- * 401:
66- * description: 인증 실패
67- * 404:
68- * description: 리소스 없음
69- * 409:
70- * description: 중복/상태 충돌
7164 */
7265router . post ( '/requests' , authenticateJwt , PurchaseRequestController . requestPurchase ) ;
7366
7467/**
7568 * @swagger
7669 * /api/prompts/purchases/complete:
7770 * post:
78- * summary: 결제 완료 처리(Webhook/리다이렉트 후 서버 검증 )
79- * description: 포트원 imp_uid 기반으로 서버에서 결제 검증 후 구매/결제/정산을 기록합니다 .
71+ * summary: 결제 완료 처리 (검증 및 저장 )
72+ * description: 포트원 결제 완료 후, paymentId를 서버로 보내 검증하고 구매를 확정합니다 .
8073 * tags: [Purchase]
8174 * security:
8275 * - jwt: []
@@ -86,14 +79,18 @@ router.post('/requests', authenticateJwt, PurchaseRequestController.requestPurch
8679 * application/json:
8780 * schema:
8881 * type: object
82+ * required:
83+ * - paymentId
8984 * properties:
90- * imp_uid :
85+ * paymentId :
9186 * type: string
87+ * description: 포트원 V2 결제 ID
9288 * merchant_uid:
9389 * type: string
90+ * description: 가맹점 주문 번호
9491 * responses:
9592 * 200:
96- * description: 결제 완료 처리 성공
93+ * description: 결제 성공 및 저장 완료
9794 * content:
9895 * application/json:
9996 * schema:
@@ -106,54 +103,23 @@ router.post('/requests', authenticateJwt, PurchaseRequestController.requestPurch
106103 * enum: [Succeed, Failed, Pending]
107104 * purchase_id:
108105 * type: integer
109- * nullable: true
110106 * statusCode:
111107 * type: integer
112- * 400:
113- * description: 검증 실패/유효하지 않은 요청
114- * 401:
115- * description: 인증 실패
116- * 404:
117- * description: 리소스 없음
118- * 409:
119- * description: 충돌
120- * 500:
121- * description: 서버 오류
122108 */
123109router . post ( '/complete' , authenticateJwt , PurchaseCompleteController . completePurchase ) ;
124110
125111/**
126112 * @swagger
127113 * /api/prompts/purchases:
128114 * get:
129- * summary: 내 결제 내역 조회
130- * description: 인증된 사용자의 결제(구매) 내역을 조회합니다.
115+ * summary: 결제 내역 조회
116+ * description: 인증된 사용자의 결제 내역을 최신순으로 조회합니다.
131117 * tags: [Purchase]
132118 * security:
133119 * - jwt: []
134- * parameters:
135- * - in: query
136- * name: page
137- * schema:
138- * type: integer
139- * required: false
140- * description: 페이지 번호 (옵션)
141- * - in: query
142- * name: pageSize
143- * schema:
144- * type: integer
145- * required: false
146- * description: 페이지 크기 (옵션)
147- * - in: query
148- * name: status
149- * schema:
150- * type: string
151- * enum: [Succeed, Failed, Pending]
152- * required: false
153- * description: 결제 상태 필터 (옵션)
154120 * responses:
155121 * 200:
156- * description: 결제 내역 조회 성공
122+ * description: 조회 성공
157123 * content:
158124 * application/json:
159125 * schema:
@@ -172,21 +138,18 @@ router.post('/complete', authenticateJwt, PurchaseCompleteController.completePur
172138 * type: string
173139 * price:
174140 * type: integer
141+ * seller_nickname:
142+ * type: string
175143 * purchased_at:
176144 * type: string
177145 * format: date-time
178- * seller_nickname:
179- * type: string
180- * nullable: true
181146 * pg:
182147 * type: string
183- * enum: [kakaopay, tosspay, null]
148+ * description: 결제 제공자 (DB Enum)
149+ * enum: [TOSSPAYMENTS, KAKAOPAY, TOSSPAY, NAVERPAY, SAMSUNGPAY, APPLEPAY, LPAY, PAYCO, SSG, PINPAY]
150+ * nullable: true
184151 * statusCode:
185152 * type: integer
186- * 401:
187- * description: 인증 실패
188- * 500:
189- * description: 서버 오류
190153 */
191154router . get ( '/' , authenticateJwt , PurchaseHistoryController . list ) ;
192155
0 commit comments