Browse Source

【内嵌支付】修复定时器逻辑

wanjun 6 months ago
parent
commit
0df97ee873

+ 8 - 1
PDF Office/PDF Master/Class/Purchase/DMG/KMEmbeddedPaymentPopWC.swift

@@ -38,6 +38,13 @@ class KMEmbeddedPaymentPopWC: NSWindowController {
                 webView.load(request)
             }
         }
+        
+        self.window?.delegate = self;
+    }
+}
+
+extension KMEmbeddedPaymentPopWC: NSWindowDelegate {
+    func windowWillClose(_ notification: Notification) {
+        KMEmbeddedPaymentPopWC.currentWindowController = nil
     }
-    
 }

+ 39 - 719
PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseEmbeddedWindowController.swift

@@ -107,10 +107,8 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
     private var pdfCount: Int = 1
     private var pdfOriginalPrice: Float = 79.99
     private var pdfDiscountPrice: Float = 59.99
-    private var aiAddOnCount: Int = 1
     private var aiAddOnOriginalPrice: Float = 14.99
     private var aiAddOnDiscountPrice: Float = 14.99
-    private var extendedCount: Int = 1
     private var extendedOriginalPrice: Float = 39.99
     private var extendedDiscountPrice: Float = 79.99
     private var listPrice: Float = 79.99
@@ -290,11 +288,8 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
             discountPriceLabel3.font = NSFont.SFProTextRegularFont(9.0)
         }
         removeButton1.isEnabled = false
-        removeButton2.isEnabled = false
-        removeButton3.isEnabled = false
         amountTextField1.delegate = self
         amountTextField2.delegate = self
-        amountTextField3.delegate = self
 
         couponButton.title = NSLocalizedString("PDF Reader Pro for Mac", comment: "")
         couponButton.setTitleColor(color: NSColor(named: "KMPurchaseCouponColor")!, font: NSFont.SFProTextRegularFont(14))
@@ -669,36 +664,6 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
                 removeButton1.isEnabled = false
             }
             amountTextField1.stringValue = String(pdfCount)
-        } else if sender.tag == 2 || sender.tag == 3 {
-            if sender.tag == 2 {
-                if aiAddOnCount > 1 {
-                    aiAddOnCount -= 1
-                }
-            }
-            if sender.tag == 3 {
-                aiAddOnCount += 1
-            }
-            if aiAddOnCount > 1 {
-                removeButton2.isEnabled = true
-            } else {
-                removeButton2.isEnabled = false
-            }
-            amountTextField2.stringValue = String(aiAddOnCount)
-        } else if sender.tag == 4 || sender.tag == 5 {
-            if sender.tag == 4 {
-                if extendedCount > 1 {
-                    extendedCount -= 1
-                }
-            }
-            if sender.tag == 5 {
-                extendedCount += 1
-            }
-            if extendedCount > 1 {
-                removeButton3.isEnabled = true
-            } else {
-                removeButton3.isEnabled = false
-            }
-            amountTextField3.stringValue = String(extendedCount)
         }
         
         // 价格刷新
@@ -1299,18 +1264,47 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
                     if dataInfo.keys.contains("status") {
                         let status = dataInfo["status"] as? Int
                         if status == 2 {
+                            self.stopPolling()
                             if dataInfo.keys.contains("license") {
                                 let license = dataInfo["license"] as? [String]
                                 if license!.count > 0 {
                                     self.verificationActivate(license: license![0])
                                 }
+//                                else {
+//                                    let alert = NSAlert()
+//                                    alert.alertStyle = .critical
+//                                    alert.messageText = NSLocalizedString("Connection Error", comment: "")
+//                                    alert.informativeText = NSLocalizedString("Get License Code is empty.", comment: "")
+//                                    alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
+//                                    if alert.responds(to: #selector(alert.beginSheetModal(for:completionHandler:))) {
+//                                        alert.beginSheetModal(for: self.window!, completionHandler: nil)
+//                                    } else {
+//                                        alert.runModal()
+//                                    }
+//                                    return
+//                                }
                             }
                             if dataInfo.keys.contains("ai_license") {
                                 let ai_license = dataInfo["ai_license"] as? [String]
                                 if ai_license!.count > 0 {
                                     self.verificationActivateAIInfo(license: ai_license![0])
-                                }
+                                } 
+//                                else {
+//                                    let alert = NSAlert()
+//                                    alert.alertStyle = .critical
+//                                    alert.messageText = NSLocalizedString("Connection Error", comment: "")
+//                                    alert.informativeText = NSLocalizedString("Get AI License Code is empty.", comment: "")
+//                                    alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
+//                                    if alert.responds(to: #selector(alert.beginSheetModal(for:completionHandler:))) {
+//                                        alert.beginSheetModal(for: self.window!, completionHandler: nil)
+//                                    } else {
+//                                        alert.runModal()
+//                                    }
+//                                    return
+//                                }
                             }
+                        } else {
+                            self.startPolling()
                         }
                     }
                 }
