payverse 적용 #344
@@ -70,8 +70,9 @@ data class PayverseVerifyResponse(
|
|||||||
val transactionMessage: String,
|
val transactionMessage: String,
|
||||||
val orderId: String,
|
val orderId: String,
|
||||||
val customerId: String,
|
val customerId: String,
|
||||||
val processingCurrency: String,
|
val productName: String,
|
||||||
val processingAmount: BigDecimal
|
val requestCurrency: String,
|
||||||
|
val requestAmount: BigDecimal
|
||||||
)
|
)
|
||||||
|
|
||||||
data class PayverseWebhookRequest(
|
data class PayverseWebhookRequest(
|
||||||
|
@@ -346,10 +346,13 @@ class ChargeService(
|
|||||||
val verifyResponse = objectMapper.readValue(body, PayverseVerifyResponse::class.java)
|
val verifyResponse = objectMapper.readValue(body, PayverseVerifyResponse::class.java)
|
||||||
println(verifyResponse)
|
println(verifyResponse)
|
||||||
|
|
||||||
|
val customerId = "${serverEnv}_user_${member.id!!}"
|
||||||
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(charge.can!!.price) == 0
|
verifyResponse.productName == charge.title &&
|
||||||
|
verifyResponse.customerId == customerId &&
|
||||||
|
verifyResponse.requestAmount.compareTo(charge.can!!.price) == 0
|
||||||
println(isSuccess)
|
println(isSuccess)
|
||||||
|
|
||||||
if (isSuccess) {
|
if (isSuccess) {
|
||||||
@@ -363,7 +366,7 @@ class ChargeService(
|
|||||||
charge.payment?.method = mappedMethod ?: verifyResponse.schemeCode
|
charge.payment?.method = mappedMethod ?: verifyResponse.schemeCode
|
||||||
charge.payment?.status = PaymentStatus.COMPLETE
|
charge.payment?.status = PaymentStatus.COMPLETE
|
||||||
// 통화코드 설정
|
// 통화코드 설정
|
||||||
charge.payment?.locale = verifyResponse.processingCurrency
|
charge.payment?.locale = verifyResponse.requestCurrency
|
||||||
|
|
||||||
member.charge(charge.chargeCan, charge.rewardCan, "pg")
|
member.charge(charge.chargeCan, charge.rewardCan, "pg")
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user