Sfoglia il codice sorgente

Merge branch 'develop_PDFReaderPro_V4.7.0' of git.kdan.cc:Mac_PDF/PDF_Office into develop_PDFReaderPro_V4.7.0

tangchao 1 settimana fa
parent
commit
ccdd2171a4

+ 1 - 1
PDF Office/PDF Master/Class/KMLightMember/KMRequestServer/KMRequestServer.swift

@@ -64,7 +64,7 @@ typealias KMHttpRequestServerComplete = (_ task: URLSessionDataTask?, _ response
         sessionManager.requestSerializer = AFJSONRequestSerializer()
         sessionManager.responseSerializer = AFJSONResponseSerializer()
         sessionManager.responseSerializer.acceptableContentTypes = ["application/json","text/html","text/json","text/javascript","text/plain","image/gif"]
-        sessionManager.requestSerializer.timeoutInterval = 10
+        sessionManager.requestSerializer.timeoutInterval = 60
 //        [requestSerializer setValue:@"application/vnd.api+json;version=1" forHTTPHeaderField:@"Accept"];
         if (requestSerializer != nil) {
             requestSerializer!(sessionManager.requestSerializer);

+ 7 - 0
PDF Office/PDF Master/MemberCenter/Assets/en.lproj/MemberCenterLocalizable.strings

@@ -97,3 +97,10 @@
 "Do not log in to the current device" = "Do not log in to the current device";
 "Log in to the current device" = "Log in to the current device";
 "Unbind" = "Unbind";
+
+"PDF Reader Pro Standard - Annual Plan" = "PDF Reader Pro Advanced Annual Plan";
+"PDF Reader Pro Advanced - Annual Plan" = "PDF Reader Pro Advanced Annual Plan";
+"PDF Reader Pro Permanent" = "PDF Reader Pro Advanced Annual Plan";
+"Subscribe to All Access Pack to Enjoy More Expanded Features" = "Subscribe to All Access Pack to Enjoy More Expanded Features";
+"Auto-renewal | Billed yearly" = "Auto-renewal | Billed yearly";
+"(Tax Incl.)" = "(Tax Incl.)";

+ 6 - 0
PDF Office/PDF Master/MemberCenter/Assets/zh-Hans.lproj/MemberCenterLocalizable.strings

@@ -94,3 +94,9 @@
 "Log in to the current device" = "登录当前设备";
 "Unbind" = "解绑";
 
+"PDF Reader Pro Standard - Annual Plan" = "PDF Reader Pro 标准版 - 年订阅";
+"PDF Reader Pro Advanced - Annual Plan" = "PDF Reader Pro 高级版 - 年订阅";
+"PDF Reader Pro Permanent" = "PDF Reader Pro 永久版";
+"Subscribe to All Access Pack to Enjoy More Expanded Features" = "升级会员套餐解锁更多功能";
+"Auto-renewal | Billed yearly" = "自动续费 | 年订阅";
+"(Tax Incl.)" = "(含税)";

+ 7 - 0
PDF Office/PDF Master/MemberCenter/Assets/zh-Hant.lproj/MemberCenterLocalizable.strings

@@ -93,3 +93,10 @@
 "Do not log in to the current device" = "暫不登入目前設備";
 "Log in to the current device" = "登入目前設備";
 "Unbind" = "解绑";
+
+"PDF Reader Pro Standard - Annual Plan" = "PDF Reader Pro 標準版 - 年訂閱";
+"PDF Reader Pro Advanced - Annual Plan" = "PDF Reader Pro 進階版 - 年訂閱";
+"PDF Reader Pro Permanent" = "PDF Reader Pro 永久版";
+"Subscribe to All Access Pack to Enjoy More Expanded Features" = "升級會員套餐解鎖更多功能";
+"Auto-renewal | Billed yearly" = "自動續費 | 年訂閱";
+"(Tax Incl.)" = "(含稅)";

+ 364 - 305
PDF Office/PDF Master/MemberCenter/Model/KMMemberCenterManager.swift

@@ -69,6 +69,22 @@ class KMMemberCenterManager: NSObject {
         return true
     }
     
+    // MARK: 拼接URL(为Get类型)
+    func constructURLString(baseURLString: String, parameters: [String: Any]) -> String? {
+        // Ensure the base URL is valid
+        guard var components = URLComponents(string: baseURLString) else {
+            return nil
+        }
+        
+        // Convert parameters to query items
+        components.queryItems = parameters.map { key, value in
+            URLQueryItem(name: key, value: "\(value)")
+        }
+        
+        // Return the complete URL as a string
+        return components.url?.absoluteString
+    }
+    
     // MARK: 登录模块
     
     /**
@@ -832,7 +848,7 @@ class KMMemberCenterManager: NSObject {
     
 #if VERSION_DMG
     // DMG
-        platformId = "1"
+        platformId = "2"
 #else
     // AppStore 免费版本
 #endif
@@ -840,63 +856,68 @@ class KMMemberCenterManager: NSObject {
     // AppStore 付费版
         platformId = "5"
 #endif
-        let params: [String: Any] = ["isEducation": isEducation,
+        let params: [String: Any] = ["isEducation": NSNumber(value: Int32(isEducation)),
                                      "platformId": platformId]
-        KMRequestServer.requestServer.request(urlString: urlString, method: .get, params: params) { requestSerializer in
-            
-        } completion: { [weak self] (task, responseObject, error) in
-            var dic: NSDictionary = [:]
-            if error == nil, let responseObject = responseObject as? NSDictionary {
-                dic = responseObject
-            } else {
-                var info = responseObject
-                if let error = error {
-                    if let data = error.userInfo["com.alamofire.serialization.response.error.data"] as? Data {
-                        info = try? JSONSerialization.jsonObject(with: data, options: .mutableLeaves) as? NSDictionary
+        if let urlNewString = constructURLString(baseURLString: urlString, parameters: params) {
+            KMRequestServer.requestServer.request(urlString: urlNewString, method: .get, params: nil) { requestSerializer in
+                
+            } completion: { [weak self] (task, responseObject, error) in
+                var dic: NSDictionary = [:]
+                if error == nil, let responseObject = responseObject as? NSDictionary {
+                    dic = responseObject
+                } else {
+                    var info = responseObject
+                    if let error = error {
+                        if let data = error.userInfo["com.alamofire.serialization.response.error.data"] as? Data {
+                            info = try? JSONSerialization.jsonObject(with: data, options: .mutableLeaves) as? NSDictionary
+                        }
                     }
+                    dic = (info as? NSDictionary) ?? [:]
                 }
-                dic = (info as? NSDictionary) ?? [:]
-            }
-            let code: Int = dic["code"] as? Int ?? 0
-            let result_Array: [NSDictionary] = dic["result"] as? [NSDictionary] ?? [[:]]
-            let message: String = dic["msg"] as? String ?? ""
-            
-            var results: [KMListingProductsModel] = []
-            for dict1 in result_Array {
-                var id = ""
-                var productName = ""
-                var price = NSNumber(value: 0.0)
-                var maxDeviceNum = 0
-                var levels = ""
-                var platforms = ""
-                var productLineId = 0
-                var paymentModel = 0
-                var cycle = 0
-                var code = ""
-                var cnyPrice = NSNumber(value: 0.0)
+                let code: Int = dic["code"] as? Int ?? 0
+                let result_Array: [NSDictionary] = dic["result"] as? [NSDictionary] ?? [[:]]
+                let message: String = dic["msg"] as? String ?? ""
                 
-                if let token = dict1["id"] { id = token as? String ?? id }
-                if let token = dict1["productName"] { productName = token as? String ?? productName }
-                if let token = dict1["price"] { price = token as? NSNumber ?? price }
-                if let token = dict1["maxDeviceNum"] { maxDeviceNum = token as? Int ?? maxDeviceNum }
-                if let token = dict1["levels"] { levels = token as? String ?? levels }
-                if let token = dict1["platforms"] { platforms = token as? String ?? platforms }
-                if let token = dict1["productLineId"] { productLineId = token as? Int ?? productLineId }
-                if let token = dict1["paymentModel"] { paymentModel = token as? Int ?? paymentModel }
-                if let token = dict1["cycle"] { cycle = token as? Int ?? cycle }
-                if let token = dict1["code"] { code = token as? String ?? code  }
-                if let token = dict1["cnyPrice"] { cnyPrice = token as? NSNumber ?? cnyPrice }
+                var results: [KMListingProductsModel] = []
+                for dict1 in result_Array {
+                    var id = ""
+                    var productName = ""
+                    var price = NSNumber(value: 0.0)
+                    var maxDeviceNum = 0
+                    var levels = ""
+                    var platforms = ""
+                    var productLineId = 0
+                    var paymentModel = 0
+                    var cycle = 0
+                    var code = ""
+                    var cnyPrice = NSNumber(value: 0.0)
+                    
+                    if let token = dict1["id"] { id = token as? String ?? id }
+                    if let token = dict1["productName"] { productName = token as? String ?? productName }
+                    if let token = dict1["price"] { price = token as? NSNumber ?? price }
+                    if let token = dict1["maxDeviceNum"] { maxDeviceNum = token as? Int ?? maxDeviceNum }
+                    if let token = dict1["levels"] { levels = token as? String ?? levels }
+                    if let token = dict1["platforms"] { platforms = token as? String ?? platforms }
+                    if let token = dict1["productLineId"] { productLineId = token as? Int ?? productLineId }
+                    if let token = dict1["paymentModel"] { paymentModel = token as? Int ?? paymentModel }
+                    if let token = dict1["cycle"] { cycle = token as? Int ?? cycle }
+                    if let token = dict1["code"] { code = token as? String ?? code  }
+                    if let token = dict1["cnyPrice"] { cnyPrice = token as? NSNumber ?? cnyPrice }
 
-                let products = KMListingProductsModel(id: id, productName: productName, price: price, maxDeviceNum: maxDeviceNum, levels: levels, platforms: platforms, productLineId: productLineId, paymentModel: paymentModel, cycle: cycle, code: code, cnyPrice: cnyPrice)
-                results.append(products)
-            }
+                    let products = KMListingProductsModel(id: id, productName: productName, price: price, maxDeviceNum: maxDeviceNum, levels: levels, platforms: platforms, productLineId: productLineId, paymentModel: paymentModel, cycle: cycle, code: code, cnyPrice: cnyPrice)
+                    results.append(products)
+                }
 
-            let result = KMMemberProductResult(code: code, msg: message, listingProducts: results)
-            if code == 200 {
-                complete(true, result)
-            } else {
-                complete(false, result)
+                let result = KMMemberProductResult(code: code, msg: message, listingProducts: results)
+                if code == 200 {
+                    complete(true, result)
+                } else {
+                    complete(false, result)
+                }
             }
+        } else {
+            print("Invalid URL")
+            complete(false, nil)
         }
     }
     
@@ -912,60 +933,66 @@ class KMMemberCenterManager: NSObject {
         let params: [String: Any] = ["productId": productId,
                                      "isEducation": isEducation,
                                      "userId": userId]
-        KMRequestServer.requestServer.request(urlString: urlString, method: .get, params: params) { requestSerializer in
-            
-        } completion: { [weak self] (task, responseObject, error) in
-            var dic: NSDictionary = [:]
-            if error == nil, let responseObject = responseObject as? NSDictionary {
-                dic = responseObject
-            } else {
-                var info = responseObject
-                if let error = error {
-                    if let data = error.userInfo["com.alamofire.serialization.response.error.data"] as? Data {
-                        info = try? JSONSerialization.jsonObject(with: data, options: .mutableLeaves) as? NSDictionary
+        if let urlNewString = constructURLString(baseURLString: urlString, parameters: params) {
+            KMRequestServer.requestServer.request(urlString: urlNewString, method: .get, params: nil) { requestSerializer in
+                
+            } completion: { [weak self] (task, responseObject, error) in
+                var dic: NSDictionary = [:]
+                if error == nil, let responseObject = responseObject as? NSDictionary {
+                    dic = responseObject
+                } else {
+                    var info = responseObject
+                    if let error = error {
+                        if let data = error.userInfo["com.alamofire.serialization.response.error.data"] as? Data {
+                            info = try? JSONSerialization.jsonObject(with: data, options: .mutableLeaves) as? NSDictionary
+                        }
                     }
+                    dic = (info as? NSDictionary) ?? [:]
+                }
+                let code: Int = dic["code"] as? Int ?? 0
+                let result_Array: [NSDictionary] = [dic["result"]] as? [NSDictionary] ?? [[:]]
+                let message: String = dic["msg"] as? String ?? ""
+                
+                var results: [KMListingProductsModel] = []
+                for dict1 in result_Array {
+                    var id = ""
+                    var productName = ""
+                    var price = NSNumber(value: 0.0)
+                    var maxDeviceNum = 0
+                    var levels = ""
+                    var platforms = ""
+                    var productLineId = 0
+                    var paymentModel = 0
+                    var cycle = 0
+                    var code = ""
+                    var cnyPrice = NSNumber(value: 0.0)
+                    if let token = dict1["id"] { id = token as? String ?? id }
+                    if let token = dict1["productName"] { productName = token as? String  ?? productName}
+                    if let token = dict1["price"] { price = token as? NSNumber ?? price }
+                    if let token = dict1["maxDeviceNum"] { maxDeviceNum = token as? Int ?? maxDeviceNum}
+                    if let token = dict1["levels"] { levels = token as? String ?? levels}
+                    if let token = dict1["platforms"] { platforms = token as? String ?? platforms}
+                    if let token = dict1["productLineId"] { productLineId = token as? Int ?? productLineId}
+                    if let token = dict1["paymentModel"] { paymentModel = token as? Int ?? paymentModel}
+                    if let token = dict1["cycle"] { cycle = token as? Int ?? cycle}
+                    if let token = dict1["code"] { code = token as? String ?? code}
+                    if let token = dict1["cnyPrice"] { cnyPrice = token as? NSNumber ?? cnyPrice}
+                    let products = KMListingProductsModel(id: id, productName: productName, price: price, maxDeviceNum: maxDeviceNum, levels: levels, platforms: platforms, productLineId: productLineId, paymentModel: paymentModel, cycle: cycle, code: code, cnyPrice: cnyPrice)
+                    results.append(products)
                 }
-                dic = (info as? NSDictionary) ?? [:]
-            }
-            let code: Int = dic["code"] as? Int ?? 0
-            let result_Array: [NSDictionary] = [dic["result"]] as? [NSDictionary] ?? [[:]]
-            let message: String = dic["msg"] as? String ?? ""
-            
-            var results: [KMListingProductsModel] = []
-            for dict1 in result_Array {
-                var id = ""
-                var productName = ""
-                var price = NSNumber(value: 0.0)
-                var maxDeviceNum = 0
-                var levels = ""
-                var platforms = ""
-                var productLineId = 0
-                var paymentModel = 0
-                var cycle = 0
-                var code = ""
-                var cnyPrice = NSNumber(value: 0.0)
-                if let token = dict1["id"] { id = token as! String }
-                if let token = dict1["productName"] { productName = token as! String }
-                if let token = dict1["price"] { price = token as! NSNumber }
-                if let token = dict1["maxDeviceNum"] { maxDeviceNum = token as! Int }
-                if let token = dict1["levels"] { levels = token as! String }
-                if let token = dict1["platforms"] { platforms = token as! String }
-                if let token = dict1["productLineId"] { productLineId = token as! Int }
-                if let token = dict1["paymentModel"] { paymentModel = token as! Int }
-                if let token = dict1["cycle"] { cycle = token as! Int }
-                if let token = dict1["code"] { code = token as! String }
-                if let token = dict1["cnyPrice"] { cnyPrice = token as! NSNumber }
-                let products = KMListingProductsModel(id: id, productName: productName, price: price, maxDeviceNum: maxDeviceNum, levels: levels, platforms: platforms, productLineId: productLineId, paymentModel: paymentModel, cycle: cycle, code: code, cnyPrice: cnyPrice)
-                results.append(products)
-            }
 
-            let result = KMMemberProductResult(code: code, msg: message, listingProducts: results)
-            if code == 200 {
-                complete(true, result)
-            } else {
-                complete(false, result)
+                let result = KMMemberProductResult(code: code, msg: message, listingProducts: results)
+                if code == 200 {
+                    complete(true, result)
+                } else {
+                    complete(false, result)
+                }
             }
+        } else {
+            print("Invalid URL")
+            complete(false, nil)
         }
+        
     }
     
     /**
@@ -979,47 +1006,51 @@ class KMMemberCenterManager: NSObject {
         let urlString = configuration.activityBaseURL() + "/pdf-office-website/web/getBatchProductPrice"
         let params: [String: Any] = ["productId": productId,
                                      "num": NSNumber(value: Int32(num))]
-        KMRequestServer.requestServer.request(urlString: urlString, method: .get, params: params) { requestSerializer in
-            
-        } completion: { [weak self] (task, responseObject, error) in
-            var dic: NSDictionary = [:]
-            if error == nil, let responseObject = responseObject as? NSDictionary {
-                dic = responseObject
-            } else {
-                var info = responseObject
-                if let error = error {
-                    if let data = error.userInfo["com.alamofire.serialization.response.error.data"] as? Data {
-                        info = try? JSONSerialization.jsonObject(with: data, options: .mutableLeaves) as? NSDictionary
+        if let urlNewString = constructURLString(baseURLString: urlString, parameters: params) {
+            KMRequestServer.requestServer.request(urlString: urlNewString, method: .get, params: nil) { requestSerializer in
+                
+            } completion: { [weak self] (task, responseObject, error) in
+                var dic: NSDictionary = [:]
+                if error == nil, let responseObject = responseObject as? NSDictionary {
+                    dic = responseObject
+                } else {
+                    var info = responseObject
+                    if let error = error {
+                        if let data = error.userInfo["com.alamofire.serialization.response.error.data"] as? Data {
+                            info = try? JSONSerialization.jsonObject(with: data, options: .mutableLeaves) as? NSDictionary
+                        }
                     }
+                    dic = (info as? NSDictionary) ?? [:]
                 }
-                dic = (info as? NSDictionary) ?? [:]
-            }
-            let code: Int = dic["code"] as? Int ?? 0
-            let result: NSDictionary = dic["result"] as? NSDictionary ?? [:]
-            let message: String = dic["msg"] as? String ?? ""
-            
-            var productId = ""
-            var totalPrice = ""
-            var price = ""
-            var batchPrice = ""
-            var cnyPrice = ""
-            var cnyBatchPrice = ""
-            var cnyTotalPrice = ""
-            if let token = result["productId"] { productId = token as! String }
-            if let token = result["totalPrice"] { totalPrice = token as! String }
-            if let token = result["price"] { price = token as! String }
-            if let token = result["batchPrice"] { batchPrice = token as! String }
-            if let token = result["cnyPrice"] { cnyPrice = token as! String }
-            if let token = result["cnyBatchPrice"] { cnyBatchPrice = token as! String }
-            if let token = result["cnyTotalPrice"] { cnyTotalPrice = token as! String }
-            let products = KMBatchProductPriceModel(productId: productId, totalPrice: totalPrice, price: price, batchPrice: batchPrice, cnyPrice: cnyPrice, cnyBatchPrice: cnyBatchPrice, cnyTotalPrice: cnyTotalPrice)
+                let code: Int = dic["code"] as? Int ?? 0
+                let result: NSDictionary = dic["result"] as? NSDictionary ?? [:]
+                let message: String = dic["msg"] as? String ?? ""
+                
+                var productId = ""
+                var totalPrice = ""
+                var price = ""
+                var batchPrice = ""
+                var cnyPrice = ""
+                var cnyBatchPrice = ""
+                var cnyTotalPrice = ""
+                if let token = result["productId"] { productId = token as? String ?? productId}
+                if let token = result["totalPrice"] { totalPrice = token as? String ?? totalPrice}
+                if let token = result["price"] { price = token as? String ?? price}
+                if let token = result["batchPrice"] { batchPrice = token as? String ?? batchPrice}
+                if let token = result["cnyPrice"] { cnyPrice = token as? String ?? cnyPrice}
+                if let token = result["cnyBatchPrice"] { cnyBatchPrice = token as? String ?? cnyBatchPrice}
+                if let token = result["cnyTotalPrice"] { cnyTotalPrice = token as? String ?? cnyTotalPrice}
+                let products = KMBatchProductPriceModel(productId: productId, totalPrice: totalPrice, price: price, batchPrice: batchPrice, cnyPrice: cnyPrice, cnyBatchPrice: cnyBatchPrice, cnyTotalPrice: cnyTotalPrice)
 
-            let result1 = KMMemberProductResult(code: code, msg: message, batchProductPrice: products)
-            if code == 200 {
-                complete(true, result1)
-            } else {
-                complete(false, result1)
+                let result1 = KMMemberProductResult(code: code, msg: message, batchProductPrice: products)
+                if code == 200 {
+                    complete(true, result1)
+                } else {
+                    complete(false, result1)
+                }
             }
+        } else {
+            print("Invalid URL")
         }
     }
     
@@ -1040,111 +1071,120 @@ class KMMemberCenterManager: NSObject {
         let params: [String: Any] = ["productId": productId,
                                      "userId": userId,
                                      "code": code]
-        KMRequestServer.requestServer.request(urlString: urlString, method: .get, params: params) { requestSerializer in
-            requestSerializer.setValue("Bearer " + token, forHTTPHeaderField: "Authorization")
-        } completion: { [weak self] (task, responseObject, error) in
-            var dic: NSDictionary = [:]
-            if error == nil, let responseObject = responseObject as? NSDictionary {
-                dic = responseObject
-            } else {
-                var info = responseObject
-                if let error = error {
-                    if let data = error.userInfo["com.alamofire.serialization.response.error.data"] as? Data {
-                        info = try? JSONSerialization.jsonObject(with: data, options: .mutableLeaves) as? NSDictionary
+        if let urlNewString = constructURLString(baseURLString: urlString, parameters: params) {
+            KMRequestServer.requestServer.request(urlString: urlNewString, method: .get, params: nil) { requestSerializer in
+                requestSerializer.setValue("Bearer " + token, forHTTPHeaderField: "Authorization")
+            } completion: { [weak self] (task, responseObject, error) in
+                var dic: NSDictionary = [:]
+                if error == nil, let responseObject = responseObject as? NSDictionary {
+                    dic = responseObject
+                } else {
+                    var info = responseObject
+                    if let error = error {
+                        if let data = error.userInfo["com.alamofire.serialization.response.error.data"] as? Data {
+                            info = try? JSONSerialization.jsonObject(with: data, options: .mutableLeaves) as? NSDictionary
+                        }
                     }
+                    dic = (info as? NSDictionary) ?? [:]
                 }
-                dic = (info as? NSDictionary) ?? [:]
-            }
-            let code: Int = dic["code"] as? Int ?? 0
-            let result: NSDictionary = dic["result"] as? NSDictionary ?? [:]
-            let message: String = dic["msg"] as? String ?? ""
-            
-            var id = ""
-            var productName = ""
-            var price = ""
-            var maxDeviceNum = 0
-            var displayPrice = ""
-            var levels = ""
-            var platforms = ""
-            var productLineId = 0
-            var paymentModel = 0
-            var cycle = 0
-            var cnyPrice = ""
-            var displayCnyPrice = ""
-            if let token = result["id"] { id = token as! String }
-            if let token = result["productName"] { productName = token as! String }
-            if let token = result["price"] { price = token as! String }
-            if let token = result["maxDeviceNum"] { maxDeviceNum = token as! Int }
-            if let token = result["displayPrice"] { displayPrice = token as! String }
-            if let token = result["levels"] { levels = token as! String }
-            if let token = result["platforms"] { platforms = token as! String }
-            if let token = result["productLineId"] { productLineId = token as! Int }
-            if let token = result["paymentModel"] { paymentModel = token as! Int }
-            if let token = result["cycle"] { cycle = token as! Int }
-            if let token = result["cnyPrice"] { cnyPrice = token as! String }
-            if let token = result["displayCnyPrice"] { displayCnyPrice = token as! String }
+                let code: Int = dic["code"] as? Int ?? 0
+                let result: NSDictionary = dic["result"] as? NSDictionary ?? [:]
+                let message: String = dic["msg"] as? String ?? ""
+                
+                var id = ""
+                var productName = ""
+                var price = ""
+                var maxDeviceNum = 0
+                var displayPrice = ""
+                var levels = ""
+                var platforms = ""
+                var productLineId = 0
+                var paymentModel = 0
+                var cycle = 0
+                var cnyPrice = ""
+                var displayCnyPrice = ""
+                if let token = result["id"] { id = token as? String ?? id}
+                if let token = result["productName"] { productName = token as? String ?? productName}
+                if let token = result["price"] { price = token as? String ?? price}
+                if let token = result["maxDeviceNum"] { maxDeviceNum = token as? Int ?? maxDeviceNum}
+                if let token = result["displayPrice"] { displayPrice = token as? String ?? displayPrice}
+                if let token = result["levels"] { levels = token as? String ?? levels}
+                if let token = result["platforms"] { platforms = token as? String ?? platforms}
+                if let token = result["productLineId"] { productLineId = token as? Int ?? productLineId}
+                if let token = result["paymentModel"] { paymentModel = token as? Int ?? paymentModel}
+                if let token = result["cycle"] { cycle = token as? Int ?? cycle}
+                if let token = result["cnyPrice"] { cnyPrice = token as? String ?? cnyPrice}
+                if let token = result["displayCnyPrice"] { displayCnyPrice = token as? String ?? displayCnyPrice}
 
-            let products = KMCheckCouponModel(id: id, productName: productName, price: price, maxDeviceNum: maxDeviceNum, displayPrice: displayPrice, levels: levels, platforms: platforms, productLineId: productLineId, paymentModel: paymentModel, cycle: cycle, cnyPrice: cnyPrice, displayCnyPrice: displayCnyPrice)
-            let result1 = KMMemberProductResult(code: code, msg: message, checkCoupon: products)
-            if code == 200 {
-                complete(true, result1)
-            } else {
-                complete(false, result1)
+                let products = KMCheckCouponModel(id: id, productName: productName, price: price, maxDeviceNum: maxDeviceNum, displayPrice: displayPrice, levels: levels, platforms: platforms, productLineId: productLineId, paymentModel: paymentModel, cycle: cycle, cnyPrice: cnyPrice, displayCnyPrice: displayCnyPrice)
+                let result1 = KMMemberProductResult(code: code, msg: message, checkCoupon: products)
+                if code == 200 {
+                    complete(true, result1)
+                } else {
+                    complete(false, result1)
+                }
             }
+        } else {
+            print("Invalid URL")
+            complete(false, nil)
         }
     }
     
     /**
-     @abstract              获取批量阶段购买价格
-     @param productId 购买的产品id
-     @param isEducation 是否教育优惠
+     @abstract              检查邮箱教育优惠资格
+     @param email 邮箱
      @param complete 回调
      */
     func checkEducation(email: String, _ complete: @escaping KMMemberProductComplete) {
         
         let urlString = configuration.activityBaseURL() + "/pdf-office-website/web/checkEducation"
         let params: [String: Any] = ["email": email]
-        KMRequestServer.requestServer.request(urlString: urlString, method: .get, params: params) { requestSerializer in
-            
-        } completion: { [weak self] (task, responseObject, error) in
-            var dic: NSDictionary = [:]
-            if error == nil, let responseObject = responseObject as? NSDictionary {
-                dic = responseObject
-            } else {
-                var info = responseObject
-                if let error = error {
-                    if let data = error.userInfo["com.alamofire.serialization.response.error.data"] as? Data {
-                        info = try? JSONSerialization.jsonObject(with: data, options: .mutableLeaves) as? NSDictionary
+        if let urlNewString = constructURLString(baseURLString: urlString, parameters: params) {
+            KMRequestServer.requestServer.request(urlString: urlNewString, method: .get, params: nil) { requestSerializer in
+                
+            } completion: { [weak self] (task, responseObject, error) in
+                var dic: NSDictionary = [:]
+                if error == nil, let responseObject = responseObject as? NSDictionary {
+                    dic = responseObject
+                } else {
+                    var info = responseObject
+                    if let error = error {
+                        if let data = error.userInfo["com.alamofire.serialization.response.error.data"] as? Data {
+                            info = try? JSONSerialization.jsonObject(with: data, options: .mutableLeaves) as? NSDictionary
+                        }
                     }
+                    dic = (info as? NSDictionary) ?? [:]
                 }
-                dic = (info as? NSDictionary) ?? [:]
-            }
-            let code: Int = dic["code"] as? Int ?? 0
-            let result: NSDictionary = dic["result"] as? NSDictionary ?? [:]
-            let message: String = dic["msg"] as? String ?? ""
-            
-            var productId = ""
-            var totalPrice = ""
-            var price = ""
-            var batchPrice = ""
-            var cnyPrice = ""
-            var cnyBatchPrice = ""
-            var cnyTotalPrice = ""
-            if let token = result["productId"] { productId = token as! String }
-            if let token = result["totalPrice"] { totalPrice = token as! String }
-            if let token = result["price"] { price = token as! String }
-            if let token = result["batchPrice"] { batchPrice = token as! String }
-            if let token = result["cnyPrice"] { cnyPrice = token as! String }
-            if let token = result["cnyBatchPrice"] { cnyBatchPrice = token as! String }
-            if let token = result["cnyTotalPrice"] { cnyTotalPrice = token as! String }
-            let products = KMBatchProductPriceModel(productId: productId, totalPrice: totalPrice, price: price, batchPrice: batchPrice, cnyPrice: cnyPrice, cnyBatchPrice: cnyBatchPrice, cnyTotalPrice: cnyTotalPrice)
+                let code: Int = dic["code"] as? Int ?? 0
+                let result: NSDictionary = dic["result"] as? NSDictionary ?? [:]
+                let message: String = dic["msg"] as? String ?? ""
+                
+                var productId = ""
+                var totalPrice = ""
+                var price = ""
+                var batchPrice = ""
+                var cnyPrice = ""
+                var cnyBatchPrice = ""
+                var cnyTotalPrice = ""
+                if let token = result["productId"] { productId = token as? String ?? productId}
+                if let token = result["totalPrice"] { totalPrice = token as? String ?? totalPrice}
+                if let token = result["price"] { price = token as? String ?? price}
+                if let token = result["batchPrice"] { batchPrice = token as? String ?? batchPrice}
+                if let token = result["cnyPrice"] { cnyPrice = token as? String ?? cnyPrice}
+                if let token = result["cnyBatchPrice"] { cnyBatchPrice = token as? String ?? cnyBatchPrice}
+                if let token = result["cnyTotalPrice"] { cnyTotalPrice = token as? String ?? cnyTotalPrice}
+                let products = KMBatchProductPriceModel(productId: productId, totalPrice: totalPrice, price: price, batchPrice: batchPrice, cnyPrice: cnyPrice, cnyBatchPrice: cnyBatchPrice, cnyTotalPrice: cnyTotalPrice)
 
-            let result1 = KMMemberProductResult(code: code, msg: message, batchProductPrice: products)
-            if code == 200 {
-                complete(true, result1)
-            } else {
-                complete(false, result1)
+                let result1 = KMMemberProductResult(code: code, msg: message, batchProductPrice: products)
+                if code == 200 {
+                    complete(true, result1)
+                } else {
+                    complete(false, result1)
+                }
             }
+        } else {
+            print("Invalid URL")
+            complete(false, nil)
         }
     }
     
@@ -1164,27 +1204,33 @@ class KMMemberCenterManager: NSObject {
             return
         }
         let urlString = configuration.activityBaseURL() + "/pdf-office-website/order/getStateByOrderId"
-        KMRequestServer.requestServer.request(urlString: urlString, method: .get, params: nil) { requestSerializer in
-            requestSerializer.setValue("Bearer " + token, forHTTPHeaderField: "Authorization")
-        } completion: { [weak self] (task, responseObject, error) in
-            var dic: NSDictionary = [:]
-            if error == nil, let responseObject = responseObject as? NSDictionary {
-                dic = responseObject
-            } else {
-                var info = responseObject
-                if let error = error {
-                    if let data = error.userInfo["com.alamofire.serialization.response.error.data"] as? Data {
-                        info = try? JSONSerialization.jsonObject(with: data, options: .mutableLeaves) as? NSDictionary
+        let params: [String: Any] = ["orderId": orderId]
+        if let urlNewString = constructURLString(baseURLString: urlString, parameters: params) {
+            KMRequestServer.requestServer.request(urlString: urlNewString, method: .get, params: nil) { requestSerializer in
+                requestSerializer.setValue("Bearer " + token, forHTTPHeaderField: "Authorization")
+            } completion: { [weak self] (task, responseObject, error) in
+                var dic: NSDictionary = [:]
+                if error == nil, let responseObject = responseObject as? NSDictionary {
+                    dic = responseObject
+                } else {
+                    var info = responseObject
+                    if let error = error {
+                        if let data = error.userInfo["com.alamofire.serialization.response.error.data"] as? Data {
+                            info = try? JSONSerialization.jsonObject(with: data, options: .mutableLeaves) as? NSDictionary
+                        }
                     }
+                    dic = (info as? NSDictionary) ?? [:]
+                }
+                let code: Int = dic["code"] as? Int ?? 0
+                if code == 200 {
+                    complete(true, dic)
+                } else {
+                    complete(false, dic)
                 }
-                dic = (info as? NSDictionary) ?? [:]
-            }
-            let code: Int = dic["code"] as? Int ?? 0
-            if code == 200 {
-                complete(true, dic)
-            } else {
-                complete(false, dic)
             }
+        } else {
+            print("Invalid URL")
+            complete(false, nil)
         }
     }
     
@@ -1234,9 +1280,9 @@ class KMMemberCenterManager: NSObject {
             var orderId = ""
             var payHref = ""
             if code == 200 {
-                if let token = result["thirdOrderNo"] { thirdOrderNo = token as! String }
-                if let token = result["orderId"] { orderId = token as! String }
-                if let token = result["payHref"] { payHref = token as! String }
+                if let token = result["thirdOrderNo"] { thirdOrderNo = token as? String ?? thirdOrderNo}
+                if let token = result["orderId"] { orderId = token as? String ?? orderId}
+                if let token = result["payHref"] { payHref = token as? String ?? payHref}
                 let products = KMCreateOrderModel(thirdOrderNo: thirdOrderNo, orderId: orderId, payHref: payHref)
                 let result1 = KMMemberProductResult(code: code, msg: message, createOrder: products)
                 complete(true, result1)
@@ -1263,7 +1309,7 @@ class KMMemberCenterManager: NSObject {
             complete(false, nil)
             return
         }
-        let urlString = configuration.activityBaseURL() + "/pdf-office-website/order/createOrder"
+        let urlString = configuration.activityBaseURL() + "/pdf-office-website/order/createSubscription"
         let params: [String: Any] = ["productId": productId,
                                      "paymentMethod": paymentMethod,
                                      "price": price,
@@ -1293,9 +1339,9 @@ class KMMemberCenterManager: NSObject {
             var orderId = ""
             var payHref = ""
             if code == 200 {
-                if let token = result["thirdOrderNo"] { thirdOrderNo = token as! String }
-                if let token = result["orderId"] { orderId = token as! String }
-                if let token = result["payHref"] { payHref = token as! String }
+                if let token = result["thirdOrderNo"] { thirdOrderNo = token as? String ?? thirdOrderNo}
+                if let token = result["orderId"] { orderId = token as? String ?? orderId}
+                if let token = result["payHref"] { payHref = token as? String ?? payHref}
                 let products = KMCreateOrderModel(thirdOrderNo: thirdOrderNo, orderId: orderId, payHref: payHref)
                 let result1 = KMMemberProductResult(code: code, msg: message, createOrder: products)
                 complete(true, result1)
@@ -1311,7 +1357,7 @@ class KMMemberCenterManager: NSObject {
      @param orderStatus               0全部1待支付
      @param complete 回调
      */
-    func getOrderListByStatus(orderStatus: Int, _ complete: @escaping KMMemberProductComplete) {
+    func getOrderListByStatus(orderStatus: Int, _ complete: @escaping KMMemberRequestInfoComplete) {
         let token: String = KMMemberInfo.shared.access_token
         if token == "" {
             complete(false, nil)
@@ -1319,39 +1365,45 @@ class KMMemberCenterManager: NSObject {
         }
         let urlString = configuration.activityBaseURL() + "/pdf-office-website/order/getOrderListByStatus"
         let params: [String: Any] = ["orderStatus": orderStatus]
-        KMRequestServer.requestServer.request(urlString: urlString, method: .get, params: params) { requestSerializer in
-            requestSerializer.setValue("Bearer " + token, forHTTPHeaderField: "Authorization")
-        } completion: { [weak self] (task, responseObject, error) in
-            var dic: NSDictionary = [:]
-            if error == nil, let responseObject = responseObject as? NSDictionary {
-                dic = responseObject
-            } else {
-                var info = responseObject
-                if let error = error {
-                    if let data = error.userInfo["com.alamofire.serialization.response.error.data"] as? Data {
-                        info = try? JSONSerialization.jsonObject(with: data, options: .mutableLeaves) as? NSDictionary
+        if let urlNewString = constructURLString(baseURLString: urlString, parameters: params) {
+            KMRequestServer.requestServer.request(urlString: urlNewString, method: .get, params: nil) { requestSerializer in
+                requestSerializer.setValue("Bearer " + token, forHTTPHeaderField: "Authorization")
+            } completion: { [weak self] (task, responseObject, error) in
+                var dic: NSDictionary = [:]
+                if error == nil, let responseObject = responseObject as? NSDictionary {
+                    dic = responseObject
+                } else {
+                    var info = responseObject
+                    if let error = error {
+                        if let data = error.userInfo["com.alamofire.serialization.response.error.data"] as? Data {
+                            info = try? JSONSerialization.jsonObject(with: data, options: .mutableLeaves) as? NSDictionary
+                        }
                     }
+                    dic = (info as? NSDictionary) ?? [:]
                 }
-                dic = (info as? NSDictionary) ?? [:]
+                let code: Int = dic["code"] as? Int ?? 0
+                if code == 200 {
+                    complete(true, dic)
+                } else {
+                    complete(false, dic)
+                }
+    //            var thirdOrderNo = ""
+    //            var orderId = ""
+    //            var payHref = ""
+    //            if code == 200 {
+    //                if let token = result["thirdOrderNo"] { thirdOrderNo = token as! String }
+    //                if let token = result["orderId"] { orderId = token as! String }
+    //                if let token = result["payHref"] { payHref = token as! String }
+    //                let products = KMCreateOrderModel(thirdOrderNo: thirdOrderNo, orderId: orderId, payHref: payHref)
+    //                let result1 = KMMemberProductResult(code: code, msg: message, createOrder: products)
+    //                complete(true, result1)
+    //            } else {
+    //                let result1 = KMMemberProductResult(code: code, msg: message, createOrder: KMCreateOrderModel(thirdOrderNo: thirdOrderNo, orderId: orderId, payHref: payHref))
+    //                complete(false, result1)
+    //            }
             }
-            let code: Int = dic["code"] as? Int ?? 0
-            let result: NSDictionary = dic["result"] as? NSDictionary ?? [:]
-            let message: String = dic["msg"] as? String ?? ""
-            
-//            var thirdOrderNo = ""
-//            var orderId = ""
-//            var payHref = ""
-//            if code == 200 {
-//                if let token = result["thirdOrderNo"] { thirdOrderNo = token as! String }
-//                if let token = result["orderId"] { orderId = token as! String }
-//                if let token = result["payHref"] { payHref = token as! String }
-//                let products = KMCreateOrderModel(thirdOrderNo: thirdOrderNo, orderId: orderId, payHref: payHref)
-//                let result1 = KMMemberProductResult(code: code, msg: message, createOrder: products)
-//                complete(true, result1)
-//            } else {
-//                let result1 = KMMemberProductResult(code: code, msg: message, createOrder: KMCreateOrderModel(thirdOrderNo: thirdOrderNo, orderId: orderId, payHref: payHref))
-//                complete(false, result1)
-//            }
+        } else {
+            complete(false, nil)
         }
     }
     
@@ -1367,28 +1419,33 @@ class KMMemberCenterManager: NSObject {
             return
         }
         let urlString = configuration.activityBaseURL() + "/pdf-office-website/order/closeOrder"
-        KMRequestServer.requestServer.request(urlString: urlString, method: .post, params: nil) { requestSerializer in
-            requestSerializer.setValue("Bearer " + token, forHTTPHeaderField: "Authorization")
-        } completion: { [weak self] (task, responseObject, error) in
-            var dic: NSDictionary = [:]
-            if error == nil, let responseObject = responseObject as? NSDictionary {
-                dic = responseObject
-            } else {
-                var info = responseObject
-                if let error = error {
-                    if let data = error.userInfo["com.alamofire.serialization.response.error.data"] as? Data {
-                        info = try? JSONSerialization.jsonObject(with: data, options: .mutableLeaves) as? NSDictionary
+        let params: [String: Any] = ["orderId": orderId]
+        if let urlNewString = constructURLString(baseURLString: urlString, parameters: params) {
+            KMRequestServer.requestServer.request(urlString: urlNewString, method: .post, params: nil) { requestSerializer in
+                requestSerializer.setValue("Bearer " + token, forHTTPHeaderField: "Authorization")
+            } completion: { [weak self] (task, responseObject, error) in
+                var dic: NSDictionary = [:]
+                if error == nil, let responseObject = responseObject as? NSDictionary {
+                    dic = responseObject
+                } else {
+                    var info = responseObject
+                    if let error = error {
+                        if let data = error.userInfo["com.alamofire.serialization.response.error.data"] as? Data {
+                            info = try? JSONSerialization.jsonObject(with: data, options: .mutableLeaves) as? NSDictionary
+                        }
                     }
+                    dic = (info as? NSDictionary) ?? [:]
                 }
-                dic = (info as? NSDictionary) ?? [:]
-            }
-            let code: Int = dic["code"] as? Int ?? 0
+                let code: Int = dic["code"] as? Int ?? 0
 
-            if code == 200 {
-                complete(true, dic)
-            } else {
-                complete(false, dic)
+                if code == 200 {
+                    complete(true, dic)
+                } else {
+                    complete(false, dic)
+                }
             }
+        } else {
+            complete(false, nil)
         }
     }
     
@@ -1396,21 +1453,23 @@ class KMMemberCenterManager: NSObject {
     
     /**
      @abstract              APPstore 权益校验
-     @param orderStatus               0全部1待支付
+     @param applePayProductId
+     @param transactionId
+     @param productCode
      @param complete 回调
      */
-    func appStoreEquityVerification(orderStatus: Int, _ complete: @escaping KMMemberProductComplete) {
+    func appStoreEquityVerification(applePayProductId: String, transactionId: String, productCode: String, _ complete: @escaping KMMemberProductComplete) {
         let token: String = KMMemberInfo.shared.access_token
         if token == "" {
             complete(false, nil)
             return
         }
         let urlString = configuration.activityBaseURL() + "/member-system-website/applePay/appStoreEquityVerification"
-        let params: [String: Any] = ["userId": "",
-                                     "applePayProductId": "",
-                                     "transactionId": "",
-                                     "productCode": ""]
-        KMRequestServer.requestServer.request(urlString: urlString, method: .get, params: params) { requestSerializer in
+        let params: [String: Any] = ["userId": KMMemberInfo.shared.userID,
+                                     "applePayProductId": applePayProductId,
+                                     "transactionId": transactionId,
+                                     "productCode": productCode]
+        KMRequestServer.requestServer.request(urlString: urlString, method: .post, params: params) { requestSerializer in
             requestSerializer.setValue("Bearer " + token, forHTTPHeaderField: "Authorization")
         } completion: { [weak self] (task, responseObject, error) in
             var dic: NSDictionary = [:]

+ 4 - 2
PDF Office/PDF Master/MemberCenter/Model/KMMemberInfo.swift

@@ -250,11 +250,12 @@ import Cocoa
             }
 #else
     // AppStore 免费版本
-            if IAPProductsManager.default().allAccessPack6months_lite.isSubscribed == true || IAPProductsManager.default().allAccessPackNew6months_lite.isSubscribed == true ||
+            if IAPProductsManager.default().allAccessPack6months_lite.isSubscribed == true || 
+                IAPProductsManager.default().allAccessPackNew6months_lite.isSubscribed == true ||
                 IAPProductsManager.default().allAccessPack12months_lite.isSubscribed == true ||
                 IAPProductsManager.default().allAccessProduct.isSubscribed == true {
                 // 有旧买断
-                if KMMemberInfo.shared.canTrail {
+                if KMMemberInfo.shared.canTrail && KMMemberInfo.shared.vip_levels == "1" {
                     return .lite_type9
                 }
                 if KMMemberInfo.shared.vip_status == 3 {
@@ -362,6 +363,7 @@ import Cocoa
             if KMMemberInfo.shared.isLogin {
                 
             }
+            return false
 #else
     // AppStore 免费版本
             if KMMemberInfo.shared.isLogin {

+ 3 - 0
PDF Office/PDF Master/MemberCenter/ViewController/KMUserInfoViewController.swift

@@ -539,10 +539,13 @@ class KMUserInfoViewController: NSViewController {
                 buyNow2ImageView.isHidden = false
                 arrow1ImageView.image = NSImage(named: "BuyNewArrowImage1")
                 arrow2ImageView.image = NSImage(named: "BuyNewArrowImage1")
+#if !VERSION_DMG
                 if IAPProductsManager.default().fourDevicesAllAccessPackNew12months_lite.isTrialPeriod == true {
                     buyNow2Box.isHidden = true
                     buyNow1BoxLeftConst.constant = (CGRectGetWidth(view.bounds) - CGRectGetWidth(buyNow1Box.frame))/2
                 }
+#else
+#endif
             } else if KMMemberInfo.shared.userScenarioType == .lite_type3 ||
                         KMMemberInfo.shared.userScenarioType == .lite_type11 ||
                         KMMemberInfo.shared.userScenarioType == .lite_type9 {

+ 118 - 11
PDF Office/PDF Master/MemberCenter/ViewModel/KMProductModel.swift

@@ -107,28 +107,32 @@ class KMProductModel: ObservableObject {
     }
     
     /**
-     @abstract 获取服务器架上所有商品 (得到的价格是原始价格)
+     @abstract 获取DMG服务器架上所有商品 (得到的价格是原始价格)
      @param
      */
     func getDMGProductDatas() -> Void {
         checkConnectionAvailable()
-        KMMemberCenterManager.manager.getListingProducts(isEducation: 0) { [weak self] success, result in
-            guard let productsArrays : KMMemberProductResult = result else { return }
-            self?.dmgProductDatas = productsArrays
-        }
+//        KMMemberCenterManager.manager.getListingProducts(isEducation: 0) { [weak self] success, result in
+//            guard let productsArrays : KMMemberProductResult = result else { return }
+//            self?.dmgProductDatas = productsArrays
+//        }
         
         if KMMemberInfo.shared.isLogin {
-//            getDMGProductPriceInfosForMember(productId: "SP2024102100002", isEducation: 0) { [weak self] success, result in
+//            getDMGProductPriceInfosForMember(productId: "SP2024102300004", isEducation: 0) { [weak self] success, result in
 //                
 //                
 //            }
             
-//            getDMGBatchProductPriceInfosForMember(productId: "SP2024102100002", num: 10) { [weak self] success, result in
+//            getDMGBatchProductPriceInfosForMember(productId: "SP2024102300004", num: 10) { [weak self] success, result in
+//                
 //                
+//            }
+            
+//            getDMGProductListInfosForMember(orderStatus: 0) { [weak self] success, result in
 //                
 //            }
             
-//            creatOrder(productId: "SP2024102300003", paymentMethod: 0, price: NSNumber(value: 119.99), discountFlag: 0, couponCode: "", num: 1) { [weak self] success, result in
+//            creatOrder(productId: "SP2024102300004", paymentMethod: 0, price: NSNumber(value: 119.99), discountFlag: 0, couponCode: "", num: 1) { [weak self] success, result in
 //
 //            }
             
@@ -212,15 +216,15 @@ class KMProductModel: ObservableObject {
      @param orderStatus               0全部1待支付
      @param complete 回调
      */
-    func getDMGProductListInfosForMember(orderStatus: Int, _ complete: @escaping KMMemberProductComplete) {
+    func getDMGProductListInfosForMember(orderStatus: Int, _ complete: @escaping KMMemberRequestInfoComplete) {
         checkConnectionAvailable()
         KMMemberCenterManager.manager.getOrderListByStatus(orderStatus: orderStatus) { [weak self] success, result in
             if success {
-                guard let productsArrays : KMMemberProductResult = result else {
+                guard let productsInfos : NSDictionary = result else {
                     complete(false, result)
                     return
                 }
-                complete(true, productsArrays)
+                complete(true, productsInfos)
             } else {
                 complete(false, result)
             }
@@ -467,6 +471,109 @@ class KMProductModel: ObservableObject {
         }
     }
     
+    func appStoreEquityVerification(_ notification: Notification,_ complete: @escaping KMMemberProductComplete) -> Void {
+        if let userInfo = notification.userInfo,
+           let transactionId = userInfo["transactionId"] as? String,
+           let productId = userInfo["productId"] as? String {
+            print("Transaction ID: \(transactionId)")
+            print("product ID: \(productId)")
+            
+            var productCode = ""
+            var isSubscribed = false
+#if VERSION_FREE
+#if VERSION_DMG
+    // DMG
+#else
+    // AppStore 免费版本
+            if productId == "com.pdfreaderpro.mac_free.member.all_access_pack_advanced_6months.001" {
+                productCode = "advanced-annual-subscription-six-month"
+                if IAPProductsManager.default().fourDevicesAllAccessPackNew6Months_lite.isSubscribed {
+                    isSubscribed = true
+                }
+            } else if productId == "com.pdfreaderpro.mac_free.member.all_access_pack_advanced_annual.001" {
+                productCode = "advanced-annual-subscription"
+                if IAPProductsManager.default().fourDevicesAllAccessPackNew12months_lite.isSubscribed {
+                    isSubscribed = true
+                }
+            } else if productId == "com.pdfreaderpro.mac_free.member.all_access_pack_new_6months.001" {
+                productCode = "advanced-annual-subscription-six-month"
+                if IAPProductsManager.default().allAccessPackNew6months_lite.isSubscribed {
+                    isSubscribed = true
+                }
+            } else if productId == "com.pdfreaderpro.mac_free.member.all_access_pack_12months.001" {
+                productCode = "advanced-annual-subscription"
+                if IAPProductsManager.default().allAccessPack12months_lite.isSubscribed {
+                    isSubscribed = true
+                }
+            } else if productId == "com.pdfreaderpro.mac_free.member.all_access_pack_6months.001" {
+                productCode = "advanced-annual-subscription-six-month"
+                if IAPProductsManager.default().allAccessPack6months_lite.isSubscribed {
+                    isSubscribed = true
+                }
+            } else if productId == "com.pdfreaderpro.mac_free.member.ai_pack_1_month" {
+                productCode = "ai-subscription-month"
+                if IAPProductsManager.default().aiAllAccessPack1month_lite.isSubscribed {
+                    isSubscribed = true
+                }
+            } else if productId == "com.pdfreaderpro.mac_free.member.ai_pack_12_month" {
+                productCode = "ai-subscription-year-trail"
+                if IAPProductsManager.default().aiAllAccessPack12month_lite.isSubscribed {
+                    isSubscribed = true
+                }
+            } else if productId == "com.pdfreaderpro.mac_free.member.all_access_pack_advanced_permanent_license.001" {
+                productCode = "advanced-permanent"
+                if IAPProductsManager.default().allAccessPackPermanent_lite.isSubscribed {
+                    isSubscribed = true
+                }
+            } else if productId == "com.pdfreaderpro.mac_free.member.advanced_add_devices_all_access_pack_advanced_annual.001" {
+                productCode = "advanced-annual-subscription-single-upgrade"
+                if IAPProductsManager.default().advancedAddDevicesAllAccessPack12months_lite.isSubscribed {
+                    isSubscribed = true
+                }
+            } else if productId == "com.pdfreaderpro.mac_free.member.advanced_add_2_devices_all_access_pack_advanced_annual.001" {
+                productCode = "advanced-annual-subscription-multi-upgrade"
+                if IAPProductsManager.default().advancedAdd2DevicesAllAccessPack12months_lite.isSubscribed {
+                    isSubscribed = true
+                }
+            }
+#endif
+#else
+    // AppStore 付费版
+            if productId == "com.pdfreaderpro.mac.ai_pack_1_month" {
+                productCode = "ai-subscription-month"
+                if IAPProductsManager.default().aiAllAccessPack1month_pro.isSubscribed {
+                    isSubscribed = true
+                }
+            } else if productId == "com.pdfreaderpro.mac.ai_pack_12_month" {
+                productCode = "ai-subscription-year-trail"
+                if IAPProductsManager.default().aiAllAccessPack12month_pro.isSubscribed {
+                    isSubscribed = true
+                }
+            } else if productId == "com.pdfreaderpro.mac.pdf_to_office_pack_permanent_license.001" {
+                productCode = "advanced-permanent-mac-upgrade"
+                if IAPProductsManager.default().pdfToOfficePackPermanent_pro.isSubscribed {
+                    isSubscribed = true
+                }
+            } else if productId == "com.pdfreaderpro.mac.all_access_pack_advanced_annual.001" {
+                productCode = "advanced-permanent-mac-upgrade"
+                if IAPProductsManager.default().fourDevicesAllAccessPack12months_pro.isSubscribed {
+                    isSubscribed = true
+                }
+            }
+#endif
+            KMMemberCenterManager.manager.appStoreEquityVerification(applePayProductId: productId, transactionId: transactionId, productCode: productCode) { success, result in
+                if success {
+                    complete(true, result)
+                } else {
+                    complete(false, result)
+                }
+
+            }
+        } else {
+            print("Transaction ID not found in notification.")
+        }
+    }
+    
     var isCancelAutoRenew: Bool {
         return IAPProductsManager.default().isCancelAutoRenew()
     }

+ 15 - 10
PDF Office/PDF Master/MemberCenter/WindowsController/KMProductCompareWC.swift

@@ -216,8 +216,6 @@ class KMProductCompareWC: NSWindowController {
         } else {
             model.getCurrentComparisonTableType()
         }
-        languageLocalized()
-        initializeUI()
 
         value1InfoLabel.stringValue = NSLocalizedString("6-Month Plan", comment: "")
         value1InfoLabel.font = NSFont.UbuntuMediumFontWithSize(16)
@@ -306,6 +304,8 @@ class KMProductCompareWC: NSWindowController {
 
     @objc override func showWindow(_ sender: Any?) {
         super.showWindow(sender)
+        languageLocalized()
+        initializeUI()
         reloadData()
         if model.isShowSale {
             showDiscountToSaveWindow()
@@ -326,17 +326,17 @@ class KMProductCompareWC: NSWindowController {
         oneYearProLabel.stringValue = NSLocalizedString("1-year Plan", comment: "")
 
         freeInfoLabel.stringValue = NSLocalizedString("Free", comment: "")
-        standardPlanInfoLabel.stringValue = NSLocalizedString("PDF Reader Pro Standard Annual Plan", comment: "")
-        standardPlanPurchaseSubLabel.stringValue = NSLocalizedString("Auto-renewal | Billed yearly", comment: "")
-        standardPlanPurchaseSubLabel2.stringValue = NSLocalizedString("(Tax Incl.)", comment: "")
+        standardPlanInfoLabel.stringValue = NSLocalizedString("PDF Reader Pro Standard - Annual Plan", tableName: "MemberCenterLocalizable", comment: "")
+        standardPlanPurchaseSubLabel.stringValue = NSLocalizedString("Auto-renewal | Billed yearly", tableName: "MemberCenterLocalizable", comment: "")
+        standardPlanPurchaseSubLabel2.stringValue = NSLocalizedString("(Tax Incl.)",tableName: "MemberCenterLocalizable", comment: "")
         
-        advancedPlanInfoLabel.stringValue = NSLocalizedString("PDF Reader Pro Advanced Annual Plan", comment: "")
-        advancedPlanPurchaseSubLabel.stringValue = NSLocalizedString("Auto-renewal | Billed yearly", comment: "")
-        advancedPlanPurchaseSubLabel2.stringValue = NSLocalizedString("(Tax Incl.)", comment: "")
+        advancedPlanInfoLabel.stringValue = NSLocalizedString("PDF Reader Pro Advanced - Annual Plan", tableName: "MemberCenterLocalizable", comment: "")
+        advancedPlanPurchaseSubLabel.stringValue = NSLocalizedString("Auto-renewal | Billed yearly", tableName: "MemberCenterLocalizable", comment: "")
+        advancedPlanPurchaseSubLabel2.stringValue = NSLocalizedString("(Tax Incl.)",tableName: "MemberCenterLocalizable", comment: "")
 
-        permanentInfoLabel.stringValue = NSLocalizedString("PDF Reader Pro Permanent", comment: "")
+        permanentInfoLabel.stringValue = NSLocalizedString("PDF Reader Pro Permanent", tableName: "MemberCenterLocalizable", comment: "")
         permanentPurchaseSubLabel.stringValue = NSLocalizedString("one-time purchase", comment: "")
-        permanentPurchaseSubLabel2.stringValue = NSLocalizedString("(Tax Incl.)", comment: "")
+        permanentPurchaseSubLabel2.stringValue = NSLocalizedString("(Tax Incl.)",tableName: "MemberCenterLocalizable", comment: "")
         
         standardPlanPurchaseLbl.stringValue = NSLocalizedString("Subscribe", comment: "")
         if KMMemberInfo.shared.userScenarioType == .lite_type3 ||
@@ -1039,6 +1039,11 @@ class KMProductCompareWC: NSWindowController {
     @objc func IAPProductPurchasedNotification(_ notification: Notification) {
         removeWaitingView(from: window?.contentView ?? NSView())
         reloadData()
+        
+        model.appStoreEquityVerification(notification) { success, msg in
+            KMUserInfoVCModel().refreshUserInfo { success, msg in
+            }
+        }
 
         if IAPProductsManager.default().fourDevicesAllAccessPackNew6Months_lite.isSubscribed {
             if kEventTag == 1 {