diff --git a/src/main/java/com/example/CatchStudy/controller/BookingController.java b/src/main/java/com/example/CatchStudy/controller/BookingController.java index 4558b49..510b581 100644 --- a/src/main/java/com/example/CatchStudy/controller/BookingController.java +++ b/src/main/java/com/example/CatchStudy/controller/BookingController.java @@ -72,7 +72,6 @@ public Response checkInSeat(@RequestBody SeatCheckInRequestDto dto, Authen @PatchMapping("/booking/checkout") public Response checkOutSeat(@RequestBody SeatCheckOutRequestDto dto) { // 퇴실 - System.out.println("bookingId: "+ dto.getBooking_id()); bookingService.checkOutSeat(dto.getBooking_id()); return Response.success(); } diff --git a/src/main/java/com/example/CatchStudy/controller/PaymentController.java b/src/main/java/com/example/CatchStudy/controller/PaymentController.java index ac937ff..23fc089 100644 --- a/src/main/java/com/example/CatchStudy/controller/PaymentController.java +++ b/src/main/java/com/example/CatchStudy/controller/PaymentController.java @@ -6,11 +6,14 @@ import com.example.CatchStudy.global.exception.ErrorCode; import com.example.CatchStudy.service.BookingService; import com.example.CatchStudy.service.PaymentService; +import jakarta.servlet.http.HttpServletResponse; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; +import java.io.IOException; + @RestController @RequestMapping("/api") @RequiredArgsConstructor @@ -38,8 +41,10 @@ public void fail(@PathVariable("paymentId") Long paymentId) { } @GetMapping("/payment/success/{userId}/{paymentId}") - public String afterPayRequest(@RequestParam("pg_token") String pgToken, @PathVariable("userId") Long userId, @PathVariable("paymentId") Long paymentId) { //결제 성공 + public void afterPayRequest(@RequestParam("pg_token") String pgToken, @PathVariable("userId") Long userId, @PathVariable("paymentId") Long paymentId, HttpServletResponse response) throws IOException { //결제 성공 paymentService.kakaoPayApprove(pgToken,userId,paymentId); - return "redirect:http://localhost:3000/payment-success"; + String redirectUrl = "http://localhost:3000/payment-success"; + response.sendRedirect(redirectUrl); + //return "redirect:http://localhost:3000/payment-success"; } }