44
www.klarna.se Norra Stationsgatan 61 11343 Stockholm, SWEDEN Installation of Klarna payment plug-in for IBM WebSphere Commerce

Installation of Klarna payment plug-in for IBM WebSphere Commerce

  • Upload
    vothuy

  • View
    215

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Installation of Klarna payment plug-in for IBM WebSphere Commerce

www.klarna.se Norra Stationsgatan 61

11343 Stockholm, SWEDEN

Installation of Klarna payment plug-in for IBM WebSphere Commerce  

Page 2: Installation of Klarna payment plug-in for IBM WebSphere Commerce

Table of Contents

Introduction 3  

Known limitations 3  

Overview of payment plug-in sources 4  

List of projects 4  

List of beans 5  

List of commands 6  

List of registries 8  

Integration of payment plug-in with Aurora store 9  

Database customizations 9  

Payment module integration 10  

Management center UI 14  

Store front-end assets 16  

Commerce Accelerator extensions 22  

WCBD customizations 22  

Integration with a AuroraStorfrontAssetStore in extended site model 23  

Configuration of Klarna payment plug-in 23  

Klarna tool overview 23  

Creating new Klarna Setting in Commerce Management Center 25  

Fetching PClasses 29  

Changing Klarna setting 31  

Deleting a Klarna setting 32  

Refreshing registry 32  

Testing 32  

Sample flow for Klarna Standard Checkout 33  

Verifying reservation in Commerce Accelerator 37  

Activating reservation in Commerce Accelerator 39  

List of figures 42  

Page 3: Installation of Klarna payment plug-in for IBM WebSphere Commerce

Introduction This document describes installation of Klarna payment plugin for

WebSphere Commerce Server. Payment plugin supports IBM WebSphere

Commerce (WCS) 7 Feature Enhancement Pack (FEP) 6.

Before starting installation of the plugin it is recommended to read the

technical solution design to meet the most important design decisions made

for the plugin.

Known limitations • The payment plugin does not support editing order that contains items that

have been partially shipped (an invoice created in Klarna) and items that have not been released to inventory.

• Storefront related customizations of IBM WebSphere Commerce are based on the Aurora starter store available in FEP 6. If an integration with:

o another FEP version of Aurora store o customized version of Aurora FEP6 o a storefront that is not based on the Aurora storefront

is planned, it is recommended to treat the provided storefront assets as a reference implementation that can be used to minimize efforts needed to include needed storefront changes in a target store.

• The plugin uses IBM WebSphere Commerce STORECONF table to hold configuration data. The table was introduced in the FEP4, so if you plan to integrate the plugin with the lower version of the product, a customization will be required.

• The solution assumes that IBM WebSphere Commerce VAT calculations are used for tax calculations.

• By default WCS has only German localization from 7 countries than Klarna currently operates. Thus for Austria, Netherlands and Scandinavian countries you should have already WCS localization prepared. You can always follow IBM documentation on how to add new language support

Page 4: Installation of Klarna payment plug-in for IBM WebSphere Commerce

Overview of payment plug-in sources Klarna payment plug-in for WebSphere Commerce is available as zip

package KlarnaPlugin.zip. The package contains all the projects source code

needed for integration with the Aurora starter store.

List of projects

Project Description

KlarnaPaymentPlugin Contains EJB with implementation of payment plugin interfaces

KlarnaManagement-Client KlarnaManagement-DataObjects KlarnaManagement-Server KlarnaManagementServicesHTTPInterface

These four projects contains Klarna Data Layer and Services Layer needed for Klarna ManagementCenter UI

LOBTools Contains ManagementCenter UI extension related assets (OpenLaszlo files, JSP, Struts XML)

WebSphereCommerceServerExtensionsLogic Contains implementation of all new Beans classes and Commands classes

CommerceAccelerator

Contains Klarna extensions for Commerce Accelerator UI

Page 5: Installation of Klarna payment plug-in for IBM WebSphere Commerce

Stores

Contains store front assets (JSP, struts configuration files, resource bundles etc.)

WC Contains Klarna related configuration files (registries definition, payment plugin configuration files, dependent library files)

wcbd Contains Klarna related extension to project build files

config Contains Klarna related database tables, initial data, AC policies, CMDREG

List of beans

All beans java classes are stored in WebSphereCommerceServer

ExtensionsLogic project. Beans classes can be found in two packages:

• com.klarna.databeans (standard checkout) • com.klarna.checkout.databeans (Klarna checkout online)

Class Name Description

ProductPageBean.java Used for product page to display Klarna calculated monthly price

CheckoutPageBean.java Used for checkout shipping & billing page to display Klarna payment method

BasketPageBean.java Used for shopping cart page to display Klarna standard checkout option (only for SE)

Page 6: Installation of Klarna payment plug-in for IBM WebSphere Commerce

FooterBean.java Used for generation of Klarna logo link on store front footer

KlarnaCheckerBean.java Used for checking if order amount is between min and max defined for each country

KlarnaCountryBean.java Used for determine Klarna country

KlarnaCartDataBean.java Used for display KCO frame

List of commands

All commands java interfaces and implementation classes are stored in

WebSphereCommerceServerExtensionsLogic project.

Interface Name, Class Name Description

PIAddCmd KlarnaPIAddCmdImpl

Extension of the default PIAdd command, used for validation of Klarna payments parameters

PIEditCmd KlarnaPIEditCmdImpl

