支付上报
This commit is contained in:
parent
d3d224c855
commit
be043ef0d1
@ -633,25 +633,27 @@ function BIReport:postPayTurn(giftType, id, rechargeId)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- 取消购买
|
-- 取消购买
|
||||||
function BIReport:postPayCancel(productId, orderId, rechargeId, giftType)
|
function BIReport:postPayCancel(productId, orderId, rechargeId, giftType, id)
|
||||||
local args = {
|
local args = {
|
||||||
pay_product_id = productId,
|
pay_product_id = productId,
|
||||||
pay_order_id = orderId,
|
pay_order_id = orderId,
|
||||||
recharge_id = rechargeId,
|
recharge_id = rechargeId,
|
||||||
gift_type = giftType,
|
gift_type = giftType,
|
||||||
|
commodity_id = id,
|
||||||
event_type = BIReport.PAY_OPT_TYPE.CANCEL,
|
event_type = BIReport.PAY_OPT_TYPE.CANCEL,
|
||||||
}
|
}
|
||||||
self:report(EVENT_NAME_PAY_OPT, args)
|
self:report(EVENT_NAME_PAY_OPT, args)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 购买失败
|
-- 购买失败
|
||||||
function BIReport:postPayFailed(productId, orderId, rechargeId, failedType, giftType)
|
function BIReport:postPayFailed(productId, orderId, rechargeId, failedType, giftType, id)
|
||||||
local args = {
|
local args = {
|
||||||
pay_product_id = productId,
|
pay_product_id = productId,
|
||||||
pay_order_id = orderId,
|
pay_order_id = orderId,
|
||||||
recharge_id = rechargeId,
|
recharge_id = rechargeId,
|
||||||
pay_failed_type = failedType,
|
pay_failed_type = failedType,
|
||||||
gift_type = giftType,
|
gift_type = giftType,
|
||||||
|
commodity_id = id,
|
||||||
event_type = BIReport.PAY_OPT_TYPE.FAILED,
|
event_type = BIReport.PAY_OPT_TYPE.FAILED,
|
||||||
}
|
}
|
||||||
self:report(EVENT_NAME_PAY_OPT, args)
|
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
|
if msgData.uuid and msgData.uuid ~= GConst.EMPTY_STRING then
|
||||||
local giftType = PayManager:getGiftType(purchaseType, id)
|
local giftType = PayManager:getGiftType(purchaseType, id)
|
||||||
BIReport:postPayTurn(giftType, id, rechargeId)
|
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
|
if purchaseToken and orderId then
|
||||||
self:requestRewards(purchaseToken, orderId, originOrderId)
|
self:requestRewards(purchaseToken, orderId, originOrderId)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -166,8 +166,8 @@ function SDKManager:checkPay(productId, callback)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- 支付
|
-- 支付
|
||||||
function SDKManager:pay(productId, orderId, rechargeId, giftType, callback)
|
function SDKManager:pay(productId, orderId, rechargeId, giftType, giftId, callback)
|
||||||
SDKPayMgr:pay(productId, orderId, rechargeId, giftType, callback)
|
SDKPayMgr:pay(productId, orderId, rechargeId, giftType, giftId, callback)
|
||||||
end
|
end
|
||||||
|
|
||||||
function SDKManager:doUncompletePay(callback)
|
function SDKManager:doUncompletePay(callback)
|
||||||
|
|||||||
@ -45,7 +45,7 @@ function SDKPayDefaultManager:checkPay(productId, callback)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- 支付
|
-- 支付
|
||||||
function SDKPayDefaultManager:pay(productId, orderId, rechargeId, giftType, callback)
|
function SDKPayDefaultManager:pay(productId, orderId, rechargeId, giftType, giftId, callback)
|
||||||
callback("", orderId)
|
callback("", orderId)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -313,8 +313,8 @@ function SDKPayGoogleManager:checkPay(productId, callback)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- 支付
|
-- 支付
|
||||||
function SDKPayGoogleManager:pay(productId, orderId, rechargeId, giftType, callback)
|
function SDKPayGoogleManager:pay(productId, orderId, rechargeId, giftType, giftId, callback)
|
||||||
self:doGooglePay(productId, orderId, rechargeId, giftType, callback)
|
self:doGooglePay(productId, orderId, rechargeId, giftType, giftId, callback)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 连接Google商店
|
-- 连接Google商店
|
||||||
@ -326,7 +326,7 @@ function SDKPayGoogleManager:connectGoogleStore(callback)
|
|||||||
end)
|
end)
|
||||||
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 payType = PAY_TYPE_IN_APP
|
||||||
local rechargeCfg = ConfigManager:getConfig("recharge")[rechargeId]
|
local rechargeCfg = ConfigManager:getConfig("recharge")[rechargeId]
|
||||||
if rechargeCfg.subscribe then
|
if rechargeCfg.subscribe then
|
||||||
@ -343,11 +343,11 @@ function SDKPayGoogleManager:doGooglePay(productId, orderId, rechargeId, giftTyp
|
|||||||
elseif code == 1 then
|
elseif code == 1 then
|
||||||
-- 支付取消
|
-- 支付取消
|
||||||
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC_25))
|
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC_25))
|
||||||
BIReport:postPayCancel(productId, orderId, rechargeId, giftType)
|
BIReport:postPayCancel(productId, orderId, rechargeId, giftType, giftId)
|
||||||
else
|
else
|
||||||
-- 支付失败
|
-- 支付失败
|
||||||
Logger.log("pay failed")
|
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)
|
end)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -227,8 +227,8 @@ function SDKPayiOSManager:checkPay(productId, callback)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- 支付
|
-- 支付
|
||||||
function SDKPayiOSManager:pay(productId, orderId, rechargeId, giftType, callback)
|
function SDKPayiOSManager:pay(productId, orderId, rechargeId, giftType, giftId, callback)
|
||||||
self:doIosPay(productId, orderId, rechargeId, callback)
|
self:doIosPay(productId, orderId, rechargeId, giftType, giftId, callback)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- sdk将已完成的订单消耗掉
|
-- sdk将已完成的订单消耗掉
|
||||||
@ -239,7 +239,7 @@ function SDKPayiOSManager:consumePurchase(token, callback)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function SDKPayiOSManager:doIosPay(productId, orderId, rechargeId, giftType, callback)
|
function SDKPayiOSManager:doIosPay(productId, orderId, rechargeId, giftType, giftId, callback)
|
||||||
self.blockTouch = true
|
self.blockTouch = true
|
||||||
UIManager:showWaitNet()
|
UIManager:showWaitNet()
|
||||||
CS.BF.BFMain.Instance.SDKMgr.IosPaySDKMgr.buyCallback = function(isSuccess, result, errorStr)
|
CS.BF.BFMain.Instance.SDKMgr.IosPaySDKMgr.buyCallback = function(isSuccess, result, errorStr)
|
||||||
@ -258,9 +258,9 @@ function SDKPayiOSManager:doIosPay(productId, orderId, rechargeId, giftType, cal
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
if errorStr and errorStr ~= "" then
|
if errorStr and errorStr ~= "" then
|
||||||
BIReport:postPayFailed(productId, orderId, rechargeId, errorStr, giftType)
|
BIReport:postPayFailed(productId, orderId, rechargeId, errorStr, giftType, giftId)
|
||||||
else
|
else
|
||||||
BIReport:postPayFailed(productId, orderId, rechargeId, "1", giftType)
|
BIReport:postPayFailed(productId, orderId, rechargeId, "1", giftType, giftId)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self:delIosOrder(productId)
|
self:delIosOrder(productId)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user