Try our conversational search powered by Generative AI!

Klarna payment provider - installation and user guide

This document describes how to install and use the Klarna payment provider, one of several payment solutions available for EPiServer 7.5 Commerce.

Apps folder

In EPiServer Commerce 7.5, the Apps folder is located in the EPiServer Commerce Manager Shared Files Folder, typically C:\EPiServer\<YourCommerceManagerSite>\eCommerceFramework\5.3\Shared.

If your Commerce Manager site has been updated to the latest version via NuGet, the Apps folder should be located in the wwwroot folder, typically E:\ EPiServer \<YourCommerceManagerSite>\wwwroot\Apps.

Refer to this Apps folder as your corresponding path for the Apps folder mentioned below

Installation

Do the following to install the Klarna payment provider source code:

  1. Download and unzip the Klarna payment provider files.
  2. Open the EPiServer.Business.Commerce.Payment.Klarna.csproj in Visual Studio.
  3. Copy the following assemblies from your Commerce back-end site to the Library folder (created this if it does not already exist):
    - EPiServer.dll
    - EPiServer.Data.dll
    - EPiServer.Framework.dll
    - Mediachase.Commerce.dll
    - Mediachase.Commerce.Plugins.Payment.dll
    - Mediachase.Commerce.Website.dll
    - Mediachase.MetaDataPlus.dll
    - Mediachase.WebConsoleLib.dll
    - log4net.dll
  4. Copy CookComputing.XmlRpcV2.dll and KlarnaAPI.dll from the Klarna\Lib folder to the Library folder.
  5. Add references to those assemblies and rebuild the project.
  6. Copy the EPiServer.Business.Commerce.Payment.Klarna.dll to the bin folder in both the Commerce front-end and back-end sites.
  7. Copy the two files CookComputing.XmlRpcV2.dll and KlarnaAPI.dll in the Klarna\Lib folder to the bin folder in both the Commerce front-end and back-end sites.
  8. Copy all of the xml files in the EPiServer.Business.Commerce.Payment.Klarna project lang folder to the lang folder in the Commerce front-end site.
  9. a. For Klarna Invoice:
    - Create a folder named KlarnaInvoice in \Templates\Sample\Units\CartCheckout in the Commerce front-end site.
    - Copy these files and folders: PaymentMethod.ascx and ClientResources folders in Klarna\KlarnaInvoice to the KlarnaInvoice folder which has been created.
      
    b. For Klarna Part Payment:
    - Create a folder named KlarnaPartPayment in \Templates\Sample\Units\CartCheckout in Commerce the front-end site.
    - Copy these files and folders: PaymentMethod.ascx and ClientResources folder in Klarna\KlarnaPartPayment to the KlarnaPartPayment folder which has been created.
  10. a. For Klarna Invoice:
    - Create a folder named KlarnaInvoice under Apps\Order\Payments\Plugins\.
    - Copy the ConfigurePayment.ascx file in Klarna\KlarnaInvoice to the KlarnaInvoice folder which has been created.
      
    b. For Klarna Part Payment:
    - Create a folder named KlarnaPartPayment under Apps\Order\Payments\Plugins\.
    - Copy the ConfigurePayment.ascx file in Klarna\KlarnaPartPayment to the KlarnaPartPayment folder which has been created.
  11. a. For Klarna Invoice:
    - Copy the Klarna\MetaData\KlarnaInvoice folder to Apps\Order\Payments\MetaData.
     
    b. For Klarna Part Payment:
    - Copy the Klarna\MetaData\KlarnaPartPayment folder to Apps\Order\Payments\MetaData.
  12. Copy the Library\Mediachase.WebConsoleLib.dll file to the bin folder of Commerce front-end site.

Configuration

