Before: In the legacy Klarna Checkout SDK, you need to create an instance of the SDK, get the view object from the SDK instance, and manually add it to your view hierarchy:
After: In the Klarna Mobile SDK, you can either create the KlarnaCheckoutView in your XML file and get a reference to it, or you can create an instance programmatically, add it to your view hierarchy, and set its properties.
Before: In the legacy Klarna Checkout SDK, you would set a `SignalListener` object on the Checkout to listen to the different events:
After: In the Klarna Mobile SDK, you need to provide a `KlarnaEventHandler` object in the constructor or set this property on the Checkout SDK to listen to events and error messages:
Before: In the legacy Klarna Checkout SDK, you need to set a boolean flag on the checkout instance to configure if you want to handle external payment methods or not:
Then you would receive the corresponding signal in your `signalListener` callback:
After: In the Klarna Mobile SDK, you need to access and set this flag inside a new property called `checkoutOptions`:
Then you would receive the corresponding signal in your `klarnaEventHandler` callback:
Before: In the legacy Klarna Checkout SDK, you need to set a boolean flag on the checkout instance to configure if you want to handle validation errors or not:
Then you would receive the corresponding signal in your `signalListener` callback:
After: In the Klarna Mobile SDK, you need to access and set this flag inside a new property called `checkoutOptions`:
Then you would receive the corresponding signal in your `klarnaEventHandler` callback:
Before: In the legacy Klarna Checkout SDK, you needed to create an instance of `KlarnaCheckout` and then set your `WebView` object to the SDK. Then you could load your Klarna Checkout integration in a URL via this `WebView`:
After: In the Klarna Mobile SDK, you need to create an instance of `KlarnaHybridSDK` and then set your `WebView` object to the SDK. Then you could load your Klarna Checkout integration in a URL via this `WebView`:
You would also need to notify the SDK whenever a new page is loaded:
To know more about the Hybrid integration using Klarna Mobile SDK and the callbacks, please take a look at this page.