From c396e21b449caddf1450e1d20bb0d20c4e98e804 Mon Sep 17 00:00:00 2001 From: pricelees Date: Wed, 6 Aug 2025 16:53:02 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20PaymentService=20=EB=82=B4=20=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8=20=EC=98=A4=ED=83=80=20=EC=88=98=EC=A0=95=20=EB=B0=8F?= =?UTF-8?q?=20=EB=A9=94=EC=84=9C=EB=93=9C=20=EC=88=9C=EC=84=9C=20=EC=9E=AC?= =?UTF-8?q?=EB=B0=B0=EC=B9=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../payment/business/PaymentService.kt | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/kotlin/roomescape/payment/business/PaymentService.kt b/src/main/kotlin/roomescape/payment/business/PaymentService.kt index a6b30c41..9ed0ccaf 100644 --- a/src/main/kotlin/roomescape/payment/business/PaymentService.kt +++ b/src/main/kotlin/roomescape/payment/business/PaymentService.kt @@ -22,6 +22,14 @@ class PaymentService( private val paymentFinder: PaymentFinder, private val paymentWriter: PaymentWriter ) { + @Transactional(readOnly = true) + fun existsByReservationId(reservationId: Long): Boolean { + log.info { "[PaymentService.existsByReservationId] 시작: reservationId=$reservationId" } + + return paymentFinder.existsPaymentByReservationId(reservationId) + .also { log.info { "[PaymentService.existsByReservationId] 완료: reservationId=$reservationId, isPaid=$it" } } + } + @Transactional fun createPayment( approvedPaymentInfo: PaymentApproveResponse, @@ -41,14 +49,6 @@ class PaymentService( .also { log.info { "[PaymentService.createPayment] 완료: paymentKey=${it.paymentKey}, reservationId=${reservation.id}, paymentId=${it.id}" } } } - @Transactional(readOnly = true) - fun existsByReservationId(reservationId: Long): Boolean { - log.info { "[PaymentService.isReservationPaid] 시작: reservationId=$reservationId" } - - return paymentFinder.existsPaymentByReservationId(reservationId) - .also { log.info { "[PaymentService.isReservationPaid] 완료: reservationId=$reservationId, isPaid=$it" } } - } - @Transactional fun createCanceledPayment( canceledPaymentInfo: PaymentCancelResponse, @@ -72,7 +72,7 @@ class PaymentService( @Transactional fun createCanceledPayment(reservationId: Long): PaymentCancelRequest { - log.info { "[PaymentService.createCanceledPaymentByReservationId] 시작: reservationId=$reservationId" } + log.info { "[PaymentService.createCanceledPayment] 시작: reservationId=$reservationId" } val payment: PaymentEntity = paymentFinder.findByReservationId(reservationId) val canceled: CanceledPaymentEntity = paymentWriter.createCanceled( @@ -82,7 +82,7 @@ class PaymentService( ) return PaymentCancelRequest(canceled.paymentKey, canceled.cancelAmount, canceled.cancelReason) - .also { log.info { "[PaymentService.createCanceledPaymentByReservationId] 완료: reservationId=$reservationId, paymentKey=${it.paymentKey}" } } + .also { log.info { "[PaymentService.createCanceledPayment] 완료: reservationId=$reservationId, paymentKey=${it.paymentKey}" } } } @Transactional