Extension of the default PIEdit command used for validation of Klarna payments parameters

PrePurchaseCmd PrePurchaseCmdImpl

Ajax command for Klarna requests getAddress(), hasAccount() - PrePurchaseCmd

KlarnaForgetCmd KlarnaForgetCmdImpl

Ajax command needed for guest checkout to disable existing Klarna addresses

UnblockPendingKlarnaPaymentsCmd UnblockPendingKlarnaPayments CmdImpl

Command for checking the status of reservation for orders with pending Klarna reservation

Page 7: Installation of Klarna payment plug-in for IBM WebSphere Commerce

OrderCalculateCmd KlarnaOrderCalculateCmdImpl

Extension for storing shipping and sales taxes rates on order item level

ProcessOrderCmd KlarnaProcessOrderCmdImpl

Extension to make sure that whole order amount is passed when order is submitted even when contains backordered order items

CalculateOrderCmd KlarnaCalculateOrderCmdImpl

An extension of default order calculation command (com.ibm.commerce.order.commands.CalculateOrderCmdImpl), it will call the AddTaxRatesToOrderItemCmd to assign tax rates to order items.

AddTaxRatesToOrderItemCmd AddTaxRatesToOrderItemCmdImpl

Custom class to store tax rates at order item levels

ReturnProcessCmd KlarnaReturnProcessCmdImpl

An extension to the com.ibm.commerce.returns.commands.ReturnProcessCmdImpl

class. It prevents from creating a RMA in WCS if the refund method is Klarna

and the refunded amount would result in the negative invoice in Klarna.

PrepareKlarnaCheckoutOrderCmd PrepareKlarnaCheckoutOrderCmdImpl

KCO: Custom class to prepare Klarna Checkout Shopping cart

PreAddressAddCmd KlarnaPreAddressAddCmdImpl

Custom implementation of PreAddressAddCmd interface to handle Klarna address creation requests.

KlarnaCheckoutPushCmd KlarnaCheckoutPushCmdImpl

KCO: Custom class to push confirmation of an order from Klarna

Page 8: Installation of Klarna payment plug-in for IBM WebSphere Commerce

KlarnaCheckoutConfirmationCmd KlarnaCheckoutConfirmationCmdImpl

KCO: Custom class to be called by Klarna to confirm order

KlarnaCheckoutValidationCmd KlarnaCheckoutValidationCmdImpl

KCO: Custom class to validate KCO order before confirming it

OrderStatusCmd KlarnaOrderStatusCmdImpl

Extension to store release ID next to the order for DOM inventory processing

List of registries

Registries are used to reduce database queries. For Klarna payment plugin

two registries was defined. Implementation classes can be found in

KlarnaManagement-Server project.

Class name Description

PClassesRegistry Holds X_KLARNCONF table data

KlarnaStoreRegistry Holds X_KLARNASTORE table data

Page 9: Installation of Klarna payment plug-in for IBM WebSphere Commerce

Integration of payment plug-in with Aurora store Klarna payment plug-in requires WebSphere Commerce Server Version 7

FEP6. Integration of plug-in is based on Aurora starter store in development

environment.

Before you begin the installation make sure that you have access to Klarna

test environments.

Database customizations

All the assets related to database customizations are stored in the config

project.

Prerequisites:

• Update entity values in xml/common/common.dtd file according to store configuration

// update entity store id value accordingly

<!ENTITY STORE_ID "10001">

// update store owner id value accordingly

<!ENTITY STORE_ORG_ID "7000000000000000002">

• Add following lines to file WC/properties/IdResolveKeys.properties

MERCHANT:@MEMBER_ID@NAME:MEMBER_ID NAME

SCHCONFIG:@SCCJOBREFNUM:SCCJOBREFNUM

The following steps needs to be performed to set up database objects

properly:

• Creation of additional tables by execution of SQL script, • Load of initial data with idresgen and massload utility, • Load of access control policies

Page 10: Installation of Klarna payment plug-in for IBM WebSphere Commerce

File assets Tool

createKlarnaTables.sql DB command line tool

klarna-noun-cmdreg.xml

payment-policies.xml

storeconf.xml

cmdreg.xml

blocks.xml

merchant.xml

klarna-surcharge.xml

idresgen, massload

KlarnaPaymentViewACPolicy.xml

PrePurchaseCmdACPolicy.xml

acpload

Below links to IBM documentation for chosen utilities:

• acpload • idresgen • massload

Payment module integration

Five new projects need to be imported into the workspace of the IBM

WebSphere Commerce Development Environment. The list includes

following:

• KlarnaPaymentPlugin • KlarnaManagement-Client • KlarnaManagement-DataObjects • KlarnaManagement-Server • KlarnaManagementServicesHTTPInterface

Page 11: Installation of Klarna payment plug-in for IBM WebSphere Commerce

Additionally some modification needs to be done in WC project. Please

follow steps described below.

Add required libraries to projects WC and Stores:

WC/lib/commons-codec-1.5.jar WC/lib/commons-lang-2.6.jar WC/lib/commons-logging-1.1.jar WC/lib/gson-1.7.1.jar WC/lib/guava-r09.jar WC/lib/hamcrest-core-1.1.jar WC/lib/java-checkout-1.1.0.jar WC/lib/json-simple-1.1.1.jar WC/lib/klarna_java_api-2.4.1.jar WC/lib/ws-commons-util-1.0.2.jar WC/lib/xmlrpc-client-3.1.3.jar WC/lib/xmlrpc-common-3.1.3.jar Stores/WebContent/WEB-INF/lib/httpclient-4.2.1.jar Stores/WebContent/WEB-INF/lib/httpcore-4.2.1.jar

