google支付问题

This commit is contained in:
xiekaidong 2023-07-03 14:24:57 +08:00
parent 1cd1d31d98
commit ecddb99390

View File

@ -66,6 +66,7 @@ function SDKPayGoogleManager:queryProducts(callback)
if #subsList > 0 then
self:queryProductInfo(PAY_TYPE_SUBS, json.encode(subsList), function(code, msg)
if code == 0 then
self.queryProductsOver = true
if msg and msg ~= "" then -- 更新products
local jData = json.decode(msg)
if jData and #jData > 0 then
@ -80,6 +81,7 @@ function SDKPayGoogleManager:queryProducts(callback)
end
end)
else
self.queryProductsOver = true
if callback then
callback()
end
@ -262,6 +264,7 @@ end
-- 检查是否可以支付
function SDKPayGoogleManager:checkPay(productId, callback)
if self:_getIsGoogleStoreConnected() then -- google商店是否初始化
self:queryProducts(function()
self:doUncompleteOrder(function(code) -- 先处理未完成的订单
if code == 0 then
callback(0)
@ -283,9 +286,11 @@ function SDKPayGoogleManager:checkPay(productId, callback)
callback(0)
end
end, productId)
end)
else
self:connectGoogleStore(function(code)
if code == 0 then
self:queryProducts(function()
self:doUncompleteOrder(function(consumeSucc)
if code == 0 then
callback(0)
@ -307,6 +312,7 @@ function SDKPayGoogleManager:checkPay(productId, callback)
callback(0)
end
end, productId)
end)
else
local params = {
content = I18N:getGlobalText(I18N.GlobalConst.SETTING_DESC_22),