Klarna Docs - Klarna Payments on PrestaShop
Klarna Payments on PrestaShop

The Klarna Payments for PrestaShop module can be downloaded from the PrestaShop Marketplace for free.

Once installed and activated, the module's settings can be found by selecting Configure next to the Klarna Payments module in your store's Module Manager or under the IMPROVE section: Payment -> Payment Methods.

Prerequisites

  • When using the Klarna Payments for PrestaShop module, for a direct integration of Klarna Payments, you will need a Klarna merchant account, for which you can sign up here.
  • SSL certificates are required for all of your interactions with Klarna APIs.

Test mode allows you to test your integration to ensure it is working properly before taking real orders, and is the default setting. Orders placed while in test mode will not cause any real money to be exchanged. Selection "Production" enables live (production) mode and orders that are placed in live mode are real, valid orders. You can sign up for test credentials here.

API endpoint specifies the region your credentials are valid for (Europe, North America, or Oceania).

You can generate your Klarna API credentials in the Settings (or Integration Guides) app of the Klarna Merchant Portal. These will consist of a username and password.

Once generated, you can enter these credentials in the API Username and API Password fields.

More info detailed below, but some highlighted features:

  • SSL certificates are required for all of your interactions with Klarna APIs.
  • Version 1.5.8+ (2024-Sep) includes Sign in with Klarna.
  • Version 1.5.7+ (2024-Aug) redesigned Back Office admin.
  • Version 1.5.0+ (2024-Feb) supports One-page checkout’s using Klarna’s HPP.
  • Version 1.4.0+ (2024-Jan) supports Klarna’s Express Checkout.
  • Version 1.3.0+ (2023-Sep) includes On-site messaging.
  • Version 1.0.3+ (2023-Jun) Initial release.
  • PrestaShop version: 1.7.2.x - 8.1
  • PHP version: 7.1.x - Latest version compatible with PrestaShop 8
  • 2 decimals are recommended (but zero decimals support is supported for some PrestaShop versions with v1.5.4+)

There are two ways that the module can be installed in PrestaShop:

  • Log into Backoffice.
  • Navigate to Modules -> Modules Manager menu.
  • Click on the Upload a Module button, and a dialog box will appear.
  • Drag & drop or select from the file browser klarnapayments.zip file to Upload a module dialog.

You will receive the "Module installed!" success message

  1. Download the klarnapayments.zip file to your computer.
  2. Extract it.
  3. Upload klarnapayments folder using an FTP client (such as FileZilla) into the PrestaShop modules directory.
  4. Log into Backoffice.
  5. Navigate to Modules -> Modules Catalog menu.
  6. Type the module name in the search.
  7. Hit the Install button to finish the installation.

After installation you will be able to go to configure straight from the pop-up, however, you can also later find the Klarna Payments module in the PrestaShop back office, under IMPROVE -> Modules -> Module Manager

You can search for “Klarna” in the search field at the top of the Module Manager page.

You can also find Klarna under IMPROVE -> Payment -> Payment Methods.

Click “Configure” to access module settings

If using the multi-shop feature, first you must select the desired shop to configure.

The Settings page is divided into separate sections. In this tab, you will have to establish the connection with the Klarna credentials and configure the main settings.

Multiple regions and environments (Test, Production) can be configured.  API username, API Password, and Client ID/identifier can be retrieved from the Klarna Merchant Portal, under Payments settings (bottom left menu).

To create a Klarna test account, you need to access the Klarna Playground environment. There you will be able to select the API endpoint you want.

Klarna Payments should be enabled if you have a direct merchant account with Klarna, and those Klarna API credentials are used in this module for Klarna as a payment method in your shop’s checkout.

In the PrestaShop order settings section, you will have the option to map Klarna order states to PrestaShop order statuses.

By default, these statuses are used:

  • Status for New orders - Payment accepted
    This state defines orders when the payment was not captured by the merchant.
  • Status for Captured orders - Shipped
    This state defines orders that have captured the payment.
  • Status for Canceled orders - Canceled
    This state defines orders that have been canceled.
  • Status for Refunded orders - Refunded
    This state defines orders for which the order has been refunded.
  • Status for Partially captured orders - Partially captured
    This state defines orders that have been partially captured

If you need to change these statuses, simply click on the drop-down menu, and it will show all of the available states created in your PrestaShop system. Select the desired status, the one that suits your store processes the best.

Capture upon fulfillment settings

In the 1.0.4+ module version, the capture upon order fulfillment feature was introduced. It allows you to capture the order when the desired PrestaShop status is selected. As soon as the order is updated to the defined PrestaShop order status, the payment is captured. The Klarna order capture API call gets triggered when the PrestaShop order is set to one of the configured statuses.