Update WC configuration files:

WC/xml/config/com.ibm.commerce.infrastructure-ext/wc-component.xml

Ensure that the following mapping is present:

<_config:valuemapping externalName="StoreType"

internalName="StoreType">

<!-- Map tool type to STORE.STORETYPE in database -->

<_config:valuemap externalValue="Klarna_KlarnaManagementTool"

internalValue="B2C, B2B, BBB, MPS, BMP, MHS, BMH, CPS" />

</_config:valuemapping>

In WC/xml/config/wc-server.xml add registries:

<registry initialCapacity="500" name="PClassesRegistry"

regClassName="com.klarna.commerce.registry.PClassesRegistry"/>

<registry initialCapacity="500" name="KlarnaStoreRegistry"

regClassName="com.klarna.commerce.registry.KlarnaStoreRegistry"/>

Page 12: Installation of Klarna payment plug-in for IBM WebSphere Commerce

Add new Klarna component services WC configuration files:

WC/xml/config/com.klarna.commerce.klarnamanagement/SDO.properties WC/xml/config/com.klarna.commerce.klarnamanagement/wc-business-object-mediator.xml WC/xml/config/com.klarna.commerce.klarnamanagement/wc-component-client-J2SEWebService-example.xml WC/xml/config/com.klarna.commerce.klarnamanagement/wc-component-client-local-example.xml WC/xml/config/com.klarna.commerce.klarnamanagement/wc-component-client-remote-j2ee-example.xml WC/xml/config/com.klarna.commerce.klarnamanagement/wc-component-client-remote-j2se-example.xml WC/xml/config/com.klarna.commerce.klarnamanagement/wc-component-client.xml WC/xml/config/com.klarna.commerce.klarnamanagement/wc-component.xml WC/xml/config/com.klarna.commerce.klarnamanagement/wc-object-relational-metadata.xml WC/xml/config/com.klarna.commerce.klarnamanagement/wc-query-KlarnaSettings-get.tpl WC/xml/config/com.klarna.commerce.klarnamanagement/wc-query-KlarnaSettings-update.tpl WC/xml/config/com.klarna.commerce.klarnamanagement/wc-query-utilities.tpl

Add Klarna specific properties files:

WC/properties/klarna/Klarna.properties

Check comments in the above file to understand the meaning of each

property, set the values of the properties to match your environment.

WC/properties/klarna/KlarnaMessages.properties

Text resources for storefront

Add Klarna payment plug-in files:

WC/xml/config/payments/ppc/plugins/KlarnaPaymentPlugin/PluginDeployment.xml WC/xml/config/payments/edp/groups/default/KlarnaOnline/AVSRules.xml WC/xml/config/payments/edp/groups/default/KlarnaOnline/CoreCancelOrderPaymentActions.xml WC/xml/config/payments/edp/groups/default/KlarnaOnline/CoreEditActions.xml WC/xml/config/payments/edp/groups/default/KlarnaOnline/CoreEditReversePaymentActions.xml WC/xml/config/payments/edp/groups/default/KlarnaOnline/CorePaymentActions.xml

Page 13: Installation of Klarna payment plug-in for IBM WebSphere Commerce

Update following payment plug-in files:

WC/xml/config/payments/edp/groups/default/PaymentMappings.xml

Add the following mapping:

<Mapping paymentActionRule="Early Approval"

paymentConfiguration="KlarnaOnline" paymentMethod="Klarna"/>

WC/xml/config/payments/edp/groups/default/PaymentMethodConfigurations.xml

Add the following refund configuration:

<Mapping refundConfiguration="KlarnaOnline" refundMethod="Klarna"/>

name="KlarnaOnline" partiallyConsumable="true"

paymentSystemName="KlarnaPaymentSystem" priority="MEDIUM"

refundAllowed="true" systemEditable="true"/>

WC/xml/config/payments/edp/groups/default/RefundMappings.xml

Add the following payment method configuration:

<PaymentMethodConfiguration humanEditable="true"

maximumAmount="Unbounded" minimumAmount="0"

WC/xml/config/payments/edp/groups/default/RefundMethodConfigurations.xml

Add the following line:

<RefundMethodConfiguration

name="KlarnaOnline"

paymentSystemName="KlarnaPaymentSystem" />

WC/xml/config/payments/ppc/plugins/PaymentSystemPluginMapping.xml

Add the following mapping:

<PaymentSystemName name="KlarnaPaymentSystem">

<Mapping paymentConfigurationId="default"

pluginName="KlarnaPaymentPlugin">

Page 14: Installation of Klarna payment plug-in for IBM WebSphere Commerce

Management center UI

Management Center UI was extended with a new Klarna tool. You need to

update LOBTools project with files from Klarna plugin zip package.

List of files to be updated (merged) include the following files from LOBTools

project:

LOBTools/WebContent/META-INF/MANIFEST.MF LOBTools/WebContent/WEB-INF/web.xml LOBTools/WebContent/config/commerce/shell/ApplicationMenuItems.def LOBTools/WebContent/WEB-INF/src/lzx/commerce/shell/ShellExtensionsLibrary.lzx

The following new files need to be imported to LOBTools project:

