Klarna Payments

Klarna Payments

Integration with the native Klarna Mobile SDK is available since mSDK version 2.59.0.

Follow this guide to add Klarna Installments, Financing or Pay Now right to your checkout.

Brand constants to be used:
  • KLARNA_PAYMENTS_PAYLATER - Installments,
  • KLARNA_PAYMENTS_SLICEIT - Financing,
  • KLARNA_PAYMENTS_PAYNOW - Pay Now.


Configuration

Ready-to-Use UI

When you use our ready-to-use UI, everything works out-of-box. Just set payment brands and shopper result url in the Checkout Settings class and you are done. Proceed with the presenting checkout as for standard transaction.

NOTE: To learn more about shopper result url refer to Asynchronous Payments guide.


SDK & Your Own UI

If you use our mSDK just for backend communication, you will have to go through the Klarna SDK integration as well. In this guide we assume you already implemented all steps for performing standard mSDK transaction. Then there are 3 main steps:

1. Create Klarna session

First of all, create KlarnaInlinePaymentParams object and submit a transaction. Server will return clientToken to authorize the session and callback urls to complete the transaction after all.

NOTE: To learn more about shopper result url refer to Asynchronous Payments guide.

2. Proceed with the Klarna Mobile SDK

As soon as client token is received, follow with the steps from .

Mapping of brand constants:

mSDK constantKlarna category
"KLARNA_PAYMENTS_PAYLATER""pay_later"
"KLARNA_PAYMENTS_SLICEIT""pay_over_time"
"KLARNA_PAYMENTS_PAYNOW""pay_now"

Here is how KlarnaPaymentsView initialization will look like with the data received from the mSDK:

3. Notify Server about payment completion

In order to complete the transaction you have to send additional request to backend.

  • If Klarna authorization is successful, check authToken is not empty and use callbackUrl to notify backend about transaction completion by sending a GET request.

  • If some error occurred, then use failureCallbackUrl to notify server about it.

NOTE: Expected response from callback urls is a redirect to the shopper result url. You might want to check that status and location of redirect url are valid, or it's also an option just to ignore the response. Request payment status as usual to get final result of the transaction.