Klarna (v2)

In the beginning of 2021 Klarna will retire their old Klarna Checkout v2 (KCOv2) and Klarna Payment Gateways (KPM). The plugins we here at Krokedil have developed replaces those old plugins.

If you’re still using KPM you should therefore upgrade to Klarna Payments for WooCommerce and if you’re still using KCOv2 you should upgrade to Klarna Checkout for WooCommerce.

You can read more about this in the post Klarna retires the v2 platform.

The Klarna extension provides the integration with WooCommerce, allowing you to take payments via Klarna and its three payment methods — Checkout, Invoice and Part Payment.

This plugin integrates with Klarnas older V2 platform. You need an agreement with Klarna specific to the V2 platform to use this plugin.

  • Klarna only works in Sweden, Denmark, Finland, Norway, Germany, Austria, the Netherlands, UK and United States
  • You need an agreement with Klarna for each country and payment method you plan to sell to/with. Contact Klarna for more information about available payment alternatives for your country
  • An SSL Certificate is required for the UK and United States
  • PHP version 5.5 or higher is required

Installation


  1. Download the .zip file here.
  2. Go to: WordPress Admin > Plugins > Add New to upload the file you downloaded with Choose File.
  3. Click Install Now
  4. Activate the extension.

More information at: Installing and Managing Plugins.


Required WooCommerce settings


  • 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: Invoice payment


  1. Go to: WooCommerce > Settings > Checkout > Klarna Invoice.
  2. Enable Klarna Invoice by checking the Enable Klarna Invoice checkbox.
  3. The Title and Description fields controls what the customer sees during checkout.
  4. On order completion – Check this box if you want to activate orders in Klarna automatically when the order is marked as Complete in WooCommerce.
  5. On order cancellation – Check this box if you want to cancel orders in Klarna automatically when the order is marked as Cancelled in WooCommerce.
  6. On order update – Check this box if you want to update orders in Klarna automatically when line items are updated in a WooCoommerce order.
  7. Enter your EID and Shared Secret for the country that you have an agreement with Klarna to sell to.
  8. Lower threshold – If Cart total is less than the specified value, Klarna Invoice will be disabled in Checkout.
  9. Upper threshold – If Cart total is greater than the specified value, Klarna Invoice will be disabled in Checkout.
  10. Invoice Fee – Enter the product ID of your Invoice Fee product. More information about this can be found in the Invoice Fee Handling section below.
  11. Send billing address as shipping address – Check this box if you want to send the entered billing address in WooCommerce checkout as shipping address to Klarna.
  12. Klarna consent terms – Enable Klarna consent terms checkbox in checkout. This only apply to German merchants.
  13. If you have applied for and received a testaccount, then you must check the Enable Klarna Testmode checkbox.
  14. Save your settings.

Invoice fee handling

The invoice Fee for Klarna Invoice are added as a simple (hidden) product. To create a Invoice fee product:

  1. Add a simple (hidden) product. Mark it as a taxable product. For more information on how to add a simple (hidden) product please check WooCommerce documentation page on Adding and Managing products.
  2. Go to the Klarna Gateway settings page and add the product ID (not the price or the SKU) of the Invoice Fee product. The ID can be found by hovering the Invoice Fee product on the Products page in WooCommerce.

Configuration: Part payment


  1. Go to: WooCommerce > Settings > Checkout > Klarna Part Payment
  2. Enable Klarna Invoice by ticking the Enable Klarna Part Payment checkbox.
  3. Title and Description fields control what the customer sees during checkout.
  4. On order completion – Check this box if you want to activate orders in Klarna automatically when the order is marked as Complete in WooCommerce.
  5. On order cancellation – Check this box if you want to cancel orders in Klarna automatically when the order is marked as Cancelled in WooCommerce.
  6. On order update – Check this box if you want to update orders in Klarna automatically when line items are updated in a WooCoommerce order.
  7. Enter your EID and Shared Secret for the country that you have an agreement with Klarna to sell to.
  8. Lower threshold – If Cart total is less than the specified value, Klarna Part Payment will be disabled in Checkout.
  9. Upper threshold – If Cart total is greater than the specified value, Klarna Part Payment will be disabled in Checkout.
  10. Send billing address as shipping address – Check this box if you want to send the entered billing address in WooCommerce checkout as shipping address to Klarna.
  11. Klarna consent terms – Enable Klarna consent terms checkbox in checkout. This only apply to German merchants.
  12. If you applied for and received a test account, then you must check the Enable Klarna Testmode checkbox.
  13. Save your settings.

