支付上报

This commit is contained in:
chenxi 2023-06-06 15:50:33 +08:00
parent d3d224c855
commit be043ef0d1
6 changed files with 18 additions and 16 deletions

View File

@ -633,25 +633,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)

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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)