LOBTools/WebContent/WEB-INF/config/com.klarna.commerce.klarnamanagement/get-data-config.xml LOBTools/WebContent/WEB-INF/config/com.klarna.commerce.klarnamanagement/wc-klarnamanagement-clientobjects.xml LOBTools/WebContent/WEB-INF/src/lzx/klarna/payments/KlarnaManagementLibrary.lzx LOBTools/WebContent/WEB-INF/src/lzx/klarna/payments/KlarnaManagementResourceBundle.lzx LOBTools/WebContent/WEB-INF/src/lzx/klarna/payments/KlarnaManagementResources.lzx LOBTools/WebContent/WEB-INF/src/lzx/klarna/payments/resources/klarnaIcon.png LOBTools/WebContent/WEB-INF/struts-klarna-extension.xml LOBTools/WebContent/config/klarna/payments/KlarnaManagmentToolDefinition.def LOBTools/WebContent/config/klarna/payments/listViewDefinitions/KlarnastoreGrid.def LOBTools/WebContent/config/klarna/payments/objectDefinitions/KlarnaChildObjectDefinition.def LOBTools/WebContent/config/klarna/payments/objectDefinitions/KlarnaPrimaryObjectDefinition.def LOBTools/WebContent/config/klarna/payments/objectDefinitions/KlarnaTopObjectDefinition.def LOBTools/WebContent/config/klarna/payments/propertiesViews/KlarnaStorePropertiesView.def LOBTools/WebContent/jsp/klarna/payments/GetKlarnaStoreAllByStoreId.jsp LOBTools/WebContent/jsp/klarna/payments/GetKlarnaStoreByUniqueId.jsp LOBTools/WebContent/jsp/klarna/payments/GetKlarnaStoreChildByUniqueId.jsp LOBTools/WebContent/jsp/klarna/payments/RespondCreateKlarnaStore.jsp LOBTools/WebContent/jsp/klarna/payments/serialize/SerializeKlarnaConf.jspf LOBTools/WebContent/jsp/klarna/payments/serialize/SerializeKlarnaSettings.jspf LOBTools/src/com/klarna/commerce/payments/client/lobtools/properties/KlarnaManagement.properties LOBTools/src/com/klarna/commerce/payments/client/lobtools/properties/KlarnaManagementErrorMessages.properties

Page 15: Installation of Klarna payment plug-in for IBM WebSphere Commerce

Additionally if you need support for other languages prepare translations of

KlarnaManagement.properties and KlarnaManagementError-

Messages.properties text resources files.

Build LOBTools project (from context menu) then restart server and log into

the Management Cetner to see new Klarna Settings panel. Remember to

clean the cache of a browser to be sure updated files are served.

Figure 1 MC main menu with Klarna option

Figure 2 New Klarna Settings Panel

Page 16: Installation of Klarna payment plug-in for IBM WebSphere Commerce

Store front-end assets

All assets related to front-end changes are stored in Stores project. All

DataBean classes used by JSP files are stored in WebSphereCommerce-

ServerExtensionsLogic project. Please follow instruction below to add and

update necessary files.

Common new files

Following is a list of new common files related to Klarna:

Stores/WebContent/Aurora/css/klarna.css Stores/src/Aurora/KlarnaText.properties Stores/WebContent/WEB-INF/struts-config-klarna.xml Stores/WebContent/images/klarna_banner_afm_warning.jpg

Please add the files listed above to Stores project. Please make translation

for KlarnaText.properties file if you need localization for other languages.

Please add following change to the following file:

Stores/WebContent/Aurora/css/common1_1.css

@import url("klarna.css");

Please import all new classes for WebSphereCommerceServerExtensions-

Logic project.

Store footer Klarna banner

Import JSP file

Stores/WebContent/Aurora/Widgets/Footer/Footer_UI.jspf

DataBean related

WebSphereCommerceServerExtensionsLogic/src/com/klarna/databeans/FooterBean.java

Page 17: Installation of Klarna payment plug-in for IBM WebSphere Commerce

After integration on store front page should be visible Klarna banner in the

bottom of the page.

Figure 3 Klarna Banner on storefront page

Product page extensions

Import the following files:

Stores/WebContent/Aurora/Snippets/Klarna/GenderBirthdayForm.jspf Stores/WebContent/Aurora/Snippets/Klarna/GuestCheckout.jspf Stores/WebContent/Aurora/Snippets/Klarna/KlarnaPriceTooltip.jsp Stores/WebContent/Aurora/Snippets/Klarna/TermsAndConditionsAccount.jsp Stores/WebContent/Aurora/Snippets/Klarna/TermsAndConditionsInvoice.jsp

Merge the following files:

Stores/WebContent/Aurora/Widgets/Discounts/ext/Discounts_Data.jspf Stores/WebContent/Aurora/Widgets/Discounts/ext/Discounts_UI.jspf Stores/WebContent/Aurora/Widgets/ProductDescription/ProductDescription_UI.jspf Stores/WebContent/Aurora/Widgets/QuickInfo/QuickInfoPopup.jspf Stores/WebContent/Aurora/Widgets/QuickInfo/QuickInfo_UI.jspf

DataBean responsible:

WebSphereCommerceServerExtensionsLogic/src/com/klarna/databeans/ProductPageBean.java

Page 18: Installation of Klarna payment plug-in for IBM WebSphere Commerce

Effects should be visible on product page:

