Merge pull request '구글 인 앱 결제 검증 수정' (#148) from test into main
Reviewed-on: #148
This commit is contained in:
commit
67a045eae6
|
@ -210,18 +210,18 @@ class ChargeService(
|
||||||
?: throw SodaException("로그인 정보를 확인해주세요.")
|
?: throw SodaException("로그인 정보를 확인해주세요.")
|
||||||
|
|
||||||
if (charge.payment!!.paymentGateway == PaymentGateway.GOOGLE_IAP) {
|
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()
|
val response = androidPublisher.purchases().products()
|
||||||
.get("kr.co.vividnext.sodalive", request.productId, request.purchaseToken)
|
.get("kr.co.vividnext.sodalive", request.productId, request.purchaseToken)
|
||||||
.execute() ?: throw SodaException("결제정보에 오류가 있습니다.")
|
.execute() ?: throw SodaException("결제정보에 오류가 있습니다.")
|
||||||
if (
|
if (
|
||||||
response.purchaseState == 0 &&
|
response.purchaseState == 0 &&
|
||||||
response.consumptionState == 0 &&
|
response.consumptionState == 1 &&
|
||||||
charge.payment?.status == PaymentStatus.REQUEST
|
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?.receiptId = response.purchaseToken
|
||||||
charge.payment?.method = "구글(인 앱 결제)"
|
charge.payment?.method = "구글(인 앱 결제)"
|
||||||
charge.payment?.status = PaymentStatus.COMPLETE
|
charge.payment?.status = PaymentStatus.COMPLETE
|
||||||
|
|
Loading…
Reference in New Issue