diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/can/charge/ChargeService.kt b/src/main/kotlin/kr/co/vividnext/sodalive/can/charge/ChargeService.kt index cdfe200..ad79c1e 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/can/charge/ChargeService.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/can/charge/ChargeService.kt @@ -137,10 +137,12 @@ class ChargeService( false } } + PaymentStatus.COMPLETE -> { // 이미 결제가 완료된 경우 성공 처리(idempotent) true } + else -> { // 그 외 상태는 404 false @@ -240,7 +242,7 @@ class ChargeService( "customerId" to customerId, "productName" to can.title, "requestCurrency" to requestCurrency, - "requestAmount" to amount.toString(), + "requestAmount" to amount, "reqDate" to reqDate, "billkeyReq" to "N", "mallReserved" to "", @@ -317,6 +319,7 @@ class ChargeService( throw SodaException("결제정보에 오류가 있습니다.") } } + PaymentStatus.COMPLETE -> { // 이미 결제가 완료된 경우, 동일한 데이터로 즉시 반환 return ChargeCompleteResponse( @@ -325,6 +328,7 @@ class ChargeService( isFirstCharged = chargeRepository.isFirstCharged(memberId) ) } + else -> { throw SodaException("결제정보에 오류가 있습니다.") } @@ -388,7 +392,7 @@ class ChargeService( } else { throw SodaException("결제정보에 오류가 있습니다.") } - } catch (e: Exception) { + } catch (_: Exception) { throw SodaException("결제정보에 오류가 있습니다.") } } else { @@ -438,7 +442,7 @@ class ChargeService( } else { throw SodaException("결제정보에 오류가 있습니다.") } - } catch (e: Exception) { + } catch (_: Exception) { throw SodaException("결제정보에 오류가 있습니다.") } } else {