Figure 4 Klarna offer price on product page

Klarna standard checkout page

Import following files:

Stores/WebContent/Aurora/Snippets/EDP/PaymentMethods/StandardKlarna.jsp Stores/WebContent/Aurora/javascript/Klarna/Klarna.js

Merge following files:

Stores/WebContent/Aurora/ShoppingArea/CheckoutSection/CheckoutPaymentsAndBillingAddress.jspf Stores/WebContent/Aurora/ShoppingArea/CheckoutSection/CommonUtilities.jspf Stores/WebContent/Aurora/ShoppingArea/CheckoutSection/MultipleShipment/ShippingAddressSelect.jsp Stores/WebContent/Aurora/ShoppingArea/CheckoutSection/OrderShippingBillingConfirmationPage.jsp Stores/WebContent/Aurora/ShoppingArea/CheckoutSection/OrderShippingBillingDetails.jsp Stores/WebContent/Aurora/ShoppingArea/CheckoutSection/ShippingDetailsDisplay.jsp Stores/WebContent/Aurora/ShoppingArea/CheckoutSection/ShoppingCartItemsUpdateHelper.jsp Stores/WebContent/Aurora/ShoppingArea/CheckoutSection/SingleShipment/BillingAddressDropDownDisplay.jsp Stores/WebContent/Aurora/ShoppingArea/CheckoutSection/SingleShipment/ShippingAddressSelect.jsp Stores/WebContent/Aurora/ShoppingArea/CheckoutSection/SingleShipment/SingleShipmentOrderTotalsSummary.jsp Stores/WebContent/Aurora/ShoppingArea/CheckoutSection/UnregisteredCheckout.jsp Stores/WebContent/Aurora/ShoppingArea/ShopcartSection/OrderItemDisplay.jsp Stores/WebContent/Aurora/ShoppingArea/ShopcartSection/ShopCartDisplay.jsp Stores/WebContent/Aurora/javascript/CheckoutArea/CheckoutHelper.js Stores/WebContent/Aurora/javascript/CheckoutArea/CheckoutPayments.js Stores/WebContent/Aurora/javascript/CheckoutArea/ShipmodeSelectionExt.js Stores/WebContent/Aurora/javascript/CheckoutArea/ShippingAndBillingServicesDeclaration.js Stores/WebContent/Aurora/javascript/CommonControllersDeclaration.js Stores/WebContent/Aurora/javascript/ServicesDeclaration.js

Page 19: Installation of Klarna payment plug-in for IBM WebSphere Commerce

DataBean responsible:

WebSphereCommerceServerExtensionsLogic/src/com/klarna/databeans/CheckoutPageBean.java

Effects will be visible on Klarna payment method page:

Figure 5 Checkout page with Klarna payment method

Address forms update

In order to have all personal data required by Klarna checkout we needed to

extend registration and update address form for Netherlands and Germany.

Merge following files:

Stores/WebContent/Aurora/Snippets/ReusableObjects/Address.jspf Stores/WebContent/Aurora/Snippets/ReusableObjects/AddressBookAddressEntryForm.jspf Stores/WebContent/Aurora/Snippets/ReusableObjects/AddressBookAddressEntryFormDisplay.jspf Stores/WebContent/Aurora/Snippets/ReusableObjects/AddressDisplay.jspf Stores/WebContent/Aurora/Snippets/ReusableObjects/AddressEntryForm.jspf Stores/WebContent/Aurora/Snippets/ReusableObjects/RegistrationFlexFlows.jspf Stores/WebContent/Aurora/Snippets/ReusableObjects/ShoppingCartAddressEntryForm.jspf Stores/WebContent/Aurora/Snippets/ReusableObjects/UnregisteredCheckoutAddressEntryForm.jsp Stores/WebContent/Aurora/UserArea/AccountSection/AddressbookSubsection/AccountAddressForm.jsp Stores/WebContent/Aurora/UserArea/AccountSection/AddressbookSubsection/AccountForm.jsp Stores/WebContent/Aurora/UserArea/AccountSection/AddressbookSubsection/AddressBookForm.jsp

Page 20: Installation of Klarna payment plug-in for IBM WebSphere Commerce

Stores/WebContent/Aurora/UserArea/AccountSection/AddressbookSubsection/AjaxAddressBookForm.jsp Stores/WebContent/Aurora/UserArea/AccountSection/MyAccountCenterLinkDisplay.jsp Stores/WebContent/Aurora/UserArea/AccountSection/RegistrationSubsection/RegistrationUpdateCommonPage.jsp Stores/WebContent/Aurora/UserArea/AccountSection/RegistrationSubsection/UserRegistrationAddForm.jsp Stores/WebContent/Aurora/UserArea/AccountSection/RegistrationSubsection/UserRegistrationUpdateForm.jsp Stores/WebContent/Aurora/Snippets/ReusableObjects/AddressBookAddressEntryForm_DE.jspf Stores/WebContent/Aurora/Snippets/ReusableObjects/AddressBookAddressEntryForm_NL.jspf Stores/WebContent/Aurora/Snippets/ReusableObjects/AddressEntryForm_DE.jspf Stores/WebContent/Aurora/Snippets/ReusableObjects/AddressEntryForm_NL.jspf Stores/WebContent/Aurora/Snippets/ReusableObjects/ShoppingCartAddressEntryForm_DE.jspf Stores/WebContent/Aurora/Snippets/ReusableObjects/ShoppingCartAddressEntryForm_NL.jspf Stores/WebContent/Aurora/Snippets/ReusableObjects/UnregisteredCheckoutAddressEntryForm_DE.jsp Stores/WebContent/Aurora/Snippets/ReusableObjects/UnregisteredCheckoutAddressEntryForm_NL.jsp Stores/src/Aurora/Address.properties Stores/src/Aurora/Address_en_US.properties Stores/src/Aurora/Address_pl_PL.properties Stores/src/Aurora/Address_pt_BR.properties Stores/src/Aurora/UserRegistration.properties Stores/src/Aurora/UserRegistration_en_US.properties Stores/src/Aurora/UserRegistration_pt_BR.properties