Follow the steps below to configure Klarna in Commerce Manager.

  1. In Commerce Manager, go to Administration > Order System > Payments > Your country.
  2. Click New to create a new payment method. An example of the configuration is shown below.
        


  3. In the Overview tab, enter the following required information for the Klarna Invoice or Part Payment methods respectively:

    Field name For Klarna Invoice For Klarna Part Payment
    Name Klarna Invoice

    Klarna Part Payment

    Description Klarna Invoice payment gateway Klarna Part Payment gateway
    System Keyword KlarnaInvoice KlarnaPartPayment
    Language

    The language of your choice

    The language of your choice
    Class Name EPiServer.Business.Commerce.Payment.
    Klarna.KlarnaInvoice.KlarnaPaymentGateway
    EPiServer.Business.Commerce.Payment.Klarna.
    KlarnaPartPayment.KlarnaPaymentGateway
    Payment Class EPiServer.Business.Commerce.Payment.Klarna.
    Orders.KlarnaPayment
    EPiServer.Business.Commerce.Payment.Klarna.
    Orders.KlarnaPayment
    IsActive Yes Yes
    IsDefault No No
    Supports Recurring No No
    Restricted Shipping Methods

    Add only if you want to restrict any shipping method.

    Add only if you want to restrict any shipping method.
         
  4. Click OK to save the data.
  5. Go back to the Parameters tab to add more information, see examples below. Note that the Merchant ID and Shared secret string in the sample images are for demonstration, you need to register an account with Klarna to get a live one.
       
    Configuration example for Klarna Part Payment.
       

          
    Configuration example for Klarna Invoice.
       

         
  6. Enter the following required information:
    Field name Description Value

    Test mode

    If you set this flag, an invoice is created in test mode, even if your store is fully operational.
    Recommended for testing without disrupting regular invoicing.

    Yes or No
    Merchant ID

    An e-store ID referring to your store in Klarna's database. This ID is provided by Klarna.

    Sample value: 1477
    Shared secret

    A shared secret used to secure all traffic exchanged by Klarna and your store. This string is provided by Klarna.

    Sample value: hy1MNgj4eES2JIu

    Allow different address

    If this flag is checked, the EPiServer Commerce system will not verify the address entered by a customer.
    Instead it will depend totally on Klarna to verity the address.

    Yes or No
    Update pclasses button Only for Klarna Part Payment: this will update the pclasses from Klarna. Click button to update
       
  7. Click OK to save the data.
  8. Go to the Markets tab and add the expected markets for this payment.
       

         
  9. Add the following setting to the <system.serviceModel >\<services > node to the web.config of your Commerce front-end site:
      
    <service behaviorConfiguration="CommerceSiteBehavior" name="EPiServer.Business.Commerce.Payment.Klarna.Services.KlarnaService">
    <endpoint address="" binding="webHttpBinding"
    contract="EPiServer.Business.Commerce.Payment.Klarna.Services.IKlarnaService"
    behaviorConfiguration="CommerceSiteBehavior" />
    </service>
      
  10. Copy the KlarnaService.svc file in the Klarna\Services folder to the Services folder in your Commerce front-end site (create if the folder does not already exist).
  11. In Commerce Manager, navigate to Administration > Order System > Meta Classes, and click Import MetaData to populate the MetaData import screen. Then select the Klarna\KlarnaPaymentMetaClass.xml file to import.

Using Klarna part payment

When you have deployed and configured the Klarna payment provider, it will appear as an option in the checkout procedure. See below for examples of how Klarna Part Payment appears with different country settings.

Placing an order

  1. Add item(s) to a shopping basket and proceed to checkout.
  2. Select a shipping address, shipping option and continue to payment options.
  3. Depending on your current country in the billing address, different forms for input will appear.

Sweden, Finland, Denmark and Norway

The following applies for customers from Sweden, Finland, Denmark and Norway:

  1. In the Payment Method section, select the Klarna Part Payment option.
  2. In the field Social Security No, enter your social security number.
  3. Click Continue to place the order. NOTE that Klarna Part Payment will not accept a company account.
       

Netherlands and Germany

The following applies for customers from Netherlands and Germany:

  1. In the Payment Method section, select the Klarna Part Payment option.
  2. Enter Gender, Date of birth, House number and House extension (optional).
  3. Click Continue to place the order.
       

        
  4. If your order is processed successfully, you will see your order number. An e-mail is also sent to you to confirm your order.
        

         
  5. If you are a store owner, you can see the details of the order in the invoice part of the Klarna system. You can use the TestPerson from Klarna for testing, find out more here: https://integration.klarna.com/en/testing/test-persons.

Using Klarna invoice

When you have deployed and configured the Klarna payment provider, it will appear as an option in the checkout procedure. See below for examples of how Klarna Invoice appears with different country settings.

Placing an order

  1. Add item(s) to a shopping basket and proceed to checkout.
  2. Select a shipping address, shipping option and continue to payment options.
  3. Depending on your current country in the billing address, different forms for input will appear.

Sweden, Finland, Denmark and Norway

The following applies for customers from Sweden, Finland, Denmark and Norway:

  1. In the Payment Method section, select the Klarna Invoice option.
  2. In the Social Security No field, enter a Company registration no for a company, then click Continue to select an address from the list.
  3. Click Continue again to place the order.
        

Netherlands and Germany

The following applies for customers from Netherlands and Germany:

  1. In the Payment Method section, select the Klarna Invoice option.
  2. Enter Gender, Date of birth, House number and House extension (optional).
  3. Click Continue to place the order.
       

        
  4. If your order is processed successfully, you will see your order number. An e-mail is also sent to you to confirm your order.
  5. If you are a store owner, you can see the details of the order in the invoice part of the Klarna system. You can use the TestPerson from Klarna for testing, find out more here: https://integration.klarna.com/en/testing/test-persons.