Configuration: Klarna Checkout


  1. Go to: WooCommerce > Settings > Checkout > Klarna Checkout
  2. Enable Klarna Checkout by checking the Enable Klarna Checkout checkbox.
  3. Get in contact with Klarna and inform them that you are about to set up a store using Klarna Checkout. They will send you a temporary EID and Shared Secret for testing purposes. Klarna Checkout will NOT work with your Klarna checkout credentials yet. You will get a fatal error if you use credentials from an account that not has been set to live mode.
  4. On order completion – Check this box if you want to activate orders in Klarna automatically when the order is marked as Complete in WooCommerce.
  5. On order cancellation – Check this box if you want to cancel orders in Klarna automatically when the order is marked as Cancelled in WooCommerce.
  6. On order update – Check this box if you want to update orders in Klarna automatically when line items are updated in a WooCoommerce order.
  7. Create a new page that act as the Checkout page for Klarna Checkout.This page can not act as the standard WooCommerce Checkout page.This page must contain the shortcode [woocommerce_klarna_checkout], but can also contain one or several extra shortcodes for added functionality. Read more about how to configure the checkout in the section Configurating the Klarna Checkout page below.
  8. Enter the full URL to the just created Checkout page for Klarna Checkout in the settings field Custom Checkout Page.
  9. If you want a separate page to act as the thank you page, enter the full URL to that page in the settings field Custom Thanks Page.
  10. Default Checkout Country – This is used by the payment gateway to determine which country should be the default Checkout country if Euro is the selected currency, you as a merchant has an agreement with multiple countries that use Euro and the selected language can’t be of help for this decision.
  11. Modify Standard Checkout – Check this box if you want to use the Klarna Checkout page as the default checkout page (i.e. changing the url of the checkout buttons in Cart and the Widget mini cart).
  12. Button to Standard Checkout – Check this box if you want to add a button on the Klarna Checkout page that links to the Standard Checkout Page.
  13. Label for Standard Checkout Button – Enter the text for the button that links to the Standard Checkout page from the Klarna Checkout page.
  14. Button to Klarna Checkout – Check this box if you want to add a button on the WooCommerce standard checkout page that links back to the Klarna Checkout page.
  15. Label for Standard Checkout Button – Enter the text for the button that links back to the Klarna Checkout page from the standard checkout page.
  16. Terms Page – Add the full URL to your terms page. You can also specify a terms page in WooCommerce standard settings. A terms page must be specified in one of these two places for Klarna Checkout to work.
  17. Create customer account – Check the box if you want to automatically create an account for new customers. “Automatically generate customer password” must be checked in WooCommerce Accounts Settings page.
  18. Send New account email when creating new accounts – check the box of you want to send the WooCommerce New account email when creating an account for a new customer.
  19. Account Signup Text – Add text above the Account Registration Form. Useful for legal text for German stores. Leave blank to disable.
  20. Account Login Text – Add text above the Account Login Form. Useful for legal text for German stores. Leave blank to disable.
  21. Test Mode. Check this box to enable Klarna Test Mode. This will only work if you have a Klarna Checkout test account.
  22. Debug – Enable logging. The log messages can be displayed by navigating to:
    –> WooCommerce –> System Status –> Logs
  23. Design options
    To make Klarna Checkout fit your e-store’s visual design and brand colors, you have the option to set the color of certain elements in Klarna Checkout. The following elements can be modified:
    – Checkout button color
    – Checkout button text color
    – Checkout checkbox color
    – Checkout checkbox checkmark color
    – Checkout header color
    – Checkout link color
  24. Automatically activate recurring orders – If this option is checked, recurring orders (together with the WooCommerce Subscriptions extension) will be activated automatically when a renewal order is created in WooCommerce.
  25. After you have saved the Klarna Checkout settings, you can start making test purchases (still with the test credentials obtained from Klarna). Use customer testing credentials from developers.klarna.com/en.

Configuring the Klarna Checkout page


The page used for rendering the Klarna Checkout form can be set up in different ways to suit your needs.

  • The page must contain the shortcode [woocommerce_klarna_checkout]
    (for displaying the checkout form).
  • The page can optionally contain the shortcode [woocommerce_klarna_checkout_widget]
    (for displaying cart items, coupon handling and shipping alternatives).
  • The page can optionally contain the shortcode [woocommerce_klarna_country]. This shortcode displays a country selector that makes it possible for your customers to select their country if you have an agreement to sell with Klarna Checkout for more than one country that uses Euro as currecy.

Responsive layout

To get a responsive checkout with the cart item widget on the left and the checkout form on the right, add shortcodes with the following attributes:

[woocommerce_klarna_checkout_widget col="left"]

[woocommerce_klarna_checkout col="right"]

On smaller screens, the cart item widget is displayed at the top of the page and the checkout form below.

Shortcode attributes

The [woocommerce_klarna_checkout_widget] shortcode accepts additional (optional) parameters:

  • hide_columns
    – remove (the remove product from cart button column).
    – price (the item price column).
  • order_note
    – hide (removes the order note input field)

Example

