구글 인 앱 결제 검증 수정
- 현재 : 구매상태 확인 후 충전 완료 처리 - 수정 : 구매상태와 소비상태를 확인 후 소비되지 않았으면 소비 후 충전 완료 처리
This commit is contained in:
		| @@ -214,8 +214,15 @@ class ChargeService( | ||||
|                 .get("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 | ||||
|             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("결제정보에 오류가 있습니다.") | ||||
|  | ||||
|                 charge.payment?.method = "구글(인 앱 결제)" | ||||
|                 charge.payment?.status = PaymentStatus.COMPLETE | ||||
|                 member.charge(charge.chargeCan, charge.rewardCan, "aos") | ||||
|   | ||||
		Reference in New Issue
	
	Block a user