|
1 | 1 | package com.nextroom.nextRoomServer.util.inapp; |
2 | 2 |
|
3 | | -import static com.nextroom.nextRoomServer.exceptions.StatusCode.ENVIRONMENT_DOES_NOT_MATCH; |
4 | | -import static com.nextroom.nextRoomServer.exceptions.StatusCode.INTERNAL_SERVER_ERROR; |
5 | | -import static com.nextroom.nextRoomServer.exceptions.StatusCode.IO_ERROR; |
6 | | -import static com.nextroom.nextRoomServer.exceptions.StatusCode.PACKAGE_NAME_DOES_NOT_MATCH; |
7 | | - |
8 | 3 | import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport; |
9 | 4 | import com.google.api.client.json.gson.GsonFactory; |
10 | 5 | import com.google.api.services.androidpublisher.AndroidPublisher; |
|
26 | 21 | import org.springframework.core.io.ClassPathResource; |
27 | 22 | import org.springframework.stereotype.Component; |
28 | 23 |
|
| 24 | +import static com.nextroom.nextRoomServer.exceptions.StatusCode.*; |
| 25 | + |
29 | 26 | @Slf4j |
30 | 27 | @Component |
31 | 28 | public class AndroidPurchaseUtils { |
@@ -75,11 +72,10 @@ public SubscriptionPurchase verifyPurchase(String purchaseToken, String subscrip |
75 | 72 | public SubscriptionPurchaseV2 verifyPurchase(String purchaseToken) { |
76 | 73 | SubscriptionPurchaseV2 subscriptionPurchaseV2 = getSubscriptionPurchase(purchaseToken); |
77 | 74 |
|
78 | | - // TODO ๊ตฌ๋งค ์ํฉ ๊ฒ์ฆ ํ์ |
79 | | - // ์ํ ์น์ธ์ด ๋์ง ์์ ๊ฒฝ์ฐ |
80 | | - // if (subscriptionPurchaseV2.getAcknowledgementState().equals("ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED")) { |
81 | | - // throw new CustomException(BAD_REQUEST); |
82 | | - // } |
| 75 | + // ์ด๋ฏธ ์ํ ์น์ธ์ด ๋ ๊ฒฝ์ฐ |
| 76 | + if (subscriptionPurchaseV2.getAcknowledgementState().equals("ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED")) { |
| 77 | + throw new CustomException(ALREADY_ACKNOWLEDGED); |
| 78 | + } |
83 | 79 |
|
84 | 80 | log.info("SUBSCRIPTION AT PURCHASE(V2) : {}", subscriptionPurchaseV2.toString()); |
85 | 81 |
|
|
0 commit comments