[woocommerce_klarna_checkout_widget col="left" hide_columns="remove,price" order_note="hide"]

Configuration: Klarna Checkout for German stores


If Klarna Checkout is used in German stores, be aware of:

1. Account Signup page

If it’s possible for the customer to create an account in the store, this text should be displayed for the customer on the signup page:

English version:

We use Klarna Checkout as our checkout, which offers a simplified purchase experience. When you choose to go to the checkout, your email address, first name, last name, date of birth, address and phone number may be automatically transferred to Klarna AB, enabling the provision of Klarna Checkout. These User Terms apply for the use of Klarna Checkout.

German version:

In unserem Kassenbereich nutzen wir Klarna Checkout. Dazu werden Ihre Daten, wie E-Mail-Adresse, Vor- und Nachname, Geburtsdatum, Adresse und Telefonnummer, soweit erforderlich, automatisch an Klarna AB übertragen, sobald Sie in den Kassenbereich gelangen. Die Nutzungsbedingungen für Klarna Checkout finden Sie hier.

These User Terms and/or Sie hier in the text above should link to https://cdn.klarna.com/1.0/shared/content/legal/terms/EID/de_de/checkout

Note that “EID” in the URL needs to be changed to your stores actual EID.

2. Account Login page

When pre-population of form fields in Klarna Checkout is activated for logged-in customers, the following text needs to be visible on the login page:

Ich stimme den Nutzungsbedingungen und der Anwendung meiner Daten in der Express Kasse zu.

Nutzungsbedingungen should contain a link to: https://cdn.klarna.com/1.0/shared/content/legal/terms/{EID}/de_de/checkout

Note that {EID} in the URL needs to be changed to your stores actual EID.

3. Terms page

On the Terms page, under “Zahlung”, the following text should be presented:

Zahlung In Zusammenarbeit mit Klarna bieten wir die folgenden Zahlarten an:

  • Klarna Rechnung: Zahlbar innerhalb von 14 Tagen ab Rechnungsdatum. Die Rechnung wird bei Versandt der Ware ausgestellt. Die Rechnungsbedingungen finden Sie hier.
  • Klarna Ratenkauf: Mit dem Finanzierungsservice von Klarna können Sie Ihren Einkauf flexibel in monatlichen Raten von mindestens 1/24 des Gesamtbetrages (mindestens jedoch 6,95 EUR) bezahlen. Weitere Informationen zu Klarna Ratenkauf einschließlich der Allgemeinen Geschäftsbedingungen und der europäischen Standardinformationen für Verbraucherkredite finden Sie hier.
  • Sofortüberweisung
  • Kreditkarte (Visa/ Mastercard)
  • Lastschrift

Informationen darüber, welche Zahlarten für einen konkreten Einkauf zur Verfügung stehen, erhalten Sie im Kassenbereich. Allgemeine Informationen zu Klarna erhalten Sie hier.

Here there are also two URLs where the EID needs to be updated — one under Klarna Rechnung and one under Klarna Ratenkauf.

4. Checkout page

  • Klarna Checkout should be presented with the title “Express-Kauf”
  • Add the following text above the iFrame:

Schließen Sie Ihren Einkauf ab – sicher, schnell & einfach. Beginnen Sie mit der Eingabe Ihrer E-Mail Adresse und Postleitzahl.


Configuration: Klarna Checkout for UK & US


If Klarna Checkout is used in UK and/or U.S. stores, be aware of.

  • U.S. and UK merchants may allow customers to ship to an address different than the billing address
  • U.S. and UK merchants also have the possibility to choose which countries to ship to
  • HTTPS is required for U.S. and UK merchants.

Sell to multiple countries


By default, you as a merchant agree to sell to customers in one country. If you wish to sell to customers in multiple countries you need:

  1. An agreement with Klarna for each country
  2. Ability for your store to change currency and country code to be consistent with the country the customer originates

For example, if you have a Swedish store where the base country is set to Sweden and the currency is SEK, and you have a Norwegian customer who wants to pay via Klarna, your store must switch to currency NOK and at the same time inform Klarna that it is a Norwegian purchase.

The Klarna payment gateway is prepared for this, but you need to install additional plugins or have a custom solution to accommodate because WooCommerce doesn’t support multiple currencies out of the box.

Multiple currencies in WooCommerce

To enable support for multiple currencies, you need to use one of these options:

Update your Klarna payment gateway settings

Once you have created multiple currencies and you see that it works in your store, your Klarna settings need to be configured.

  1. For each country you have an agreement with Klarna, you fill in Eid and Shared Secret on the settings page for the specific payment method.
  2. For Klarna Checkout it’s also important that you add the Checkout page and Thank you page for each country, even if these pages are the same for all countries (this feature is mainly developed for those who also have different languages in their store).
  3. Also remember that for Klarna Checkout each Checkout page and Thank you page need to have the shortcode [woocommerce_klarna_checkout] pasted on the page.