This section has two fields that control the whole functionality

  • Capture Klarna order upon fulfillment of PrestaShop order status update - this switch enables or disables the capture on fulfillment functionality.
  • Order statuses - it is a dropdown list, where you select the order statuses, on which Klarna payment gets captured.

You enable the capture upon fulfillment and select the order status on which the order is captured and press the “Save” button. In this case, the status is “Shipped”.

A new order is created, and it is set to the “Payment accepted” status, as configured in the Order Status Mapping section of the Klarna module.

As soon as the order is set to the status “Shipped” it gets automatically captured as the order was fulfilled.

In the Additional settings section, you will be able to activate module debug mode and other settings.. With this “Enable debug mode” enabled, you will see full integration logs. We recommend enabling this feature only for debugging purposes. More details about the Logging functionality can be seen in the Logs section.

In the Logs tab, you can review the recorded events between the web services and store data that could be used to identify the problems that clients are experiencing.

Basic information

To review the events visually quicker and identify the major issues faster there are 4 severity levels of the events that will be highlighted in different colors in the events list. The explanation of the event's colors can be found in the Severity levels section at the top of the page in the Logs tab.

The logs list can be also filtered by:

  • ID - event ID;
  • Severity level (1-4) - number of severity levels from 1 to 4;
  • Message - full message text or part of the message text;
  • Correlation ID - Klarna response identifier;
  • Date (from, to) - there are two options two enter the date - you can either select the date in the calendar or enter the date manually in mm/dd/yyyy format.

Once you enter the details that you want to filter your events list by, all you need to do is to click the Search button.

Detailed log information

You can also see additional information for each logged event. Most of the logs will have:

  • Request - full request data that is sent from the module to Klarna API, including HTTP headers and raw body.
  • Response - full response data that is received from Klarna API, including response status code, headers, and raw body.
  • Context - additional context data that is associated with each logged row
  • Correlation ID - an identifier that each Klarna response will have. It can help to trace specific issues with Klarna support.

You see more details by clicking the “View” button for each row.

US tax

Specifically for the US, tax is transmitted to Klarna as a separate order line item. In other regions the tax is transmitted to Klarna with each order line. This is done following the best practices defined in Klarna Payments docs.


Currency

To be supported, the currency for your shop must be configured for your Klarna merchant account.  Supported currencies available for Klarna Payments docs.


One-Page Checkout Compatibility

As of version 1.5.0 [2024-Feb], this module offers increased compatibility for Prestashop's one-page checkout functionality, e.g. The Checkout, using Klarna’s Hosted Payment Page [HPP], rather than inline for Klarna Payments.  If the module detects  a shop is using a one-page checkout, the HPP option will be enabled automatically, but shop admins can manually configure the option also. 

Extra Merchant Data

In some cases, Klarna requires additional information regarding the customer and the purchase in order to make a correct risk assessment. This information, called extra merchant data (EMD), may consist of data about the customer performing the transaction, the product/services associated with the transaction, or the seller and their affiliates.

Extra Merchant Data was included from version 1.2.0+, and as of v1.5.7+, EMD is sent for unique_account_identifier, account_registration_date  and account_last_modified in the customer_account_info schema data, included in the attachment field by default.  Merchants can customize EMD according to their shop’s needs for their Klarna contract.  For a merchant, the additional customer information can be found in the Klarna Payments module Logs tab.  Additional information about customizing EMD is included in the Technical documentation, included in the module zip file.

Klarna Payment Method Translations

Conveniently, Klarna payment methods are translated automatically depending on the language that is selected for your shop.

If you have a multilingual shop, all your customers will have to do is select a language that they prefer.

Whichever language you select, the payment methods will be translated into that language, as supported by Klarna Payments.


Adding new languages

You can easily install new languages in PrestaShop at IMPROVE -> International -> Localization. Firstly, select the needed language from “Content to import” and import a new localization pack by clicking the “Import” button. All imported languages will appear in your shop, and your customers will be able to choose them when shopping.

The order management in this Invertus module works differently compared to previous PrestaWorks Klarna modules, particularly you need to configure the capture upon fulfillment feature for orders to captured upon fulfillment. Even if you have used a Klarna module in PrestaShop previously, please review this section carefully.

Klarna module allows you to manage and see the order information. To see that you need to navigate to the Orders -> Orders page in the PrestaShop admin panel.

There you will find all of the orders created in your shop including those processed by the Klarna module. Those orders will be set to different statuses depending on the payment state. You can see additional order information by clicking on the “View” button.

