From 8cc9641bbfc8ce7e017e319da3ed80674044ab37 Mon Sep 17 00:00:00 2001 From: Klaus Date: Thu, 2 Oct 2025 20:29:04 +0900 Subject: [PATCH] =?UTF-8?q?feat(charge):=20payloadJson=EC=9D=98=20amount?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 소수점 아래 불필요한 0을 제거 --- .../co/vividnext/sodalive/can/charge/ChargeService.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 75c604d..d26e2df 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 @@ -265,7 +265,12 @@ class ChargeService( val savedCharge = chargeRepository.save(charge) val chargeId = savedCharge.id!! - val amount = savedCharge.payment!!.price.setScale(4, RoundingMode.HALF_UP).stripTrailingZeros() + val amount = BigDecimal( + savedCharge.payment!!.price + .setScale(4, RoundingMode.HALF_UP) + .stripTrailingZeros() + .toPlainString() + ) val reqDate = savedCharge.createdAt!!.format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")) val sign = DigestUtils.sha512Hex( String.format( @@ -374,7 +379,8 @@ class ChargeService( } else { throw SodaException("결제정보에 오류가 있습니다.") } - } catch (_: Exception) { + } catch (e: Exception) { + e.printStackTrace() throw SodaException("결제정보에 오류가 있습니다.") } }