Configuration¶
Application config¶
To use this package, you need to have API credentials for Klarna Checkout API. Have a look at this YouTube video from Klarna which explains how to setup a test account, and generate API credentials.
The credentials from Klarna, should be put in the Application Config
Secrets¶
klarna:
username: {username}
password: {password}
Config¶
klarna:
base_url: {url_to_klarna}
active_config_check: # endpoints used to see if configs are used in external systems
lime_forms: https://$CUSTOMER.lime-forms.se/limepkg-klarna/active-config?name={}
Lime Admin¶
To get started, first navigate to Lime Admin through the webclient. Go to "Settings" --> "Klarna". Once there, press the button "+ Klarna configurations" to add a new configuration.
Expand the item in the list so that it looks like below
Choose an appropriate name for your config, based on the usage. E.g. "Lime Forms, Sweden, Coffee products"
Sections¶
Klarna specific settings¶
Select the settings that apply for your use case. If you plan to sell products in Sweden, you will obviously choose "Sweden" as Purchase Country
.
Terms / Notifications¶
The term merchant below refers to the customer using this configuration for selling their products.
Setting | Description |
---|---|
Link to terms | URL for the terms and conditions page of the merchant. The URL will be displayed inside the Klarna Checkout iFrame.(max 2000 characters) Example: "https://merchant.com/terms". This URL should always point to the page where the customer has their terms and conditions agreement. |
Link to checkout | URL for the checkout page of the merchant. (max 2000 characters) Example: "https://merchant.com/checkout". This link points to the page where the user pays. This value is not currently used in the integration, for now you can use the example value "https://merchant.com/checkout" |
Link to confirmation | URL of the merchant confirmation page. The consumer will be redirected back to the confirmation page if the authorization is successful after the customer clicks on the ‘Place Order’ button inside checkout. The special characters of the confirmation URL should be encoded, e.g. the "space" character should be written as "%20". Then, on top of that, the whole confirmation URL should be encoded. E.g. the "space" character should become "%2520". (max 2000 characters) Example: "https://merchant.com/confirmation?order_id={checkout.order.id}" |
Url for webhook | URL that will be used for push notification when an order is completed. This should always point to the /checkout endpoint in the package. E.g. https://customer_url/database/limepkg-klarna/klarna/checkout |
Link to cancellation terms | URL for the cancellation terms page of the merchant. The URL will be displayed in the email that is sent to the customer after the order is captured.(max 2000 characters) Example: "https://merchant.com/terms/cancelation". This should point to the terms provided by the customer that uses this config. |
Article¶
Choosen an appropriate limetype which will represent an article that can be purchased, i.e. the object should contain information such as VAT, price, unit etc.
Article properties¶
For the package to calculate and show the correct information, mapping between limetype fields and the package config must be done. First you will choose a key that is specific to Klarna, e.g. "Unit price" and select which property on the selected limetype corresponds with this value. In the example image below, "Unit price" is mapped to "Price" on the limetype.
The following properties must be configured:
- Unit price
- Tax rate
- Name