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 Commerce.
Note: The Klarna payment provider was removed in version 9.13 of Episerver Commerce. Refer to the Klarna payment provider developed by Klarna, available as a third-party add-on for Episerver 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 was updated to the latest version via NuGet, the Apps folder should be located in the wwwroot folder, typically E:\ EPiServer \<YourCommerceManagerSite>\wwwroot\Apps.
See 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:
- Download and unzip the Klarna payment provider files.
- Open the EPiServer.Business.Commerce.Payment.Klarna.csproj in Visual Studio. Make sure you save the solution in order to be able to install NuGet packages.
- Install Klarna API package by executing the following command in "Package Manager Console": Install-Package Klarna.Net.Api -version 4.0.0.0
- Install EPiServer.Commerce.Core package by executing the following command in "Package Manager Console": Install-Package EPiServer.Commerce.Core (you might want to install the version that your website is using to avoid any assembly confliction might have). Please note that we don't need to apply any database transform or removing Common Framework components.
- Copy the Klarna.Net.Api.dll, CookComputing.XmlRpcV2.dll and EPiServer.Business.Commerce.Payment.Klarna.dll to the bin folder in both the Commerce front-end and back-end sites.
- Copy all of the xml files in theEPiServer.Business.Commerce.Payment.Klarna project lang folder to thelang folder in the Commerce front-end site.
- 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 ClientResourcesfolders 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 ClientResourcesfolder in Klarna\KlarnaPartPayment to the KlarnaPartPayment folder which has been created. - a. For Klarna Invoice:
- Create a folder named KlarnaInvoice under Apps\Order\Payments\Plugins\.
- Copy the ConfigurePayment.ascx file in Klarna\KlarnaInvoice to theKlarnaInvoice folder which has been created.
b. For Klarna Part Payment:
- Create a folder named KlarnaPartPaymentunder Apps\Order\Payments\Plugins\.
- Copy the ConfigurePayment.ascx file in Klarna\KlarnaPartPayment to theKlarnaPartPayment folder which has been created. - a. For Klarna Invoice:
- Copy the Klarna\MetaData\KlarnaInvoice folder toApps\Order\Payments\MetaData.
b. For Klarna Part Payment:
- Copy the Klarna\MetaData\KlarnaPartPayment folder toApps\Order\Payments\MetaData.
Configuration
Follow the steps below to configure Klarna in Commerce Manager.
- In Commerce Manager, go to Administration > Order System > Payments> Your country.
- Click New to create a new payment method. An example of the configuration is shown below.
- 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.KlarnaPaymentGatewayEPiServer.Business.Commerce.Payment.Klarna.
KlarnaPartPayment.KlarnaPaymentGatewayPayment Class EPiServer.Business.Commerce.Payment.Klarna.
Orders.KlarnaPaymentEPiServer.Business.Commerce.Payment.Klarna.
Orders.KlarnaPaymentIsActive 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. - Click OK to save the data.
- 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.
- 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 verify the address.Yes or No Update pclasses button Only for Klarna Part Payment: this will update the pclasses from Klarna. Click button to update - Click OK to save the data.
- Go to the Markets tab and add the expected markets for this payment.
- 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> - In your web.config, ensure that the CommerceSiteBehavior configuration part exists. If not, add this section to <system.serviceModel>\<behaviors>
<!-- Under <serviceBehaviors> tab -->
<behavior name="CommerceSiteBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
<!-- Under <endpointBehaviors> tab -->
<behavior name="CommerceSiteBehavior">
<webHttp />
</behavior> - Copy the KlarnaService.svc file in the Klarna\Services folder to the Servicesfolder in your Commerce front-end site (create if the folder does not already exist).
- 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
- Add item(s) to a shopping basket and proceed to checkout.
- Select a shipping address, shipping option and continue to payment options.
- 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:
- In the Payment Method section, select the Klarna Part Payment option.
- In the field Social Security No, enter your social security number.
- 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:
- In the Payment Method section, select the Klarna Part Payment option.
- Enter Gender, Date of birth, House number and House extension (optional).
- Click Continue to place the order.
- If your order is processed successfully, you will see your order number. An e-mail is also sent to you to confirm your order.
- 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
- Add item(s) to a shopping basket and proceed to checkout.
- Select a shipping address, shipping option and continue to payment options.
- 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:
- In the Payment Method section, select the Klarna Invoice option.
- In the Social Security No field, enter a Company registration no for a company, then click Continue to select an address from the list.
- Click Continue again to place the order.
Netherlands and Germany
The following applies for customers from Netherlands and Germany:
- In the Payment Method section, select the Klarna Invoice option.
- Enter Gender, Date of birth, House number and House extension (optional).
- Click Continue to place the order.
- If your order is processed successfully, you will see your order number. An e-mail is also sent to you to confirm your order.
- 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.