react-native-klarna-inapp-sdk 2.8.0 → 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.
package/README.md CHANGED
@@ -11,11 +11,12 @@ currently has the following components:
11
11
 
12
12
  - `KlarnaPaymentView` to integrate Klarna Payments
13
13
  - `KlarnaStandaloneWebView` to integrate Klarna Standalone WebView
14
- - `KlarnaCheckoutView` to integrate Klarna Checkout
15
14
  - `KlarnaSignInSDK` to integrate Klarna Sign In
16
15
  - `KlarnaOSMView` to integrate Klarna On-site Messaging
17
16
  - `KlarnaExpressCheckoutView` to integrate Klarna Express Checkout
18
17
 
18
+ **Important:** ⚠️ _KCO integrations and support has been officially deprecated and will be removed in future versions of the SDK. Please migrate to [Kustom Mobile SDK](https://docs.kustom.co/contents/checkout/integrate-kco-in-your-mobile/introduction) if you are integrating KCO via `KlarnaCheckoutView`, or `KlarnaStandaloneWebView`._
19
+
19
20
  This repository also includes a test application that you can use to see how different integrations work.
20
21
 
21
22
  ### SDK for Other Platforms
@@ -114,7 +114,7 @@ dependencies {
114
114
  implementation "org.jetbrains.kotlin:kotlin-reflect:${getExtOrDefault('kotlinVersion')}"
115
115
  implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3'
116
116
 
117
- implementation 'com.klarna.mobile:sdk:2.12.0'
117
+ implementation 'com.klarna.mobile:sdk:2.13.1'
118
118
  // Required: KlarnaExpressCheckoutButton extends ConstraintLayout.
119
119
  implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
120
120
 
@@ -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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-native-klarna-inapp-sdk",
3
3
  "title": "Klarna Mobile SDK React Native",
4
- "version": "2.8.0",
4
+ "version": "2.8.2",
5
5
  "description": "React Native package for Klarna Mobile SDK.",
6
6
  "main": "lib/commonjs/index",
7
7
  "module": "lib/module/index",
@@ -42,7 +42,7 @@ Pod::Spec.new do |s|
42
42
  end
43
43
  end
44
44
 
45
- s.dependency 'KlarnaMobileSDK', '2.12.0'
45
+ s.dependency 'KlarnaMobileSDK', '2.13.1'
46
46
 
47
47
  s.test_spec 'Tests' do |ts|
48
48
  ts.source_files = 'ios/Tests/**/*.{h,m,mm,swift}'