Klarna Checkout Online

Import following files:

Stores/WebContent/Aurora/ShoppingArea/CheckoutSection/KCOOrderShippingBillingConfirmationPage.jsp Stores/WebContent/Aurora/ShoppingArea/KlarnaCheckout/KlarnaCheckoutOrderItemDisplay.jsp Stores/WebContent/Aurora/ShoppingArea/KlarnaCheckout/KlarnaCheckoutShopCartDisplay.jsp Stores/WebContent/Aurora/ShoppingArea/KlarnaCheckout/KlarnaValidationErrorDisplay.jsp Stores/WebContent/Aurora/javascript/Klarna/KCO.js Stores/WebContent/Aurora/javascript/Klarna/KCOServiceDeclarations.js

Merge following files:

Stores/src/Aurora/storeErrorMessages.properties Stores/src/Aurora/storeErrorMessages_en_US.properties Stores/src/Aurora/storetext_v2.properties Stores/WebContent/Aurora/Widgets/MiniShopCartDisplay/MiniShopCartContents_UI.jspf Stores/WebContent/Aurora/Widgets/MiniShopCartDisplay/MiniShopCartDisplay_UI.jspf Stores/WebContent/Aurora/Widgets/MiniShopCartDisplay/ext/MiniShopCartDisplay_Data.jspf Stores/WebContent/Aurora/javascript/Widgets/MiniShopCartDisplay/MiniShopCartDisplay.js Stores/WebContent/Aurora/Snippets/Marketing/Promotions/PromotionCodeDisplay.jsp

Page 21: Installation of Klarna payment plug-in for IBM WebSphere Commerce

Stores/WebContent/Aurora/Snippets/Member/Address/ShopcartAddressFormDisplay.jsp Stores/WebContent/Aurora/Snippets/Order/Cart/OrderItemDetail.jsp

Effects should be visible on shop cart page (assuming enabled in MC):

Figure 6 KCO shop cart page

Page 22: Installation of Klarna payment plug-in for IBM WebSphere Commerce

Commerce Accelerator extensions

In Commerce Accelerator a link to Klarna invoice has been added on the

order summary page.

Update Commerce Accelerator project (merge where necessary) with

following files:

CommerceAccelerator/WebContent/WEB-INF/struts-config-ext.xml CommerceAccelerator/WebContent/tools/order/OrderSummaryDetailsB2C.jsp CommerceAccelerator/WebContent/tools/order/buyPages/StandardKlarna.jsp

WCBD customizations

A sample configuration for WebSphere Commerce Build and Deployment

tool is provided, it can be used as a reference for building and deployment of

the plugin.

WCBD project contains configuration files related to build and deployment of

store assets. To be able to build all projects you need to add following

required libraries:

wcbd/lib/activation.jar wcbd/lib/ant-contrib-1.0b3.jar wcbd/lib/ant4hg-0.8.1.jar wcbd/lib/commons-net-1.4.1.jar wcbd/lib/icu4j.jar wcbd/lib/jakarta-oro-2.0.8.jar wcbd/lib/jsch-0.1.49.jar wcbd/lib/mail.jar

Sample configuration of the build process is stored in build.properties file

Sample configuration of the deployment is stored in deploy.properties file.

Main build file is wcbd-build.xml

Please update wcbd project (merge where necessary). List of files to be

updated (merged) include all files from wcbd project.

Page 23: Installation of Klarna payment plug-in for IBM WebSphere Commerce

Integration with a AuroraStorfrontAssetStore in extended site model

Provided storefront assets can be integrated with a storefront asset store in

an e-sites model. In order to do that additional steps must be performed.

Following XML massload files must to be customized to support e-sites

settings:

• merchant.xml, • payment-policies.xml, • storeconf.xml, • klarna-surcharge.xml

Additionally you need to copy/merge all file assets from Stores/Aurora

project to the project that you want to use.

Configuration of Klarna payment plug-in After all project are updated restart server then log into Management Center

to configure Klarna payment plug-in.

Klarna tool overview

This chapter briefly describes the usage and features of Klarna tool within

Commerce Management Center. Depending on whether you accessed or

used the tool during this session:

1. If the tool is not already open, from the Management Center menu, select the tool name: in this case, select Klarna.

2. If the tool is already open, a tab for it is displayed in the main work area. Click the tab for the tool; in this case, select Klarna.

Page 24: Installation of Klarna payment plug-in for IBM WebSphere Commerce

Figure 7 Klarna tool in Management Center Tools

After you open Klarna Management Center tool, if you are authorized to work

with only one store, that store is selected by default, otherwise if you do not

have default store selected, from the Store list, select the store that you want

to manage with the selected tool.

