Configure
To configure Klarna, open the file Litium.Addons.Klarna.dll.config in your web\bin directory and follow the instructions at the beginning of the file. This article explains further details about configuration options.
You need to request a test account from Klarna from https://developers.klarna.com
Configuration file
After installing, you need to place the configuration information in the Litium.Studio.Klarna.dll.config file.
Rename the Litium.AddOns.Klarna.dll.config.tmpl.exclude to Litium.AddOns.Klarna.dll.config and set the configuration options (if you had a previous version of the config file, copy the options from that file).
From Klarna you would receive following:
Username - Consists of your Merchant ID (eid) - a unique number that identifies your e-store, combined with a random string. This is the "merchantId" in the config file.
Password - a string which is associated with your Merchant ID and is used to authorize use of Klarna's APIs. This is the "sharedSecret" in the config file.
Configuring Klarna checkout web page
Add the Klarna V3 checkout payment method to the normal MVC checkout page. For Litium 7, add the Klarna V3 checkout payment method by configuring the selected payment methods on the channel.
Multimarket support
It is possible to have multiple Klarna accounts in the same Litium installation.
To add a new Klarna account, in the Litium.AddOns.Klarna.dll.config file
- create a new paymentAccount section (copy-paste an existing paymentAccount section)
- change paymentAccountIdentifier attribute. It should be unique and should not contain spaces.
The paymentAccountIdentifier is appended at the beginning of each Klarna payment method and is used by the API to identify the correct account.
Headless API with Klarna
Klarna Addon can be used in a headless ECommerce scenario (where an external CMS website is used instead of Litium CMS) when Klarna Hosted Payment Pages (Klarna HPP) is used. (Klarna Checkout is an iFrame and rendering it on a cross-site scenario is not tested)
To enable Klarna for headless, set the "headlessCheckout" attribute to true. The checkout process should then be done through web API calls, as implemented in the headless API add-on.