fix: PaymentService 내 로그 오타 수정 및 메서드 순서 재배치

This commit is contained in:
이상진 2025-08-06 16:53:02 +09:00
parent 393dceb355
commit c396e21b44

View File

@ -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