To close a tool, close its tab by selecting the X next to the tab name.

The details of Klarna configuration within Commerce Management Center

are available in Klarna Settings folder. Folders are object and tool-specific

assets that you can use to help group business objects. When Klarna Settings folder is pressed, depending on whether you created new Klarna settings for the store or not:

a. If Klarna settings have been previously created, it will be listed on the right side of the screen.

b. If there are no Klarna settings, the list on the right side remains empty.

Page 25: Installation of Klarna payment plug-in for IBM WebSphere Commerce

Figure below shows the list of available Klarna settings for the store.

Figure 8 List of Klarna Settings available in the store

Creating new Klarna Setting in Commerce Management Center

You can create new Klarna setting by using one of these methods:

1. Create new Klarna setting using context menu. a. From the explorer tree, right-click the Klarna settings folder.

b. Click New Klarna from context menu.

Figure 9 Klarna context menu

Page 26: Installation of Klarna payment plug-in for IBM WebSphere Commerce

2. Create new Klarna setting using Commerce Management Center user interface icons. a. In the Commerce Management Center, localize toolbar below tools tab.

b. Press icon

As a result, “New Klarna Setting” should appear on the right side of the

screen:

Figure 10 New Klarna Setting window

All of the required fields need to be filled.

Page 27: Installation of Klarna payment plug-in for IBM WebSphere Commerce

3. Expand Properties section. Complete the following information:

Property Description

EID

Shared secret

Klarna checkout active Select this check box to indicate that customers can view Klarna checkout feature in the storefront.

4. Expand Klarna Checkout Order Integration properties section. Complete the following information:

Property Description

Klarna checkout country Country code supported by Klarna checkout feature in the store.

Klarna checkout currency Currency supported by Klarna checkout feature in the store.

Klarna checkout locale Locale supported by Klarna checkout feature in the store.

Page 28: Installation of Klarna payment plug-in for IBM WebSphere Commerce

5. Expand Klarna Standard Integration properties section. Complete the following information:

Property Description

Currency Currency supported in standard Klarna payment option.

Language Language supported in standard Klarna payment option.

Country Country supported in standard Klarna payment option.

Invoice fee Enter the fixed amount fee that you want to apply to Klarna Invoice payment method.

Tax for invoice fee Enter the fixed amount tax that you want to apply to Klarna Invoice payment method.

Minimum amount This option limits the availability of Klarna payment option. Enter the value that the order must meet or exceed before the order qualifies for Klarna payment option.

Note: If the minimum amount equals maximum amount, the order always qualifies for Klarna payment option.

Maximum amount This option limits the availability of Klarna payment option. Enter the value that the order cannot exceed to qualify for Klarna payment option.

Note: If the minimum amount equals maximum amount, the order always qualifies for Klarna payment option.

Enable pending functionality

Page 29: Installation of Klarna payment plug-in for IBM WebSphere Commerce

Activation with partial delivery

Display Account on product page Select this check box to indicate that customers can view Klarna details on product page.

Invoice distribution Select this dropdown menu to indicate how invoice should be distributed.

The details of PClasses section are described in separate chapter: Fetching PClasses.

Fetching PClasses

You can fetch new Klarna PClasses by using one of these methods:

1. Fetch Klarna PClasses using context menu. a. If Klarna setting is available in Active Work folder:

i. From the explorer tree, right-click the Klarna setting under

Active work folder.

ii. Click Fetch PClasses from context menu.

Figure 11 Fetch PClasses in context menu

Page 30: Installation of Klarna payment plug-in for IBM WebSphere Commerce

b. If Klarna setting is not available in Active Work folder, select Klarna settings folder.

i. From the list view on the right side of the screen, right-click on the appropriate Klarna setting.

ii. Click Fetch PClasses from context menu.

Figure 12 Fetch PClasses context menu

c. If Klarna setting is not available in Active Work folder, select Klarna settings folder, and select Klarna settings object for editing.

i. Double click on Klarna setting object from the list view.

ii. Click the “Fetch PClasses” button from the tool’s toolbar.

Figure 13 Fetch PClasses button

Page 31: Installation of Klarna payment plug-in for IBM WebSphere Commerce

As the result, PClasses configuration will show in the PClasses section of

the Klarna settings object. You can activate each of PClasses or define a

custom description:

Figure 14 Fetched PClasses

To edit fetched PClasses, complete following information:

Property Description

Custom description Type a brief description of the PClass, it will be visible under payment option in the storefront.

Active Select this check box to indicate that customers can view this PClass in the storefront.

Changing Klarna setting

You can change Klarna setting information, such as the EID, shared secret,

country, currency, language, etc.

You can edit Klarna setting by using these methods:

1. Find the Klarna setting you want to edit using list view on the right side, or tree-view on the left side of the screen.

2. Right-click on the Klarna setting, then click Open, or in the list view click The Klarna setting properties view displays.

3. Expand required sections and change the appropriate fields.

4. Click save, then click Close.

Page 32: Installation of Klarna payment plug-in for IBM WebSphere Commerce

Deleting a Klarna setting

You might want to delete a Klarna setting if you no longer want to make

available Klarna in your store. If Klarna setting is deleted, all associated

configurations are also deleted.

You can delete Klarna setting by using these methods:

1. Find the Klarna setting you want to delete using list view on the right side, or tree-view on the left side of the screen.

2. Right-click on the Klarna setting, then click Delete, or in the list view click A confirmation dialog displays.

