ios支付

This commit is contained in:
chenxi 2023-06-15 19:54:46 +08:00
parent 6d97c5f9bf
commit 30cbf7d8cc

View File

@ -268,7 +268,6 @@ function SDKPayiOSManager:doIosPay(productId, orderId, rechargeId, giftType, pur
if self.blockTouch then if self.blockTouch then
self.blockTouch = false self.blockTouch = false
UIManager:hideWaitPay() UIManager:hideWaitPay()
end
if isSuccess then if isSuccess then
Logger.log("ios pay availableToPurchase = %s", result.availableToPurchase) Logger.log("ios pay availableToPurchase = %s", result.availableToPurchase)
Logger.log("ios pay transactionID = %s", result.transactionID) Logger.log("ios pay transactionID = %s", result.transactionID)
@ -286,6 +285,29 @@ function SDKPayiOSManager:doIosPay(productId, orderId, rechargeId, giftType, pur
end end
end end
self:delIosOrder(productId) self:delIosOrder(productId)
else -- 说明是其他未完成回调
local payParams = self.iosPayInfos[result.transactionID]
local needConsumePurchase = true
if payParams ~= nil and payParams.order then
PayManager:requestRewards(result.receipt, payParams.order, result.transactionID, payParams.productId)
needConsumePurchase = false
end
if needConsumePurchase then
local order = self.iosOrders[result.definition.id]
if order then
PayManager:requestRewards(result.receipt, order.order, result.transactionID, result.definition.id)
else
self:delIosPayInfo(result.transactionID)
self:delIosOrder(result.definition.id)
self:consumePurchase(result.definition.id)
local giftId = tonumber(payParams.giftId)
local purchaseType = tonumber(payParams.purchaseType)
local giftType = PayManager:getGiftType(purchaseType, giftId)
local rechargeId = PayManager:getPackageRechargeId(purchaseType, giftId)
BIReport:postPayFailed(result.definition.id, result.transactionID, rechargeId, "error order", giftType, giftId)
end
end
end
end end
self:saveIosOrder(productId, orderId, purchaseType, giftId) self:saveIosOrder(productId, orderId, purchaseType, giftId)
CS.BF.BFMain.Instance.SDKMgr.IosPaySDKMgr:Buy(productId, orderId) CS.BF.BFMain.Instance.SDKMgr.IosPaySDKMgr:Buy(productId, orderId)