fix(charge): payverseVerify 결제금액 비교로직 수정
- BigDecimal끼리 비교하는데 casting 로직이 추가되어 문제가 생기던 버그 수정
This commit is contained in:
@@ -342,15 +342,15 @@ class ChargeService(
|
|||||||
}
|
}
|
||||||
|
|
||||||
val body = response.body?.string() ?: throw SodaException("결제정보에 오류가 있습니다.")
|
val body = response.body?.string() ?: throw SodaException("결제정보에 오류가 있습니다.")
|
||||||
println(body)
|
|
||||||
val verifyResponse = objectMapper.readValue(body, PayverseVerifyResponse::class.java)
|
val verifyResponse = objectMapper.readValue(body, PayverseVerifyResponse::class.java)
|
||||||
println(verifyResponse)
|
println(verifyResponse)
|
||||||
|
|
||||||
val isSuccess = verifyResponse.resultStatus == "SUCCESS" &&
|
val isSuccess = verifyResponse.resultStatus == "SUCCESS" &&
|
||||||
verifyResponse.transactionStatus == "SUCCESS" &&
|
verifyResponse.transactionStatus == "SUCCESS" &&
|
||||||
verifyResponse.orderId.toLongOrNull() == charge.id &&
|
verifyResponse.orderId.toLongOrNull() == charge.id &&
|
||||||
verifyResponse.processingAmount.compareTo(BigDecimal.valueOf(charge.can!!.price.toLong())) == 0
|
verifyResponse.processingAmount.compareTo(charge.can!!.price) == 0
|
||||||
|
|
||||||
|
println(isSuccess)
|
||||||
if (isSuccess) {
|
if (isSuccess) {
|
||||||
// verify 함수의 232~248 라인과 동일 처리
|
// verify 함수의 232~248 라인과 동일 처리
|
||||||
charge.payment?.receiptId = verifyResponse.tid
|
charge.payment?.receiptId = verifyResponse.tid
|
||||||
@@ -381,9 +381,7 @@ class ChargeService(
|
|||||||
} else {
|
} else {
|
||||||
throw SodaException("결제정보에 오류가 있습니다.")
|
throw SodaException("결제정보에 오류가 있습니다.")
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (_: Exception) {
|
||||||
print(e.localizedMessage)
|
|
||||||
print(e.message)
|
|
||||||
throw SodaException("결제정보에 오류가 있습니다.")
|
throw SodaException("결제정보에 오류가 있습니다.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user