Since version 1.0.4, order capture upon fulfillment feature was added, providing 3 ways to capture your orders. 

You can capture orders automatically when it reaches the desired PrestaShop order status using the Capture upon fulfillment functionality, please refer to that section of the document.

You can also capture manually from the PrestaShop orders management page. 

If the order was processed by the Klarna system in the detailed order view you will see a new section added.

To capture the order, click the first button with the label CAPTURE PAYMENT. Once the button is clicked the payment will be captured and the order status will be set to the one that was defined in the Order Status Mapping settings.

While orders can also be managed within the Klarna Merchant Portal, it is recommended to do order management within your PrestaShop admin to keep the data in sync between Klarna and your shop.  Updates made in the Klarna Merchant Portal will not update the order in your PrestaShop store.  

You can access the Klarna Merchant Portal order by clicking the Klarna reference number. Inside the Klarna merchant portal, you can view more information about the order and transaction information.

Before an order is captured, you could cancel it. To cancel, click the CANCEL ORDER button and the order status will be set to the one that was defined in the Order Status Mapping settings.

As of version 1.1.0, partial capture is supported. You can select items that can be captured from your order management page, or capture the order amount instead of the items included in the order. To partially capture orders, you need to click on the CAPTURE ORDER button on the order management page.  You will get a modal that displays the order's line items in more detail, you will see all of the items that are available to capture as well as the total amount.

To capture individual items you need to select the checkbox for the desired order line items. Once that is done the amount to be captured will appear on the button and it will become active. Keep in mind that you are not able to capture more than the order amount that is available to capture, so if that becomes the case, the button will become inactive once again.

Similarly, with order amount capture, you enter the amount in the field which is presented when you click the link Capture amount.

You can partially capture orders as long as there is available funds to capture.

As soon as you partially capture the order status will be set to the one that was defined in the Order Status Mapping settings.

All of the captures can be seen in PrestaShop Klarna order details, and in the Klarna Merchant Portal.

Only captured Klarna orders can be refunded.

In the order list you will see orders with the status “Payment accepted”, these orders can be refunded. The refund can be initiated by clicking the Refund button on the order management page. Once the order is captured the Klarna section will change and have the refund button.

When the button is clicked you will see a modal with items available for refund action. To initiate a full refund select all of the items (or enter the whole order amount) and click refund.

As soon as you issue the refund the order status will be set to the one that was defined in the Order Status Mapping settings.

The list of refunds can be seen in PrestaShop Klarna order details, and in the Klarna Merchant Portal.

Partial refund functionality was included in the 1.2.0 Klarna Payments module version. Same as with the Partial Capture, you can refund part of your Klarna order or a selected amount of that order.

To partially refund an order, you need to navigate to the orders management page, click on the order that was captured, or at least partially captured. Same as for a full refund, you will find a refund button in the Klarna Payments management section.

Once the button is clicked a modal will open up and there you will be able to either refund items or the amount you define.

As of version 1.2.0, Shipment Tracking Information feature was included. When you capture the order, shipping information is automatically sent to Klarna with the order’s capture call.

The customer’s initial payment method cannot be displayed on the order confirmation page, and thus the same field in the PrestaShop back office, as Klarna only provides this initial payment method data for an order in English. 

The setting “Enable automatic order status change” allows you to manage how the PrestaShop order statuses should behave based on Klarna order status. The toggle option can be found in the "Additional settings" section.


By default the toggle is enabled meaning that:

  • PrestaShop order statuses will be updated according to Klarna's order status
  • The update is done only once to the same status, so you can still set custom order status if needed, as it will not be overridden.

If the toggle is deactivated:

  • PrestaShop statuses will not be updated according to Klarna, only the initial status for new orders will be added, allowing you to customize PrestaShop statuses to your liking.

Depending on the customer's country, and possibly the merchant account configuration, different Klarna payment options may be available. 

Depending on the country selected in the PrestaShop checkout address fields, your customers will see different payment method titles. Every Klarna payment option can be identified by the Klarna logo.

Before confirming the order, the customer will be able to see the payment options chosen, the amount that is required to be paid today, and the total cost.

Support requests (about Klarna account related issues) can be submitted to http://klarna.com/merchant-support 

For module related issues, support is available at :

support@invertus.eu

Compatibility with non-standard themes is not guaranteed or supported.

It is recommended for merchants to stay up to date on the latest versions of the module to get the latest fixes and functionality, and support.  Prior to requesting support, please ensure the shop is updated to the latest version.

“Validation failed for checkout. Contact support.“ error

Root cause may be due to non-standard theme; test with a standard theme to confirm.