3. Click Yes. The selected Klarna setting is removed.

Refreshing registry

When you change an object the Klarna tool a WCS in-memory registry that

keeps Klarna settings is refreshed, that means that it may take some short

period of time (approximately 5 seconds after changes were made) for a

change to become visible in the storefront.

Testing It is highly recommended to perform throughout tests of your system before

deploying the plugin to a production system.

Page 33: Installation of Klarna payment plug-in for IBM WebSphere Commerce

Sample flow for Klarna Standard Checkout This example shows Klarna Standard Checkout for Sweden. When you

ready with your order please go to shop cart page.

Figure 15 Shopcart page with Standard Klarna Checkout

To begin Klarna Standard Checkout you need to enter personal number,

then click Fetch button. When number entered is valid you should see

address details. After entering proper phone and e-mail click Continue

button.

Page 34: Installation of Klarna payment plug-in for IBM WebSphere Commerce

On the next page you will see shipping and billing details for your order.

Figure 16 Shipping & billing page with Klarna payment method

After selection of payment method please click Next button. On the next

page you will see order summary.

Page 35: Installation of Klarna payment plug-in for IBM WebSphere Commerce

Figure 17 Order summary page

To finalize order please click Order button. Then you see order confirmation

page. Note order number.

Page 36: Installation of Klarna payment plug-in for IBM WebSphere Commerce

Figure 18 Order confirmation page

Page 37: Installation of Klarna payment plug-in for IBM WebSphere Commerce

Verifying reservation in Commerce Accelerator

Login to Commerce Accelerator then select store you place order. Find your

order using order number shown on order confirmation page.

Figure 19 Accelerator Operations menu

Figure 20 Accelerator, finding order

Select order on the list and click Manage payment button.

Page 38: Installation of Klarna payment plug-in for IBM WebSphere Commerce

Figure 21 Accelerator, manage payment option

Select payment instruction which status is valid and click Extended Data

button

Figure 22 Accelerator Extended Data option

On the next page you can find rno attribute for order. This number is also

useful for finding order in Klarna management tool.

Page 39: Installation of Klarna payment plug-in for IBM WebSphere Commerce

Activating reservation in Commerce Accelerator

Log in to Commerce Accelerator then select Pick Batches from Operations

menu.

Figure 23 Accelerator Pick Batches option

Click Create button. You should see a message saying that a pick batch has

been created. From Operations menu select Release Ready to Ship option.

Figure 24 Accelerator Ready To Ship option

Page 40: Installation of Klarna payment plug-in for IBM WebSphere Commerce

Select your order and click Packages button.

Figure 25 Accelerator Packages option

Then click New button to create package. Fill required fields shipping cost

and shipping date. Click OK to save the package.

Figure 26 Accelerator New package form

Once package is created click Release Ready to Ship link from the

breadcrumb.

One more time select your order then click Confirm Shipment button. You

should see confirmation window.

Page 41: Installation of Klarna payment plug-in for IBM WebSphere Commerce

Figure 27 Accelerator confirm shipment window

Find your order again using its number. On the search result page select

your order and click Order summary button.

Figure 28 Accelerator Order Summary page

On the summary page you can notice invoice number as link to PDF file.

This invoice number is useful for finding invoice details in Klarna

management tool.

Page 42: Installation of Klarna payment plug-in for IBM WebSphere Commerce

List of figures

Figure 1 MC main menu with Klarna option ............................................................... 15  

Figure 2 New Klarna Settings Panel .......................................................................... 15  

Figure 3 Klarna Banner on storefront page ................................................................ 17  

Figure 4 Klarna offer price on product page .............................................................. 18  

Figure 5 Checkout page with Klarna payment method .............................................. 19  

Figure 6 KCO shop cart page .................................................................................... 21  

Figure 7 Klarna tool in Management Center Tools .................................................... 24  

Figure 8 List of Klarna Settings available in the store ................................................ 25  

Figure 9 Klarna context menu .................................................................................... 25  

Figure 10 New Klarna Setting window ....................................................................... 26  

Figure 11 Fetch PClasses in context menu ............................................................... 29  

Figure 12 Fetch PClasses context menu ................................................................... 30  

Figure 13 Fetch PClasses button ............................................................................... 30  

Figure 14 Fetched PClasses ...................................................................................... 31  

Figure 15 Shopcart page with Standard Klarna Checkout ......................................... 33  

Figure 16 Shipping & billing page with Klarna payment method ................................ 34  

Figure 17 Order summary page ................................................................................. 35  

Figure 18 Order confirmation page ............................................................................ 36  

Figure 19 Accelerator Operations menu .................................................................... 37  

Figure 20 Accelerator, finding order ........................................................................... 37  

Figure 21 Accelerator, manage payment option ........................................................ 38  

Figure 22 Accelerator Extended Data option ............................................................. 38  

Figure 23 Accelerator Pick Batches option ................................................................ 39  

Figure 24 Accelerator Ready To Ship option ............................................................. 39  

Figure 25 Accelerator Packages option ..................................................................... 40  

Page 43: Installation of Klarna payment plug-in for IBM WebSphere Commerce

Figure 26 Accelerator New package form .................................................................. 40  

Figure 27 Accelerator confirm shipment window ....................................................... 41  

Figure 28 Accelerator Order Summary page ............................................................. 41  

Page 44: Installation of Klarna payment plug-in for IBM WebSphere Commerce