Browse Source

Merge branch 'develop'

tangchao 1 year ago
parent
commit
f534d52c93

+ 4 - 8
PDF Office/PDF Master/Class/KMLightMember/InAppPurchase/Appstore/KMInAppPurchaseManager.swift

@@ -57,7 +57,7 @@ enum KMInAppPurchaseState: String, CaseIterable {
     case restoreFailed = "Restore Failed"//"restore失败"
     case restoreVerSuccess = "Restore 2-step Verification Successeful"//"restore二次验证成功"
     case restoreVerFailed = "Restore 2-step Verification Failed"//"restore二次验证失败"
-    case noReceipt = "No Order Information"//"无票据信息"
+    case noReceipt = "No Ticket Information"//"无票据信息"
     case orderFailed = "Order Creation Failed"//"订单创建失败"
     case checkSubscriptionSuccess = "checkSubscriptionSuccess" //检测是否订阅成功
     case checkSubscriptionFailed = "checkSubscriptionFailed" //检测是否订阅失败
@@ -149,7 +149,7 @@ class KMInAppPurchaseManager: NSObject {
             if state == .verSuccess {
                 purchaseProductCompletion?(true, state)
                 purchaseProductCompletion = nil
-            } else if state == .restoreVerFailed ||
+            } else if state == .restoreFailed ||
                         state == .restoreVerFailed {
                 restoreCompletion?(false, state)
                 restoreCompletion = nil
@@ -160,7 +160,6 @@ class KMInAppPurchaseManager: NSObject {
                 } else {
                     restoreCompletion?(false, state)
                 }
-                
                 restoreCompletion = nil
             } else if state == .checkSubscriptionSuccess ||
                         state == .checkSubscriptionFailed {
@@ -416,12 +415,9 @@ extension KMInAppPurchaseManager: SKPaymentTransactionObserver {
     }
     
     func paymentQueue(_ queue: SKPaymentQueue, restoreCompletedTransactionsFailedWithError error: Error) {
-        restoreCompletion?(false,.success)
-        restoreCompletion = nil
-        
-        checkSubscriptionStatusCompletion?(false)
-        checkSubscriptionStatusCompletion = nil
         KMPrint("restoreCompletedTransactionsFailedWithError")
+        self.handleAction(state: .restoreFailed)
+        self.handleAction(state: .checkSubscriptionFailed)
     }
     
     func parseVerificationResult(data: Data) -> Bool {

+ 16 - 0
PDF Office/PDF Master/Strings/en.lproj/Localizable.strings

@@ -688,6 +688,22 @@
 "This order does not exist."     =     "This order does not exist.";
 "This order status is abnormal."     =     "This order status is abnormal.";
 "Duplicate TransactionID"     =     "Duplicate TransactionID";
+"Purchase Successfully"     =     "Purchase Successfully";
+"Purchase Failed"     =     "Purchase Failed";
+"Cancel Purchase"     =     "Cancel Purchase";
+"Order Verification Filed"     =     "Order Verification Filed";
+"Order Verification Successful"     =     "Order Verification Successful";
+"Server Order Verification Failed"     =     "Server Order Verification Failed";
+"In-app Purchases not Allowed"     =     "In-app Purchases not Allowed";
+"Failed to Access Product"     =     "Failed to Access Product";
+"Access Product Successfully"     =     "Access Product Successfully";
+"Product not Found"     =     "Product not Found";
+"Restore Successfully"     =     "Restore Successfully";
+"Restore Failed"     =     "Restore Failed";
+"Restore 2-step Verification Successeful"     =     "Restore 2-step Verification Successeful";
+"Restore 2-step Verification Failed"     =     "Restore 2-step Verification Failed";
+"No Ticket Information"     =     "No Ticket Information";
+"Order Creation Failed"     =     "Order Creation Failed";
 
 "Upgrade to Use All Features!" = "Upgrade to Use All Features!";
 "Registered" = "Registered";