@tryheliumai/paywall-sdk-react-native 0.1.14 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -48,6 +48,13 @@ class BridgingPaywallDelegate: HeliumPaywallDelegate {
|
|
|
48
48
|
return await withCheckedContinuation { continuation in
|
|
49
49
|
let transactionId = UUID().uuidString
|
|
50
50
|
|
|
51
|
+
let userInfo: [String: Any] = [
|
|
52
|
+
NSLocalizedDescriptionKey: "Failed to make purchase",
|
|
53
|
+
NSLocalizedFailureReasonErrorKey: "An unknown error occurred",
|
|
54
|
+
NSLocalizedRecoverySuggestionErrorKey: "Please try again later"
|
|
55
|
+
]
|
|
56
|
+
let failureError = NSError(domain: "PaywallErrorDomain", code: 1001, userInfo: userInfo)
|
|
57
|
+
|
|
51
58
|
// Store continuation callback
|
|
52
59
|
purchaseState.pendingResponses[transactionId] = { response in
|
|
53
60
|
let status: HeliumPaywallTransactionStatus = switch response.status {
|
|
@@ -55,8 +62,9 @@ class BridgingPaywallDelegate: HeliumPaywallDelegate {
|
|
|
55
62
|
case "purchased": .purchased
|
|
56
63
|
case "cancelled": .cancelled
|
|
57
64
|
case "restored": .restored
|
|
65
|
+
case "failed": .failed(failureError)
|
|
58
66
|
case "pending": .pending
|
|
59
|
-
default: .failed(
|
|
67
|
+
default: .failed(failureError)
|
|
60
68
|
}
|
|
61
69
|
continuation.resume(returning: status)
|
|
62
70
|
}
|