-
谷歌支付因为网络延迟响应问题后支付的订单先结算 用栈处理的
-
谷歌支付掉单的问题
把用户id和订单id发起launchBill的时候绑定到Purchase,即BillingFlowParams
.setObfuscatedAccountId(getUid())
.setObfuscatedProfileId(mChargeRecordIds.peek())
ConsumeResponseListener(消费监听回调)
PurchasesUpdatedListener(支付监听回调)
launchBillingFlow->用户支付->PurchasesUpdatedListener 响应码是BillingClient.BillingResponseCode.OK(本地SharePreference缓存订单id和token),
BillingClient.BillingResponseCode.ITEM_ALREADY_OWNED(上次支付了没消费,重新发起launchBill的时候会报这个,所以可以先把拿到上次保存在本地SharePreference缓存订单id和token)就调用billingClient.consumeAsync->
BillingClient.BillingResponseCode.OK就拿订单id和token上报我们平台给用户打款->
打款成功移除本地SharePreference缓存的订单id和token
billingClient.startConnection会获取到订单列表,对Purchase.PurchaseState.PURCHASED
的getPurchaseToken,getAccountIdentifiers().getObfuscatedProfileId()主动调用consumeAsync