Klarna Payments in PrestaShop

The Klarna Payments module for PrestaShop allows seamless integration of Klarna’s payment solutions into your store.

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

null

Klarna settings in Prestashop

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

null

Credentials settings in Prestashop

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.

null

Payments settings in Prestashop

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.

null

Prestashop order settings

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.

null

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.

null

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.

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.

null

Klarna payment descriptor in Prestashop

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.