Mobile SDK integration
Integrate Klarna via Mobile SDK by embedding the payment form, tracking payment status, and completing authorization flows for a smoooth mobile checkout experience.
312 min read
Before you integrate, check that you meet the following prerequisites:
Ensure that you have Klarna enabled with Worldpay.
Inside Klarna Partner Portal:
Confirm that you have generated a client identifier.
Confirm that you have generated an API key.
Confirm that you have registered webhooks for
payment.request.state-change.completed events following
Webhooks guidelines.
Worldpay supports klarna_network_session_token exchange for client-side use with Klarna.
This guide covers iOS, Android, React Native, and Flutter integrations.
Here's an overview of all the steps to processing a payment with Klarna via the Mobile SDK:
Present Klarna as a payment option in the payment form.
Customer clicks the Klarna payment button in your checkout.
You create either a server-side payment request with Worldpay or use the Klarna Mobile SDK to initiate the payment request, sharing all available interoperability data points.
If customer interaction is required:
Klarna returns a klarna_network_session_token via a webhook.
You create an authorization request with Worldpay and share the required interoperability data points.
Worldpay responds with an approval and order completion.
Customer is redirected to your confirmation page.
sequenceDiagram
participant C as Customer
participant P as Partner
participant K as Klarna
participant AP as Worldpay
C->>P: Visit checkout page
P->>K: Initialize Klarna Mobile SDK
P->>K: Request presentation instructions
K->>P: Return assets and instructions
P->>P: Render payment selector
C->>P: Select Klarna payment method
P->>P: Update Klarna presentation<br>Show Klarna payment button
C->>P: Click Klarna payment button
Note over P,AP: Handle the "Pay with Klarna" button click
P->>K: Initiate Payment Request
K->>C: Start Klarna purchase flow
C->>K: Complete Klarna purchase flow
K->>P: Payment request completed event via webhook
Note over P,K: klarna_network_session_token
P->>AP: Authorize payment
Note over P,AP: Share interoperability data points
AP->>P: Respond with approval
Note over P,AP: Order completed
P->>C: Redirect to confirmation page