구글 인 앱 결제 검증 과정 try/catch로 예외 처리 #149

Merged
klaus merged 1 commits from test into main 2024-03-22 11:59:38 +00:00
1 changed files with 26 additions and 21 deletions

View File

@ -210,6 +210,7 @@ class ChargeService(
?: throw SodaException("로그인 정보를 확인해주세요.")
if (charge.payment!!.paymentGateway == PaymentGateway.GOOGLE_IAP) {
try {
androidPublisher.purchases().products()
.consume("kr.co.vividnext.sodalive", request.productId, request.purchaseToken)
.execute()
@ -236,6 +237,10 @@ class ChargeService(
} else {
throw SodaException("결제정보에 오류가 있습니다.")
}
} catch (e: Exception) {
e.printStackTrace()
throw SodaException("결제정보에 오류가 있습니다.")
}
} else {
throw SodaException("결제정보에 오류가 있습니다.")
}