In this guide you will learn how to integrate Tokenized Payments in Sign in with Klarna into your Android app.
The flow will initiate when the scope contains payment:customer_present or payment:customer_not_present.
It also has a new callback KlarnaSignInTokenizationCallback
to be implemented by the client to provide the tokenization ID.
When the tokenization ID is valid, the process will proceed with the payment flow. However, if the tokenization ID is either invalid or not provided, the process will conclude with a successful sign-in flow.
The KlarnaSignInButton
now has a new callback called KlarnaSignInTokenizationCallback
that needs to be implemented. The callback implementation must provide the tokenization ID to the completion handler in order to continue the flow.
While the user is interacting with the Sign in with Klarna flow or when the flow is completed, you'll receive events by setting an event handler when creating an instance of KlarnaSignInSDK
. On the right you can see an example of how to implement such an event handler.
Pass the KlarnaSignInTokenizationCallback
instance into the KlarnaSignInButton
constructor.
To have Tokenized Payments with the Sign in with Klarna SDK in your Android app, you need to create an instance of KlarnaSignInSDK
, call its signIn()
function and pass the tokenizationId into its param.
After calling the signIn()
function you will receive the events in the event handler that you've passed to the SDK.