Introduction

Introduction

If you are looking for documentation regarding Klarna Checkout, you can find it here.


Klarna Payments for WooCommerce is a plugin that extends WooCommerce, allowing you to take payments via Klarna.

  • Klarna Payments is available in Australia, Austria, Belgium, Canada, Czech Republic, Denmark, Finland, France, Germany, Greece, Hungary, Ireland, Italy, Mexico, Netherlands, New Zealand, Norway, Poland, Portugal, Romania, Spain, Sweden, Switzerland, United Kingdom and United States.
  • You need an agreement with Klarna to be able to use this plugin.
  • Klarna Payments for WooCommerce support High-Performance Order Storage (HPOS).

Required WordPress/WooCommerce settings


  • Installing HTTPS (a SSL/TLS certificate) in your web store is required for Klarna Payments to work.
  • Make sure that you have enabled pretty permalinks in your WordPress installation. Otherwise callbacks from Klarna back to your store won’t work and orders will not be updated with the correct order status/information.
  • To get the order total to match between WooCommerce and Klarna you need to configure WooCommerce to display prices with 2 decimals. More information about displaying of prices and how it can cause rounding issues can be found in this article.

Configuration


Go to: WooCommerce → Settings → Payments → Klarna for WooCommerce.

Credentials

Client Identifier & API Credentials

Enter the credentials for production and test for each market Klarna is used. Get the client identifier and API credentials from the Klarna Merchant Portal, under Settings.

  1. Enter the countries where Klarna will be available – Add the countries where Klarna will be available as the payment method. Search and select them from the dropdown list.
  2. Test mode – Check the Enable Klarna Payments in Klarna’s test environment. checkbox to make purchases using test credentials.
    Learn more about test accounts at the Klarna Docs.
  3. European Market – Enter the Username and Password for each European country you wish to activate Klarna as payment method. Enter the Client ID for each European country you wish to activate your Klarna Conversion Boosters, e.g. On-site Messaging and/or Express Checkout.
  4. Combine EU credentials – Check this box to combine all EU country credentials to a single Credentials for Europe.

Please note that when you use the single Credentials for Europe you must Enter the countries where Klarna will be available in step 1 above in order for them to be correctly activated.

If no countries are set, the plugin will assume that all countries are available, This might result in errors when trying to create a session for customers in countries you don’t have in your agreement with Klarna.

If this setting is used and you have agreeements for North American and/or Oceanian countries, you need to add these to the list as well.

  1. North American Market – Enter the Username and Password for each North American country you wish to activate Klarna as payment method. Enter the Client ID for each North American country you wish to activate your Klarna Conversion Boosters, e.g. On-site Messaging and/or Express Checkout.
  2. Oceania Market – Enter the Username and Password for each Oceanian country you wish to activate Klarna as payment method. Enter the Client ID for each Oceanian country you wish to activate your Klarna Conversion Boosters, e.g. On-site Messaging and/or Express Checkout.

Note that you need an agreement with Klarna for each country enabled and your store needs to be able to process purchases in the local currency.

Contact Klarna merchant support to add a new country to your setup.

Klarna only support the local currency of each country and they support a limited set of locales per country.
A list of available countries, locales, and currencies for Klarna Payments can be found at the Data mapping settings in the Klarna Docs.

Klarna Payments

  1. Enable Klarna Payments by checking the Enable Klarna Payments checkbox.
  2. Logging – Select if you want to save debug messages to the WooCommerce System Status log found in WooCommerce → System Status → Logs.
    Select Yes (with extra debug data) to save extra data from the request logs from the plugin. Useful for debugging issues that are hard to replicate. This will log a lot more data and should only be used when needed.
  3. Payment method title – Changes what the payment method is called on the order received page as well as the email that is sent to the customer. This will however not effect the Payment method title displayed on the Checkout page as this title is set by Klarna.
  4. Hide What is Klarna? link – If checked, What is Klarna? will not be shown.
  5. Float What is Klarna link – Check this if you want to float the What is Klarna? link to the right.
  6. Product URLs – Check this if you want to send product and product image URLs to Klarna.
  7. Add Klarna URLs to order email – This will add Klarna URLs to the order emails that are sent. You can read more about Order confirmation here.
  8. Customer type – Select the customer for the store (B2C or B2B).

Klarna Order Management

These settings only apply if you have Klarna Order Management installed.

Go to: WooCommerce → Settings → Payments → Klarna for WooCommerce and scroll down to Klarna Order Management

  1. On order completion – This setting will enable the automatic capture of a Klarna order when the relevant WooCommerce order is set to Completed.
  2. On order cancel – This setting will enable the automatic canceling of a Klarna order when the relevant WooCommerce order is set to Canceled.
  3. On order update – This setting will enable the automatic update of a Klarna order when the relevant WooCommerce order is updated before it has been Captured or Canceled.
  4. On order creation (manual) – This setting will make it possible to automatically fetch the customers information from a manually created admin order if there is a Klarna order id added as the transaction id.
    You can read more about this in the Klarna Point of Sale integration section in the Klarna Order Management documentation.
  5. Force capture full order – This setting will force the capture of any remaining amount in the Klarna order, instead of capturing each order line separately. Useful if the Klarna order has been updated by an ERP (Enterprise Resource Planning) system.
  6. Debug log – This setting will enable that debug messages are saved in the WooCommerce System Status log.

