From e3f0145264597c6ca6decc933adbab1b7d5e8efe Mon Sep 17 00:00:00 2001
From: Klaus <klaus@vividnext.co.kr>
Date: Fri, 22 Mar 2024 20:22:35 +0900
Subject: [PATCH] =?UTF-8?q?=EA=B5=AC=EA=B8=80=20=EC=9D=B8=20=EC=95=B1=20?=
 =?UTF-8?q?=EA=B2=B0=EC=A0=9C=20=EA=B2=80=EC=A6=9D=20=EC=88=98=EC=A0=95=20?=
 =?UTF-8?q?-=20=ED=98=84=EC=9E=AC=20:=20=EA=B5=AC=EB=A7=A4=EC=83=81?=
 =?UTF-8?q?=ED=83=9C=20=ED=99=95=EC=9D=B8=20=ED=9B=84=20=EC=B6=A9=EC=A0=84?=
 =?UTF-8?q?=20=EC=99=84=EB=A3=8C=20=EC=B2=98=EB=A6=AC=20-=20=EC=88=98?=
 =?UTF-8?q?=EC=A0=95=20:=20=EA=B5=AC=EB=A7=A4=EC=83=81=ED=83=9C=EC=99=80?=
 =?UTF-8?q?=20=EC=86=8C=EB=B9=84=EC=83=81=ED=83=9C=EB=A5=BC=20=ED=99=95?=
 =?UTF-8?q?=EC=9D=B8=20=ED=9B=84=20=EC=86=8C=EB=B9=84=EB=90=98=EC=A7=80=20?=
 =?UTF-8?q?=EC=95=8A=EC=95=98=EC=9C=BC=EB=A9=B4=20=EC=86=8C=EB=B9=84=20?=
 =?UTF-8?q?=ED=9B=84=20=EC=B6=A9=EC=A0=84=20=EC=99=84=EB=A3=8C=20=EC=B2=98?=
 =?UTF-8?q?=EB=A6=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../co/vividnext/sodalive/can/charge/ChargeService.kt  | 10 +++++-----
 1 file changed, 5 insertions(+), 5 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 82a5867..cbc4a14 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
@@ -210,18 +210,18 @@ class ChargeService(
             ?: throw SodaException("로그인 정보를 확인해주세요.")
 
         if (charge.payment!!.paymentGateway == PaymentGateway.GOOGLE_IAP) {
+            androidPublisher.purchases().products()
+                .consume("kr.co.vividnext.sodalive", request.productId, request.purchaseToken)
+                .execute()
+
             val response = androidPublisher.purchases().products()
                 .get("kr.co.vividnext.sodalive", request.productId, request.purchaseToken)
                 .execute() ?: throw SodaException("결제정보에 오류가 있습니다.")
             if (
                 response.purchaseState == 0 &&
-                response.consumptionState == 0 &&
+                response.consumptionState == 1 &&
                 charge.payment?.status == PaymentStatus.REQUEST
             ) {
-                androidPublisher.purchases().products()
-                    .consume("kr.co.vividnext.sodalive", request.productId, request.purchaseToken)
-                    .execute() ?: throw SodaException("결제정보에 오류가 있습니다.")
-
                 charge.payment?.receiptId = response.purchaseToken
                 charge.payment?.method = "구글(인 앱 결제)"
                 charge.payment?.status = PaymentStatus.COMPLETE