test #164

Merged
klaus merged 2 commits from test into main 2024-04-15 12:31:43 +00:00
1 changed files with 15 additions and 3 deletions
Showing only changes of commit c40220f766 - Show all commits

View File

@ -269,10 +269,21 @@ class ChargeService(
productId,
purchaseToken
)
charge.payment!!.status = PaymentStatus.COMPLETE
member.charge(charge.chargeCan, 0, "aos")
return true
val response = androidPublisher.purchases().products()
.get("kr.co.vividnext.sodalive", productId, purchaseToken)
.execute() ?: throw SodaException("결제정보에 오류가 있습니다.")
if (response.consumptionState == 1) {
charge.payment!!.status = PaymentStatus.COMPLETE
member.charge(charge.chargeCan, 0, "aos")
return true
} else {
attempt += 1
Thread.sleep(delay)
delay *= 2
}
} catch (e: Exception) {
lastError = e
attempt += 1
@ -280,6 +291,7 @@ class ChargeService(
delay *= 2
}
}
lastError?.printStackTrace()
return false
}