@@ -1319,7 +1313,7 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
     }
     
     private func startPolling() {
-        timer = Timer(timeInterval: interval, repeats: true) { [weak self] _ in
+        timer = Timer(timeInterval: interval, repeats: false) { [weak self] _ in
             guard let self = self else { return }
             self.performTask()
         }
@@ -1343,11 +1337,15 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
     private func stopPolling() {
         timer?.invalidate()
         timer = nil
+        print("Polling task completed.")
         if self.embeddedPaymentPopWC != nil {
-            self.embeddedPaymentPopWC?.close()
-            self.embeddedPaymentPopWC = nil
+            DispatchQueue.main.async { [weak self] in
+                guard let self = self else { return }
+                self.embeddedPaymentPopWC?.close()
+                self.embeddedPaymentPopWC = nil
+            }
         }
-        print("Polling task completed.")
+        pollCount = 0
     }
     
     private func verificationActivateAIInfo(license: String) {
@@ -1405,17 +1403,11 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
     
     func controlTextDidEndEditing(_ obj: Notification) {
         let textField = obj.object as? NSTextField
-        if textField == amountTextField1 ||
-            textField == amountTextField2 ||
-            textField == amountTextField3 {
+        if textField == amountTextField1 {
             if isNumeric(textField!.stringValue) {
                 if textField == amountTextField1 { textField?.stringValue = String(pdfCount) }
-                else if textField == amountTextField2 { textField?.stringValue = String(aiAddOnCount) }
-                else if textField == amountTextField3 { textField?.stringValue = String(extendedCount) }
             } else {
                 if textField == amountTextField1 { pdfCount = Int(textField!.stringValue) ?? 1 }
-                else if textField == amountTextField2 { aiAddOnCount = Int(textField!.stringValue) ?? 1 }
-                else if textField == amountTextField3 { extendedCount = Int(textField!.stringValue) ?? 1 }
             }
         } else if textField == emailTextField {
             
@@ -1426,678 +1418,6 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
     
 }
 
-// /api/product/get-price/v2
-
-/*
- ▿ some : 1 element
-   ▿ 0 : 2 elements
-     - key : data
-     ▿ value : 3 elements
-       ▿ 0 : 2 elements
-         - key : message
-         - value : success
-       ▿ 1 : 2 elements
-         - key : data
-         ▿ value : 37 elements
-           ▿ 0 : 2 elements
-             - key : com.cisdem.pdfmaster.cross.platform.product_3
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 776
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 119.98
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 119.98
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 776
-           ▿ 1 : 2 elements
-             - key : com.filmage.pro-lite.mac.forever
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 388
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 59.99
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 59.99
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 388
-           ▿ 2 : 2 elements
-             - key : com.brother.pdfreaderpro.windows.product_3+com.brother.pdfreaderpro.mac.product_3
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 1036
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 159.98
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 159.98
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 1036
-           ▿ 3 : 2 elements
-             - key : com.brother.pdfreaderpro.cross.platform.product_3
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 486
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 74.98
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 119.98
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 776
-           ▿ 4 : 2 elements
-             - key : com.cisdem.pdfmaster.ai.product_1
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 99
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 14.99
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 14.99
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 99
-           ▿ 5 : 2 elements
-             - key : com.filmage.screen.mac
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 92
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 14.99
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 29.99
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 189
-           ▿ 6 : 2 elements
-             - key : com.brother.pdfreaderpro.windows.product_3
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 259
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 39.99
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 79.99
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 518
-           ▿ 7 : 2 elements
-             - key : com.brother.pdfreaderpro.combination.product
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 600
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 100
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 100
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 600
-           ▿ 8 : 2 elements
-             - key : com.brother.pdfreaderpro.mac.product_2.checkout
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 78
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 12
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 20.00
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 130.00
-           ▿ 9 : 2 elements
-             - key : com.brother.pdfreaderpro.windows.product_1
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 388
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 59.99
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 59.99
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 388
-           ▿ 10 : 2 elements
-             - key : com.brother.pdfreaderpro.ai.product_1
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 99
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 14.99
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 14.99
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 99
-           ▿ 11 : 2 elements
-             - key : com.brother.pdftecheditor.windows
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 598
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 89.99
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 89.99
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 598
-           ▿ 12 : 2 elements
-             - key : com.imyfone.pdf.cross.platform.trail
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 776
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 1
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 1
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 776
-           ▿ 13 : 2 elements
-             - key : com.brother.pdfreaderpro.mac.product_3
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 259
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 39.99
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 79.99
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 518
-           ▿ 14 : 2 elements
-             - key : com.brother.pdfreaderpro.mac.product_2
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 128
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 19.99
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 19.99
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 128
-           ▿ 15 : 2 elements
-             - key : com.brother.pdfreaderpro.windows.product_3+com.brother.pdfreaderpro.ai.product_1
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 318
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 48.98
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 94.98
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 617
-           ▿ 16 : 2 elements
-             - key : com.filmage.pro-lite.mac
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 259
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 39.99
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 39.99
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 259
-           ▿ 17 : 2 elements
-             - key : com.brother.pdfreaderpro.mac.product_3+com.filmage.screen.mac
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 318
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 49.98
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 109.98
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 707
-           ▿ 18 : 2 elements
-             - key : com.brother.pdfreaderpro.mac.product_1
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 388
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 59.99
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 59.99
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 388
-           ▿ 19 : 2 elements
-             - key : com.filmage.screen.mac.6_months
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 99
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 14.99
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 14.99
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 99
-           ▿ 20 : 2 elements
-             - key : com.brother.pdfreaderpro.cross.platform.product_3+com.brother.pdfreaderpro.ai.product_1
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 604
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 92.96
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 149.96
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 974
-           ▿ 21 : 2 elements
-             - key : com.brother.pdfreaderpro.windows.product_1+com.brother.pdfreaderpro.ai.product_1
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 487
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 74.98
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 74.98
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 487
-           ▿ 22 : 2 elements
-             - key : com.imyfone.pdf.cross.platform.product_3
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 776
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 119.98
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 119.98
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 776
-           ▿ 23 : 2 elements
-             - key : com.kdanmobile.mac.PDFReaderLite.perpetual_license_pack.002
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 798
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 119.99
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 119.99
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 798
-           ▿ 24 : 2 elements
-             - key : com.brother.pdfreaderpro.windows.product_2
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 128
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 19.99
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 19.99
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 128
-           ▿ 25 : 2 elements
-             - key : com.brother.pdfreaderpro.mac.product_1+com.brother.pdfreaderpro.ai.product_1
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 487
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 74.98
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 74.98
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 487
-           ▿ 26 : 2 elements
-             - key : com.brother.pdfreaderpro.windows.product_2.checkout
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 78
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 12
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 20.00
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 130.00
-           ▿ 27 : 2 elements
-             - key : com.filmage.converter.mac
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 68
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 9.99
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 9.99
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 68
-           ▿ 28 : 2 elements
-             - key : com.brother.pdfreaderpro.mac.product_3+com.brother.pdfreaderpro.ai.product_1
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 318
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 48.98
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 94.98
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 617
-           ▿ 29 : 2 elements
-             - key : com.cisdem.pdfmaster.windows.product_3
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 518
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 79.99
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 79.99
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 518
-           ▿ 30 : 2 elements
-             - key : com.filmage.converter.mac+com.filmage.pro-lite.mac
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 0.02
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 49.98
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 49.98
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 0.02
-           ▿ 31 : 2 elements
-             - key : com.brother.pdfreaderpro.cross.platform.product_1
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 600
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 100
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 100
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 600
-           ▿ 32 : 2 elements
-             - key : com.brother.pdftecheditor
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 598
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 89.99
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 89.99
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 598
-           ▿ 33 : 2 elements
-             - key : com.kdanmobile.mac.PDFReaderLite.standard_license_pack.002
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 588
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 89.99
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 89.99
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 588
-           ▿ 34 : 2 elements
-             - key : com.filmage.screen.mac+com.filmage.pro-lite.mac
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 0.02
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 69.98
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 69.98
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 0.02
-           ▿ 35 : 2 elements
-             - key : com.cisdem.pdfmaster.mac.product_3
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 518
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 79.99
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 79.99
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 518
-           ▿ 36 : 2 elements
-             - key : com.brother.pdfreaderpro.cross.platform.product_2
-             ▿ value : 4 elements
-               ▿ 0 : 2 elements
-                 - key : activity_cny_price
-                 - value : 258
-               ▿ 1 : 2 elements
-                 - key : activity_price
-                 - value : 39.99
-               ▿ 2 : 2 elements
-                 - key : price
-                 - value : 79.99
-               ▿ 3 : 2 elements
-                 - key : cny_price
-                 - value : 518
-       ▿ 2 : 2 elements
-         - key : code
-         - value : 200
- */
-
-// /api/coupons/retrieval
-/*
- ▿ Optional<AnyObject>
-   ▿ some : 2 elements
-     ▿ 0 : 2 elements
-       - key : app_code
-       - value : com.brother.pdfreaderprofree.windows
-     ▿ 1 : 2 elements
-       - key : data
-       ▿ value : 12 elements
-         ▿ 0 : 2 elements
-           - key : id
-           - value : 5851c5d6-f43e-32b2-8660-a6222194fee4
-         ▿ 1 : 2 elements
-           - key : discount
-           - value : <null>
-         ▿ 2 : 2 elements
-           - key : member
-           ▿ value : 2 elements
-             ▿ 0 : 2 elements
-               - key : email
-               - value : sec-2@drmail.in
-             ▿ 1 : 2 elements
-               - key : full_name
-               - value : test-nilvbo2
-         ▿ 3 : 2 elements
-           - key : coupon_provider
-           ▿ value : 15 elements
-             ▿ 0 : 2 elements
-               - key : id
-               - value : 291
-             ▿ 1 : 2 elements
-               - key : category
-               - value : presented
-             ▿ 2 : 2 elements
-               - key : start_date
-               - value : <null>
-             ▿ 3 : 2 elements
-               - key : limit_product
-               - value : 0
-             ▿ 4 : 2 elements
-               - key : total_amount
-               - value : 59502
-             ▿ 5 : 2 elements
-               - key : rcode
-               - value :
-             ▿ 6 : 2 elements
-               - key : end_date
-               - value : <null>
-             ▿ 7 : 2 elements
-               - key : created_at
-               - value : 2024-05-24 07:20:21
-             ▿ 8 : 2 elements
-               - key : discount
-               - value : <null>
-             ▿ 9 : 2 elements
-               - key : limit_product_code
-               - value :
-             ▿ 10 : 2 elements
-               - key : minimum_charge
-               - value : 59.99
-             ▿ 11 : 2 elements
-               - key : price
-               - value : 15
-             ▿ 12 : 2 elements
-               - key : valid_period
-               - value : 336.hours
-             ▿ 13 : 2 elements
-               - key : product_id
-               - value : 15
-             ▿ 14 : 2 elements
-               - key : received_amount
-               - value : 39
-         ▿ 4 : 2 elements
-           - key : expire_date
-           - value : 1718857051
-         ▿ 5 : 2 elements
-           - key : created_at
-           - value : 2024-06-06 04:17:31
-         ▿ 6 : 2 elements
-           - key : source_type
-           - value : event
-         ▿ 7 : 2 elements
-           - key : minimum_charge
-           - value : 59.99
-         ▿ 8 : 2 elements
-           - key : price
-           - value : 15
-         ▿ 9 : 2 elements
-           - key : coupon_provider_id
-           - value : 291
-         ▿ 10 : 2 elements
-           - key : code
-           - value : E85B-9C31-6EAB
-         ▿ 11 : 2 elements
-           - key : status
-           - value : expired
- */
-
 extension KMPurchaseEmbeddedWindowController: NSTextFieldDelegate {
     func textView(_ textView: NSTextView, clickedOnLink link: Any, at charIndex: Int) -> Bool {
         if let url = link as? String {

+ 4 - 4
PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseEmbeddedWindowController.xib

@@ -597,7 +597,7 @@
                                                             <subviews>
                                                                 <button tag="2" translatesAutoresizingMaskIntoConstraints="NO" id="MSF-9T-1cl">
                                                                     <rect key="frame" x="0.0" y="6" width="16" height="16"/>
-                                                                    <buttonCell key="cell" type="bevel" title="Button" bezelStyle="rounded" image="EmbeddedPayment03" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="3SC-SX-Q9S">
+                                                                    <buttonCell key="cell" type="bevel" title="Button" bezelStyle="rounded" image="EmbeddedPayment03" imagePosition="only" alignment="center" enabled="NO" imageScaling="proportionallyDown" inset="2" id="3SC-SX-Q9S">
                                                                         <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                                                         <font key="font" metaFont="system"/>
                                                                     </buttonCell>
@@ -611,7 +611,7 @@
                                                                 </button>
                                                                 <button tag="3" translatesAutoresizingMaskIntoConstraints="NO" id="fhV-YM-nNC">
                                                                     <rect key="frame" x="60" y="6" width="16" height="16"/>
-                                                                    <buttonCell key="cell" type="bevel" title="Button" bezelStyle="rounded" image="EmbeddedPayment04" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="KSI-N7-2wr">
+                                                                    <buttonCell key="cell" type="bevel" title="Button" bezelStyle="rounded" image="EmbeddedPayment04" imagePosition="only" alignment="center" enabled="NO" imageScaling="proportionallyDown" inset="2" id="KSI-N7-2wr">
                                                                         <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                                                         <font key="font" metaFont="system"/>
                                                                     </buttonCell>
@@ -751,7 +751,7 @@
                                                             <subviews>
                                                                 <button tag="4" translatesAutoresizingMaskIntoConstraints="NO" id="bmO-1e-QTX">
                                                                     <rect key="frame" x="0.0" y="6" width="16" height="16"/>
-                                                                    <buttonCell key="cell" type="bevel" title="Button" bezelStyle="rounded" image="EmbeddedPayment03" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="eRv-9c-VRo">
+                                                                    <buttonCell key="cell" type="bevel" title="Button" bezelStyle="rounded" image="EmbeddedPayment03" imagePosition="only" alignment="center" enabled="NO" imageScaling="proportionallyDown" inset="2" id="eRv-9c-VRo">
                                                                         <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                                                         <font key="font" metaFont="system"/>
                                                                     </buttonCell>
@@ -765,7 +765,7 @@
                                                                 </button>
                                                                 <button tag="5" translatesAutoresizingMaskIntoConstraints="NO" id="gZ7-bj-dxC">
                                                                     <rect key="frame" x="60" y="6" width="16" height="16"/>
-                                                                    <buttonCell key="cell" type="bevel" title="Button" bezelStyle="rounded" image="EmbeddedPayment04" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="fkA-os-7XV">
+                                                                    <buttonCell key="cell" type="bevel" title="Button" bezelStyle="rounded" image="EmbeddedPayment04" imagePosition="only" alignment="center" enabled="NO" imageScaling="proportionallyDown" inset="2" id="fkA-os-7XV">
                                                                         <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                                                         <font key="font" metaFont="system"/>
                                                                     </buttonCell>