4—后台进入前台的流程
2021-04-07 15:47:17 0 举报
后台进入前台的流程
作者其他创作
大纲/内容
transactionIdentifier = obj.skTransaction.transactionIdentifier;transactionState = IAPPaymentTransactionStatePurched;
finish交易事务
应用程序进入前台的监听applicationWillEnterForegroundNotification
是
return
处理本地没有,但苹果交易事务中有的订单proccessUnMatchedSKTransactions
遍历所有交易事务
筛选本地存在的订单
苹果支付失败SKPaymentTransactionStateFailed
因遍历所以会多次调起/dealpay接口verifyPaymentProductfromSceneinBackground:YEScompletion
交易状态是取消购买,不删除本地订单,不finish苹果订单IAPPaymentTransactionStateCancelled
苹果支付成功SKPaymentTransactionStatePurchased
transactionState = IAPPaymentTransactionStatePurched;transactionIdentifier = obj.skTransaction.transactionIdentifier;
新增/更新交易事务
否
失败中非取消的情况 error.code != SKErrorPaymentCancelled
自动续费且非第一次购买
核验票据verifyPaymentUnderScene:TransactionVerifierSceneAppLaunchinBackground:YEStransactioncompletion
SKPaymentTransactionStateFailed //苹果支付失败SKPaymentTransactionStateRestored//已经购买过商品SKPaymentTransactionStatePurchasing //苹果支付中SKPaymentTransactionStatePurchased //苹果支付成功
后台进入前台的流程
不存在交易事务
proccessPaymentProductsMatchInSkTransactionsfromScene:TransactionVerifierSceneBackToFore
交易状态是购买失败,但已扣款,下次更新为购买成功IAPPaymentTransactionStateFailed
遍历苹果交易事务集
不存在payId
failedTransactionId = obj.skTransaction.transactionIdentifier;transactionState = IAPPaymentTransactionStateFailed;
交易状态是未购买或购买中,等待下一次变更IAPPaymentTransactionStatePrePurchaseIAPPaymentTransactionStatePurchasing
票据校验流程
0 条评论
下一页