Once this is done, everything should work. If you’re using Klarna Checkout, do not enable a currency switcher feature on the actual KCO checkout page. This may cause some issues with the order in Klarnas system if the customer switches currency after the Klarna Checkout page is rendered.


Payment Method Widget


The payment method widget informs consumers which payment methods you offer, and helps increase your conversion. The part payment widget automatically determines which payment method is the most appropriate for this product and calculates the total monthly cost for the consumer according to applicable laws and regulations.

For products with a price from (approximately) 3 000 SEK the widget will display an example of the monthly cost when paying with Klarna Part payment. For products with a price lower than that the widget will display a generic “Pay with Klarna” notice.

  1. Navigate to –> WooCommerce –> Settings –> Products –> Klarna Payment Method Widget.
  2. Monthly cost – Check the box to display the payment method widget on single product pages.
  3. Monthly cost placement – Select where to display the widget in your product pages.
  4. Lower threshold – If the product price is lower than the threshold, the widget will not be displayed.
  5. Upper threshold – If the product price is higher than the threshold, the widget will not be displayed.

Payment Method Display


By using Klarna’s Payment method display you generate trust and increase your conversion. Once you’ve done this, you’ll never have to update your Payment method display again. Klarna host them for you, ensuring maximum availability and fast loading times.

  1. Navigate to → AppearanceWidgets.
  2. Drag the widget Klarna Payment Method Display Widget into one of your themes available widget areas.
  3. You can now configure the appearance of the widget via the following settings:
    Design: Long or short
    Color: Blue or white
    Width: The width in pixels that the image should be rendered in.

Order management


When an order is created in WooCommerce and a reservation number exists in Klarnas system, you have the possibility to handle the order management in Klarna directly from WooCommerce. This way you can save time and don’t have to work in both systems simultaneously.

Read more about Klarna order management here.


Subscription support


Klarna Checkout is compatible (in Sweden and Norway) with the WooCommerce Subscriptions extension for handling of recurring payments.

Read more about recurring payments with Klarna here.


After Installation


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. If you don’t do this you risk getting a lot of test orders that will disappear when the shop goes live.


FAQ


Can Klarna replace the checkout page? Can it be used with other gateways?

Yes, you can set the option Button to Standard Checkout in the Klarna plugin configuration. This adds a button to the Klarna checkout page that links to the standard checkout page. Other payment gateways will display as usual on the checkout page.


Troubleshooting


Checkout isn’t displayed on the page that I set as the checkout page.

Make sure that:

  • Klarna Checkout is enabled in the plugin settings
  • The right shortcode( [woocommerce_klarna_checkout] ) does exist on the selected checkout page.
  • There is a terms page set in WooCommerce or that a terms URL (including http://) has been entered in the plugin settings.
  • The Klarna Checkout page doesn’t act as the WooCommerce standard checkout page as well.

The Klarna Checkout page isn’t displayed correctly and/or the KCO Thank you page isn’t displayed when payment is complete.

Ensure that the Klarna Checkout page isn’t set as the WooCommerce standard checkout page. This may cause conflicts with WooCommerce.

I see a big chunk of code starting with Fatal error… instead of the Klarna Checkout-iframe.

Confirm that you’re not using your received Klarna merchant credentials before your account actually has been activated. Get in contact with Klarna and inform them of that you are about to configure your store. They will then send you a temporary EID and Shared Secret for testing purposes. Klarna Checkout will NOT work with your Klarna checkout credentials yet. You will get a fatal error if you use credentials from an account that not has been set to live mode.

I get Error code nnnn when trying to make a purchase with Klarna (Invoice, Account or Special campaign).

Take a look at http://developers.klarna.com/en/troubleshooting/xmlrpc-errors and search for the answer.

I get a Fatal error with the message Bad format: merchant.terms_uri, merchant.checkout_uri or merchant.confirmation_uri.

Verify that you have added a valid URL (including http://) in the field for Terms page, Checkout Page or Thanks Page. Also check for, and remove, whitespaces in the beginning and the end of the given URL.

My Klarna Checkout thank you page is not rendering.

If you’re using WordPress SEO by Yoast, make sure option “Redirect ugly URL’s to clean permalinks” (located in SEO > Permalinks) is unchecked.

I get the error: Warning: Invalid argument supplied for foreach() in /wp-content/plugins/woocommerce-gateway-klarna/vendor/klarna/php-xmlrpc/src/JSONDBStorage.php on line 126

It means you are using the same credentials for KCO (Klarna Checkout) and KPM (KPM = Invoice + Part Payment). KCO and KPM are separate systems, credentials for one won’t work for the other. So check your credentials that you have received from Klarna and update them to the correct ones in the plugin settings.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.