|
@@ -1003,6 +1003,20 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
|
|
|
self.refreshCouponError(isReveal: true)
|
|
|
}
|
|
|
} else {
|
|
|
+ if dataInfo.keys.contains("limit_product_code") {
|
|
|
+ if let limit_product_code = dataInfo["limit_product_code"] {
|
|
|
+ if let limitCode = limit_product_code as? String {
|
|
|
+ if limitCode.count > 0 {
|
|
|
+ if self.productID != limitCode {
|
|
|
+ self.couponClearButton.isHidden = false
|
|
|
+ self.coupomErrorLabel.stringValue = NSLocalizedString("The coupon code is invalid. Please try again.", comment: "")
|
|
|
+ self.refreshCouponError(isReveal: true)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
if dataInfo["discount"] is NSNull && dataInfo["price"] is NSNull {
|
|
|
self.coupomErrorLabel.stringValue = NSLocalizedString("The coupon code is invalid. Please try again.", comment: "")
|
|
|
self.refreshCouponError(isReveal: true)
|
|
@@ -1606,6 +1620,13 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
|
|
|
|
|
|
@objc private func performTask() {
|
|
|
guard pollCount < maxPolls else {
|
|
|
+ timer?.invalidate()
|
|
|
+ timer = nil
|
|
|
+ DispatchQueue.main.async { [weak self] in
|
|
|
+ guard let self = self else { return }
|
|
|
+ self.embeddedPaymentPopWC?.close()
|
|
|
+ self.embeddedPaymentPopWC = nil
|
|
|
+ }
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -1620,7 +1641,20 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
|
|
|
timer?.invalidate()
|
|
|
timer = nil
|
|
|
print("Polling task completed.")
|
|
|
- if !AIInfoManager.default().aiInfoValid {
|
|
|
+ if productID == "com.brother.pdfreaderpro.ai.product_1" ||
|
|
|
+ productID == "com.brother.pdfreaderpro.mac.product_1+com.brother.pdfreaderpro.ai.product_1" ||
|
|
|
+ productID == "com.brother.pdfreaderpro.mac.product_3+com.brother.pdfreaderpro.ai.product_1" ||
|
|
|
+ productID == "com.brother.pdfreaderpro.cross.platform.product_3+com.brother.pdfreaderpro.ai.product_1"{
|
|
|
+ if !AIInfoManager.default().aiInfoValid {
|
|
|
+ if self.embeddedPaymentPopWC != nil {
|
|
|
+ DispatchQueue.main.async { [weak self] in
|
|
|
+ guard let self = self else { return }
|
|
|
+ self.embeddedPaymentPopWC?.close()
|
|
|
+ self.embeddedPaymentPopWC = nil
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
if self.embeddedPaymentPopWC != nil {
|
|
|
DispatchQueue.main.async { [weak self] in
|
|
|
guard let self = self else { return }
|