react-native-klarna-inapp-sdk 2.8.1 → 2.8.2
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.
|
@@ -2,16 +2,19 @@ import Foundation
|
|
|
2
2
|
import KlarnaCore
|
|
3
3
|
import KlarnaPayments
|
|
4
4
|
|
|
5
|
+
// KEC types are qualified with `KlarnaPayments.` to avoid an "ambiguous for type
|
|
6
|
+
// lookup" error: the `KlarnaMobileSDK` umbrella also re-exports them as typealiases.
|
|
7
|
+
|
|
5
8
|
/// A Swift class that implements the pure-Swift `KlarnaExpressCheckoutButtonDelegate` protocol
|
|
6
9
|
/// and forwards events to closures that can be set from Obj-C++ wrapper code.
|
|
7
|
-
@objc public class KlarnaExpressCheckoutButtonDelegateProxy: NSObject, KlarnaExpressCheckoutButtonDelegate {
|
|
10
|
+
@objc public class KlarnaExpressCheckoutButtonDelegateProxy: NSObject, KlarnaPayments.KlarnaExpressCheckoutButtonDelegate {
|
|
8
11
|
|
|
9
12
|
@objc public var onAuthorizedHandler: ((_ response: NSDictionary) -> Void)?
|
|
10
13
|
@objc public var onErrorHandler: ((_ name: String, _ message: String, _ isFatal: Bool) -> Void)?
|
|
11
14
|
|
|
12
15
|
public func onAuthorized(
|
|
13
|
-
view: KlarnaExpressCheckoutButton,
|
|
14
|
-
response: KlarnaExpressCheckoutButtonAuthorizationResponse
|
|
16
|
+
view: KlarnaPayments.KlarnaExpressCheckoutButton,
|
|
17
|
+
response: KlarnaPayments.KlarnaExpressCheckoutButtonAuthorizationResponse
|
|
15
18
|
) {
|
|
16
19
|
let responseDict: NSDictionary = [
|
|
17
20
|
"showForm": response.showForm,
|
|
@@ -28,7 +31,7 @@ import KlarnaPayments
|
|
|
28
31
|
}
|
|
29
32
|
|
|
30
33
|
public func onError(
|
|
31
|
-
view: KlarnaExpressCheckoutButton,
|
|
34
|
+
view: KlarnaPayments.KlarnaExpressCheckoutButton,
|
|
32
35
|
error: KlarnaError
|
|
33
36
|
) {
|
|
34
37
|
onErrorHandler?(error.name, error.message, error.isFatal)
|
|
@@ -54,18 +57,18 @@ import KlarnaPayments
|
|
|
54
57
|
sessionData: String?,
|
|
55
58
|
environment: String?,
|
|
56
59
|
region: String?
|
|
57
|
-
) -> KlarnaExpressCheckoutButton? {
|
|
60
|
+
) -> KlarnaPayments.KlarnaExpressCheckoutButton? {
|
|
58
61
|
// Build session options based on the explicit sessionType.
|
|
59
|
-
let sessionOptions: KlarnaExpressCheckoutSessionOptions
|
|
62
|
+
let sessionOptions: KlarnaPayments.KlarnaExpressCheckoutSessionOptions
|
|
60
63
|
if sessionType == "clientToken" {
|
|
61
|
-
sessionOptions = KlarnaExpressCheckoutSessionOptions.ServerSideSession(
|
|
64
|
+
sessionOptions = KlarnaPayments.KlarnaExpressCheckoutSessionOptions.ServerSideSession(
|
|
62
65
|
clientToken: clientToken ?? "",
|
|
63
66
|
autoFinalize: autoFinalize,
|
|
64
67
|
collectShippingAddress: collectShippingAddress,
|
|
65
68
|
sessionData: sessionData
|
|
66
69
|
)
|
|
67
70
|
} else {
|
|
68
|
-
sessionOptions = KlarnaExpressCheckoutSessionOptions.ClientSideSession(
|
|
71
|
+
sessionOptions = KlarnaPayments.KlarnaExpressCheckoutSessionOptions.ClientSideSession(
|
|
69
72
|
clientId: clientId ?? "",
|
|
70
73
|
sessionData: sessionData ?? "",
|
|
71
74
|
autoFinalize: autoFinalize,
|
|
@@ -103,7 +106,7 @@ import KlarnaPayments
|
|
|
103
106
|
}
|
|
104
107
|
}
|
|
105
108
|
|
|
106
|
-
let styleConfig = KlarnaExpressCheckoutButtonStyleConfiguration(
|
|
109
|
+
let styleConfig = KlarnaPayments.KlarnaExpressCheckoutButtonStyleConfiguration(
|
|
107
110
|
theme: buttonTheme,
|
|
108
111
|
shape: buttonShape,
|
|
109
112
|
style: klarnaButtonStyle
|
|
@@ -130,7 +133,7 @@ import KlarnaPayments
|
|
|
130
133
|
}
|
|
131
134
|
}
|
|
132
135
|
|
|
133
|
-
let options = KlarnaExpressCheckoutButtonOptions(
|
|
136
|
+
let options = KlarnaPayments.KlarnaExpressCheckoutButtonOptions(
|
|
134
137
|
sessionOptions: sessionOptions,
|
|
135
138
|
returnUrl: returnUrl,
|
|
136
139
|
delegate: delegate,
|
|
@@ -140,6 +143,6 @@ import KlarnaPayments
|
|
|
140
143
|
region: klarnaRegion
|
|
141
144
|
)
|
|
142
145
|
|
|
143
|
-
return KlarnaExpressCheckoutButton(options: options)
|
|
146
|
+
return KlarnaPayments.KlarnaExpressCheckoutButton(options: options)
|
|
144
147
|
}
|
|
145
148
|
}
|
package/package.json
CHANGED