feat(charge): payloadJson의 amount

- 소수점 아래 불필요한 0을 제거
This commit is contained in:
2025-10-02 20:29:04 +09:00
parent 32935aed88
commit 8cc9641bbf

View File

@@ -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("결제정보에 오류가 있습니다.")
}
}