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:
1 2 3 4 5 6
repositories { .... maven { url 'https://x.klarnacdn.net/mobile-sdk/' } }
Add Maven dependency
1
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 .
Return URL
Register an intent-filter for the Activity which will be hosting the checkout in your AndroidManifest.xml to support return URLs:
1 2 3 4 5 6 7 8
<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.
1
<activity android:launchMode="singleTask|singleTop">
You can read more about how deeplinks and intent filters work on the Android Developers site .
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.