Merge pull request 'test' (#147) from test into main

Reviewed-on: #147
This commit is contained in:
klaus 2024-03-22 10:08:00 +00:00
commit 2a79903a28
1 changed files with 8 additions and 1 deletions

View File

@ -213,8 +213,15 @@ class ChargeService(
val response = androidPublisher.purchases().products()
.get("kr.co.vividnext.sodalive", request.productId, request.purchaseToken)
.execute() ?: throw SodaException("결제정보에 오류가 있습니다.")
if (
response.purchaseState == 0 &&
response.consumptionState == 0 &&
charge.payment?.status == PaymentStatus.REQUEST
) {
androidPublisher.purchases().products()
.consume("kr.co.vividnext.sodalive", request.productId, request.purchaseToken)
.execute() ?: throw SodaException("결제정보에 오류가 있습니다.")
if (response.purchaseState == 0 && charge.payment?.status == PaymentStatus.REQUEST) {
charge.payment?.receiptId = response.purchaseToken
charge.payment?.method = "구글(인 앱 결제)"
charge.payment?.status = PaymentStatus.COMPLETE