Klarna Docs - Adding the Checkout SDK as a dependency

Adding the Checkout SDK as a dependency

Add the Repository

The Payments SDK is available on our Maven Repository. Perform the following steps to add it to your application: Edit your application-level build.gradle file and add the following repository to your repositories section:

JAVASCRIPT
    repositories {
        ....
        maven {
            url 'https://x.klarnacdn.net/mobile-sdk/'
        }
    }

Add Maven dependency

JAVASCRIPT
    implementation 'com.klarna.checkout:sdk:1.x.x'

Check out our git-hub page to find the latest version.

More information

For more information check out the Klarna Checkout SDK Github repository.

CONFIGURE YOUR APP

Return URL

Register an intent-filter for the Activity which will be hosting the checkout in your AndroidManifest.xml to support return URLs:

MARKUP
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />

        <data android:scheme="<your-custom-scheme>" />
        <data android:host="<your-custom-host>" />
    </intent-filter>

The hosting Activity should be using launchMode of type singleTask or singleTop to prevent a new instance from being created when returning from an external application.

MARKUP
<activity android:launchMode="singleTask|singleTop">

You can read more about how deeplinks and intent filters work on the Android Developers site.

INTERNET PERMISSIONS

The Checkout SDK will require access to the internet, as such, if you don’t explicitly declare access in your manifest, we will merge manifests to get access.