From 6d97c5f9bf80e16e6fdd9364235324589c52a96a Mon Sep 17 00:00:00 2001 From: chenxi Date: Thu, 15 Jun 2023 19:16:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=AA=E5=AE=8C=E6=88=90=E8=AE=A2=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/common/sdk_pay_ios_manager.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lua/app/common/sdk_pay_ios_manager.lua b/lua/app/common/sdk_pay_ios_manager.lua index 9818c862..ac9e8d4f 100644 --- a/lua/app/common/sdk_pay_ios_manager.lua +++ b/lua/app/common/sdk_pay_ios_manager.lua @@ -96,8 +96,13 @@ end -- 处理未完成的订单 function SDKPayiOSManager:doUncompleteOrder(callback, productId) self.handleUncompleteIosOrder = true + if self.handleUncompleteOrder then + return callback and callback(1) + end + self.handleUncompleteOrder = true local orders = self.iosPayInfos if orders == nil then + self.handleUncompleteOrder = false return callback and callback() end local uncompleteList = {} @@ -105,11 +110,13 @@ function SDKPayiOSManager:doUncompleteOrder(callback, productId) table.insert(uncompleteList, v) end if #uncompleteList <= 0 then + self.handleUncompleteOrder = false return callback and callback() end local index = 1 local function handleOrder(uncompleteOrder) if uncompleteOrder == nil then + self.handleUncompleteOrder = false return callback and callback() end -- 去服务器验证 @@ -213,7 +220,7 @@ end -- 检查是否可以支付 function SDKPayiOSManager:checkPay(productId, callback) if self:_getIsIosInitialized() then - SDKManager:doUncompleteOrder(function(code) + self:doUncompleteOrder(function(code) -- 先处理未完成的订单 if code == 0 then callback(0) @@ -298,7 +305,7 @@ function SDKPayiOSManager:doUncompletePay(callback) if self:_getIsIosInitialized() then self.alreadyFinishUncompletePay = true - SDKManager:doUncompleteOrder() + self:doUncompleteOrder() end end