For detailed documentation, please see Klarna Order Management.

Klarna On-site Messaging

This is where you configure Klarna On-site Messaging. For detailed documentation please see the Klarna On-site Messaging section.

Klarna Express Checkout

This is where you enable and configure Klarna Express Checkout. For detailed documentation please see Klarna Express Checkout.


Set up Klarna Payments for test purchases


Find your test credentials and set up your WooCommerce store for test purchases:
  1. Sign up for a Playground (test) environment at Klarna, or log in if you already have signed up for this, at the Klarna Merchant Portal.
  2. Go to Settings and click on Generate new Klarna API credentials
  3. Save or download your keys
  4. Go to the Klarna Payments settings in WooCommerce.
  5. Enable the Test Mode and make sure that you also Log debug messages.
  6. Enter your test Username and Password.
  7. Save the settings.
Make a test purchase

In your shop Checkout you should now see a green “Test drive” banner, confirming that you are in test mode.

You can now make test purchases using the sample data from Klarna.


Manually adding an order / Pay for order


Klarna Payments supports the WooCommerce standard functionality to Manually Adding an Order from the WooCommerce admin.

This can also be referred to as “Pay for order” (or “Order pay”) and is a feature that allows you to manually add an order for a new, or returning, customer. This is useful if you accept phone orders, or for some other reason need to create an order with items, coupons and/or fees manually.

The merchant can set the payment method, and through that limit the method to Klarna Payments.

Please note that a subscription cannot be bought through this payment method.


Compatibility with themes & plugins


  • Klarna Payments should work with most themes. However, the plugin is only tested with the Storefront theme and we do not guarantee that it will work with other themes. Common situations when errors occur are:
    – Themes/plugins with customized template files for WooCommerce checkout page.
    – Themes/plugins that removes standard checkout fields.
    – Themes/plugins that modifies the checkout into a multi step checkout.
  • The plugin and Klarna only handle product quantity that is specified as an integer. For instance you can’t send 1.5 as the product quantity to Klarna. If you sell products where you charge by length or dimension we recommend that you use the Measurement Price Calculator plugin.
  • WooCommerce does not offer multi currency support. This can be handled via several different plugins. This plugin is compatible with the Currency Switcher for WooCommerce plugin from Aelia. We do not guarantee that other multi currency plugins will work together with the Klarna plugin.

Read more about compatibility on these links:
Klarna Payments – Compatible plugins

Klarna Payments – Known compatibility issues

Krokedil and Klarna do not offer help with adapting your theme or plugin within regular support.


Subscription support


Klarna Payments is compatible with the WooCommerce Subscriptions extension for handling of recurring payments.

Please note that Klarna supports subscriptions only for some regions. Please check with Klarna merchant support for supported regions.

Read more about recurring payments with Klarna here.


Currencies and countries


Each Klarna country has its own set of country specific settings. You need an agreement with Klarna for each country enabled and your store needs to be able to process purchases in the local currency.

Read more under Configuration Country settings above.


Troubleshooting


  • If Klarna Payments isn’t displayed as an available payment method in checkout page make sure customer billing country is one of countries you have entered Klarna Payments credentials for and that selected currency matches customer billing country.

Optimizing your checkout


Optimizing can be very powerful when it’s properly configured, but when using a Iframe-base checkout there can be compatibility issues.

While Klarna Payments strictly speaking is not an iframe-based checkout, the same info can still be applied.

Common issues:

  • The JS, CSS files is moved around. 
    This can result in that the checkout doesn’t appear at all.
  • You are minifying/concatenate/caching HTML, CSS and JS-files.
    This can result in double orders, wrong Information in the orders etc.

Common plugins in use when these errors appears:

  • Autoptimize
  • LiteSpeed Cache
  • SG Optimizer
  • WP Fastest Cache
  • WP Rocket
  • W3 Total Cache

The summary of this is that if you use a Iframe-based checkout you should NOT do anything with the HTML, JS or CSS on the cart/checkout page.


Files to exclude from optimization


If you are using some kind of optimization feature there are files that needs to be excluded from any caching or concatenating.

For Klarna Payments for WooCommerce you need to exclude the following files:

  • wp-content/plugins/klarna-payments-for-woocommerce/assets/js/klarna-payments.js
  • wp-content/plugins/klarna-payments-for-woocommerce/Blocks/Payment/build/klarna-payments-block.css
  • wp-content/plugins/klarna-payments-for-woocommerce/vendor/krokedil/klarna-onsite-messaging/src/assets/js/klarna-onsite-messaging.js
  • js.playground.klarna.com
  • js.klarna.com
  • cdn.klarna.com
  • x.klarnacdn.net

And perhaps:

  • wp-content/plugins/klarna-payments-for-woocommerce/vendor/krokedil/klarna-express-checkout/assets/js/kec-cart.js
  • wp-content/plugins/klarna-payments-for-woocommerce/vendor/krokedil/klarna-express-checkout/assets/css/kec-cart.css

With the inclusion of On-site Messaging into Klarna Payments introduced in version 3.5.0, the list above has been updated. This means that you will need to update your list of excluded files if you haven’t done so after the release of KP 3.5.0.


Go live


When the installation is done and you are ready to go live you need to contact Klarna integration support. Klarna will then verify the integration before the shop goes live.