From 42eaf1d5e322e0313b3f8ec6e25a367137b0d0fc Mon Sep 17 00:00:00 2001 From: Klaus Date: Fri, 3 Oct 2025 01:25:27 +0900 Subject: [PATCH] =?UTF-8?q?fix(payverse-verify):=20=EA=B2=B0=EC=A0=9C=20?= =?UTF-8?q?=EC=84=B1=EA=B3=B5=20=EC=97=AC=EB=B6=80=20=ED=8C=90=EB=8B=A8=20?= =?UTF-8?q?=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - processingAmount 대신 requestAmount와 can 가격 비교 - productName, customerId 비교 추가 --- .../kr/co/vividnext/sodalive/can/charge/ChargeData.kt | 5 +++-- .../kr/co/vividnext/sodalive/can/charge/ChargeService.kt | 7 +++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/can/charge/ChargeData.kt b/src/main/kotlin/kr/co/vividnext/sodalive/can/charge/ChargeData.kt index f2b159c..d366ee8 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/can/charge/ChargeData.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/can/charge/ChargeData.kt @@ -70,8 +70,9 @@ data class PayverseVerifyResponse( val transactionMessage: String, val orderId: String, val customerId: String, - val processingCurrency: String, - val processingAmount: BigDecimal + val productName: String, + val requestCurrency: String, + val requestAmount: BigDecimal ) data class PayverseWebhookRequest( 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 c0d9223..28b028e 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 @@ -346,10 +346,13 @@ class ChargeService( val verifyResponse = objectMapper.readValue(body, PayverseVerifyResponse::class.java) println(verifyResponse) + val customerId = "${serverEnv}_user_${member.id!!}" val isSuccess = verifyResponse.resultStatus == "SUCCESS" && verifyResponse.transactionStatus == "SUCCESS" && 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) if (isSuccess) { @@ -363,7 +366,7 @@ class ChargeService( charge.payment?.method = mappedMethod ?: verifyResponse.schemeCode charge.payment?.status = PaymentStatus.COMPLETE // 통화코드 설정 - charge.payment?.locale = verifyResponse.processingCurrency + charge.payment?.locale = verifyResponse.requestCurrency member.charge(charge.chargeCan, charge.rewardCan, "pg")