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).


  • Order management
    Read more about how to manage Klarna orders directly from WooCommerce.

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


Basic settings

  1. Go toWooCommerce > Settings > Payments > Klarna Payments.
  2. Enable Klarna Payments by checking the Enable Klarna Payments checkbox.
  3. Title – 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. Test mode – Check the Enable Test Mode checkbox to place the payment gateway in test mode using test API keys.
  5. Logging – Check the Log debug messages to save debug messages to the WooCommerce System Status log found in WooCommerce → System Status → Logs.
  6. Log extra data – Check the Log extra data checkbox 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.
  7. Hide What is Klarna? link – If checked, What is Klarna? will not be shown.
  8. Float What is Klarna link – Check this if you want to float the What is Klarna? link to the right.
  9. Product URLs – Check this if you want to send product and product image URLs to Klarna.
  10. 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.
  11. Customer type – Select the customer for the store (B2C or B2B).

Country settings

Each Klarna country has its own set of country specific settings. By adding merchant credentials to a specific country you also enable Klarna Payments as an available payment method for that country.

  1. Production Klarna API username – Enter the API username that you downloaded in the Klarna Merchant Portal.
  2. Production Klarna API password – Enter the API password that you downloaded in the Klarna Merchant Portal.
  3. Test Klarna API username – Username for test purchases that you downloaded in the Klarna Merchant Portal (if you have applied for a test account).
  4. Test Klarna API password – Password for test purchases that you downloaded in the Klarna Merchant Portal (if you have applied for a test account).

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.

Iframe settings

With the iframe settings section you have the possibility to alter the appearance of the Klarna Payments Widget displayed in the checkout. Here you can change things like background colors, button colors and text colors.

Please note that these settings are not available for all accounts.

Klarna On-site Messaging

This is where you configure Klarna On-site Messaging if installed. For detailed documentation please see Klarna On-site Messaging configuration.

Klarna Order Management

This is where you configure Klarna Order Management if installed. For detailed documentation please see Klarna Order Management settings.

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.