未完成订单
This commit is contained in:
parent
2f8ba2991c
commit
6d97c5f9bf
@ -96,8 +96,13 @@ end
|
|||||||
-- 处理未完成的订单
|
-- 处理未完成的订单
|
||||||
function SDKPayiOSManager:doUncompleteOrder(callback, productId)
|
function SDKPayiOSManager:doUncompleteOrder(callback, productId)
|
||||||
self.handleUncompleteIosOrder = true
|
self.handleUncompleteIosOrder = true
|
||||||
|
if self.handleUncompleteOrder then
|
||||||
|
return callback and callback(1)
|
||||||
|
end
|
||||||
|
self.handleUncompleteOrder = true
|
||||||
local orders = self.iosPayInfos
|
local orders = self.iosPayInfos
|
||||||
if orders == nil then
|
if orders == nil then
|
||||||
|
self.handleUncompleteOrder = false
|
||||||
return callback and callback()
|
return callback and callback()
|
||||||
end
|
end
|
||||||
local uncompleteList = {}
|
local uncompleteList = {}
|
||||||
@ -105,11 +110,13 @@ function SDKPayiOSManager:doUncompleteOrder(callback, productId)
|
|||||||
table.insert(uncompleteList, v)
|
table.insert(uncompleteList, v)
|
||||||
end
|
end
|
||||||
if #uncompleteList <= 0 then
|
if #uncompleteList <= 0 then
|
||||||
|
self.handleUncompleteOrder = false
|
||||||
return callback and callback()
|
return callback and callback()
|
||||||
end
|
end
|
||||||
local index = 1
|
local index = 1
|
||||||
local function handleOrder(uncompleteOrder)
|
local function handleOrder(uncompleteOrder)
|
||||||
if uncompleteOrder == nil then
|
if uncompleteOrder == nil then
|
||||||
|
self.handleUncompleteOrder = false
|
||||||
return callback and callback()
|
return callback and callback()
|
||||||
end
|
end
|
||||||
-- 去服务器验证
|
-- 去服务器验证
|
||||||
@ -213,7 +220,7 @@ end
|
|||||||
-- 检查是否可以支付
|
-- 检查是否可以支付
|
||||||
function SDKPayiOSManager:checkPay(productId, callback)
|
function SDKPayiOSManager:checkPay(productId, callback)
|
||||||
if self:_getIsIosInitialized() then
|
if self:_getIsIosInitialized() then
|
||||||
SDKManager:doUncompleteOrder(function(code)
|
self:doUncompleteOrder(function(code)
|
||||||
-- 先处理未完成的订单
|
-- 先处理未完成的订单
|
||||||
if code == 0 then
|
if code == 0 then
|
||||||
callback(0)
|
callback(0)
|
||||||
@ -298,7 +305,7 @@ function SDKPayiOSManager:doUncompletePay(callback)
|
|||||||
|
|
||||||
if self:_getIsIosInitialized() then
|
if self:_getIsIosInitialized() then
|
||||||
self.alreadyFinishUncompletePay = true
|
self.alreadyFinishUncompletePay = true
|
||||||
SDKManager:doUncompleteOrder()
|
self:doUncompleteOrder()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user