Merge branch 'dev' of http://git.juzugame.com/b6-client/b6-lua into dev
This commit is contained in:
commit
1f22f95197
@ -235,6 +235,7 @@ function BIReport:report(name, args)
|
||||
if DataManager.BagData and DataManager.BagData.ItemData then
|
||||
args.gold = DataManager.BagData.ItemData:getItemNumById(GConst.ItemConst.ITEM_ID_GOLD)
|
||||
args.gem = DataManager.BagData.ItemData:getItemNumById(GConst.ItemConst.ITEM_ID_GEM)
|
||||
args.energy = DataManager.BagData.ItemData:getItemNumById(GConst.ItemConst.ITEM_ID_VIT)
|
||||
end
|
||||
end
|
||||
args.current_version = CS.BF.BFMain.Instance.GameLaunchMgr:GetCurrentVersion()
|
||||
@ -633,25 +634,27 @@ function BIReport:postPayTurn(giftType, id, rechargeId)
|
||||
end
|
||||
|
||||
-- 取消购买
|
||||
function BIReport:postPayCancel(productId, orderId, rechargeId, giftType)
|
||||
function BIReport:postPayCancel(productId, orderId, rechargeId, giftType, id)
|
||||
local args = {
|
||||
pay_product_id = productId,
|
||||
pay_order_id = orderId,
|
||||
recharge_id = rechargeId,
|
||||
gift_type = giftType,
|
||||
commodity_id = id,
|
||||
event_type = BIReport.PAY_OPT_TYPE.CANCEL,
|
||||
}
|
||||
self:report(EVENT_NAME_PAY_OPT, args)
|
||||
end
|
||||
|
||||
-- 购买失败
|
||||
function BIReport:postPayFailed(productId, orderId, rechargeId, failedType, giftType)
|
||||
function BIReport:postPayFailed(productId, orderId, rechargeId, failedType, giftType, id)
|
||||
local args = {
|
||||
pay_product_id = productId,
|
||||
pay_order_id = orderId,
|
||||
recharge_id = rechargeId,
|
||||
pay_failed_type = failedType,
|
||||
gift_type = giftType,
|
||||
commodity_id = id,
|
||||
event_type = BIReport.PAY_OPT_TYPE.FAILED,
|
||||
}
|
||||
self:report(EVENT_NAME_PAY_OPT, args)
|
||||
|
||||
@ -203,7 +203,7 @@ function PayManager:checkAndPay(productId, id, purchaseType, rechargeId)
|
||||
if msgData.uuid and msgData.uuid ~= GConst.EMPTY_STRING then
|
||||
local giftType = PayManager:getGiftType(purchaseType, id)
|
||||
BIReport:postPayTurn(giftType, id, rechargeId)
|
||||
SDKManager:pay(productId, msgData.uuid, rechargeId, giftType, function(purchaseToken, orderId, originOrderId)
|
||||
SDKManager:pay(productId, msgData.uuid, rechargeId, giftType, id, function(purchaseToken, orderId, originOrderId)
|
||||
if purchaseToken and orderId then
|
||||
self:requestRewards(purchaseToken, orderId, originOrderId)
|
||||
end
|
||||
|
||||
@ -166,8 +166,8 @@ function SDKManager:checkPay(productId, callback)
|
||||
end
|
||||
|
||||
-- 支付
|
||||
function SDKManager:pay(productId, orderId, rechargeId, giftType, callback)
|
||||
SDKPayMgr:pay(productId, orderId, rechargeId, giftType, callback)
|
||||
function SDKManager:pay(productId, orderId, rechargeId, giftType, giftId, callback)
|
||||
SDKPayMgr:pay(productId, orderId, rechargeId, giftType, giftId, callback)
|
||||
end
|
||||
|
||||
function SDKManager:doUncompletePay(callback)
|
||||
|
||||
@ -45,7 +45,7 @@ function SDKPayDefaultManager:checkPay(productId, callback)
|
||||
end
|
||||
|
||||
-- 支付
|
||||
function SDKPayDefaultManager:pay(productId, orderId, rechargeId, giftType, callback)
|
||||
function SDKPayDefaultManager:pay(productId, orderId, rechargeId, giftType, giftId, callback)
|
||||
callback("", orderId)
|
||||
end
|
||||
|
||||
|
||||
@ -313,8 +313,8 @@ function SDKPayGoogleManager:checkPay(productId, callback)
|
||||
end
|
||||
|
||||
-- 支付
|
||||
function SDKPayGoogleManager:pay(productId, orderId, rechargeId, giftType, callback)
|
||||
self:doGooglePay(productId, orderId, rechargeId, giftType, callback)
|
||||
function SDKPayGoogleManager:pay(productId, orderId, rechargeId, giftType, giftId, callback)
|
||||
self:doGooglePay(productId, orderId, rechargeId, giftType, giftId, callback)
|
||||
end
|
||||
|
||||
-- 连接Google商店
|
||||
@ -326,7 +326,7 @@ function SDKPayGoogleManager:connectGoogleStore(callback)
|
||||
end)
|
||||
end
|
||||
|
||||
function SDKPayGoogleManager:doGooglePay(productId, orderId, rechargeId, giftType, callback)
|
||||
function SDKPayGoogleManager:doGooglePay(productId, orderId, rechargeId, giftType, giftId, callback)
|
||||
local payType = PAY_TYPE_IN_APP
|
||||
local rechargeCfg = ConfigManager:getConfig("recharge")[rechargeId]
|
||||
if rechargeCfg.subscribe then
|
||||
@ -343,11 +343,11 @@ function SDKPayGoogleManager:doGooglePay(productId, orderId, rechargeId, giftTyp
|
||||
elseif code == 1 then
|
||||
-- 支付取消
|
||||
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC_25))
|
||||
BIReport:postPayCancel(productId, orderId, rechargeId, giftType)
|
||||
BIReport:postPayCancel(productId, orderId, rechargeId, giftType, giftId)
|
||||
else
|
||||
-- 支付失败
|
||||
Logger.log("pay failed")
|
||||
BIReport:postPayFailed(productId, orderId, rechargeId, msg or GConst.EMPTY_STRING, giftType)
|
||||
BIReport:postPayFailed(productId, orderId, rechargeId, msg or GConst.EMPTY_STRING, giftType, giftId)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
@ -227,8 +227,8 @@ function SDKPayiOSManager:checkPay(productId, callback)
|
||||
end
|
||||
|
||||
-- 支付
|
||||
function SDKPayiOSManager:pay(productId, orderId, rechargeId, giftType, callback)
|
||||
self:doIosPay(productId, orderId, rechargeId, callback)
|
||||
function SDKPayiOSManager:pay(productId, orderId, rechargeId, giftType, giftId, callback)
|
||||
self:doIosPay(productId, orderId, rechargeId, giftType, giftId, callback)
|
||||
end
|
||||
|
||||
-- sdk将已完成的订单消耗掉
|
||||
@ -239,7 +239,7 @@ function SDKPayiOSManager:consumePurchase(token, callback)
|
||||
end
|
||||
end
|
||||
|
||||
function SDKPayiOSManager:doIosPay(productId, orderId, rechargeId, giftType, callback)
|
||||
function SDKPayiOSManager:doIosPay(productId, orderId, rechargeId, giftType, giftId, callback)
|
||||
self.blockTouch = true
|
||||
UIManager:showWaitNet()
|
||||
CS.BF.BFMain.Instance.SDKMgr.IosPaySDKMgr.buyCallback = function(isSuccess, result, errorStr)
|
||||
@ -258,9 +258,9 @@ function SDKPayiOSManager:doIosPay(productId, orderId, rechargeId, giftType, cal
|
||||
end
|
||||
else
|
||||
if errorStr and errorStr ~= "" then
|
||||
BIReport:postPayFailed(productId, orderId, rechargeId, errorStr, giftType)
|
||||
BIReport:postPayFailed(productId, orderId, rechargeId, errorStr, giftType, giftId)
|
||||
else
|
||||
BIReport:postPayFailed(productId, orderId, rechargeId, "1", giftType)
|
||||
BIReport:postPayFailed(productId, orderId, rechargeId, "1", giftType, giftId)
|
||||
end
|
||||
end
|
||||
self:delIosOrder(productId)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user