ios支付
This commit is contained in:
parent
6d97c5f9bf
commit
30cbf7d8cc
@ -268,24 +268,46 @@ 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)
|
Logger.log("ios pay hasReceipt = %s", result.hasReceipt)
|
||||||
Logger.log("ios pay hasReceipt = %s", result.hasReceipt)
|
Logger.log("ios pay receipt = %s", result.receipt)
|
||||||
Logger.log("ios pay receipt = %s", result.receipt)
|
self:saveIosPayInfo(result.transactionID, result.receipt, orderId, productId, purchaseType, giftId)
|
||||||
self:saveIosPayInfo(result.transactionID, result.receipt, orderId, productId, purchaseType, giftId)
|
if callback then
|
||||||
if callback then
|
callback(result.receipt, orderId, result.transactionID)
|
||||||
callback(result.receipt, orderId, result.transactionID)
|
end
|
||||||
end
|
|
||||||
else
|
|
||||||
if errorStr and errorStr ~= "" then
|
|
||||||
BIReport:postPayFailed(productId, orderId, rechargeId, errorStr, giftType, giftId)
|
|
||||||
else
|
else
|
||||||
BIReport:postPayFailed(productId, orderId, rechargeId, "1", giftType, giftId)
|
if errorStr and errorStr ~= "" then
|
||||||
|
BIReport:postPayFailed(productId, orderId, rechargeId, errorStr, giftType, giftId)
|
||||||
|
else
|
||||||
|
BIReport:postPayFailed(productId, orderId, rechargeId, "1", giftType, giftId)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
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:delIosOrder(productId)
|
|
||||||
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)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user