This guide will help you install Klarna add-ons for SAP Commerce Suite to enable Klarna payment solutions. Follow the steps outlined below to ensure a successful installation.
ant addoninstall -Daddonnames="klarnapaymentaddon" -DaddonStorefront.yacceleratorstorefront="yacceleratorstorefront"
For B2B installation:
XML
1
2
ant addoninstall -Daddonnames="klarnapaymentb2baddon" -DaddonStorefront.yacceleratorstorefront="yb2bacceleratorstorefront"
Note: Depending on your SAP Commerce version, you might need to install liveeditaddon and b2ccheckoutaddon. Verify the storefront name for your project.
Configure the Market and the Region specific to each site:
klarna.market.country.<site_id>=<market_code>
# E.g. klarna.market.country.apparel-uk=GB
klarna.market.region.<site_id>=<region_code>
# E.g. klarna.market.region.apparel-uk=EU
If multiple currencies are applicable on the merchant site, ensure that the out-of-box settings for the conversion factor and delivery cost are properly configured. These values are used to send the cost in the purchased currency converted value to Klarna.
Adjust these configurations based on your specific project requirements to ensure smooth operation and support from Klarna.
When an order is successfully processed by Klarna but the placement fails in SAP, an email notification is sent to the merchant. The recipient's email address is configured in the Klarna settings within the back office. The email content for this notification is managed using the FailedOrder_Email_Template.impex file, located in \klarnapayment\resources\klarnapayment\email_impex\. This impex file must be loaded after the server starts. Merchants have the flexibility to modify the email content, specifically the CMS component OrderFailedEmailBody, either by editing the impex file or through the back office at a later time.
JUnit test classes are located in the testsrc folder of both the klarnapayment and klarnapayment extensions. Mock test classes for all supported Klarna API calls are available in the klarnapaymentapi extension.
The KlarnaClientConnectionTest integration test class is implemented in the klarnapaymentapi extension. This class is used to test the connection to the Klarna server after initial tests.
Steps:
1.
Update Credentials: Modify the KlarnaClientConnectionTest class with valid merchant test (playground) credentials. This helps identify any issues with authentication or payment session creation during server startup.
2.
Verify Connection: Upon starting the server, look for the log message: Klarna Integration Connection Test Successful. This confirms that SAP Commerce has successfully connected to Klarna.
3.
Production Use: If using this feature in production, ensure to remove the Klarna production API credentials from the test class to maintain security.
SAP Commerce sends an order confirmation email to customers once an order is placed. However, since Klarna handles payment instructions and notifications directly with the customer, it is recommended to customize the Payment Details section of the confirmation email to clarify the following points:
1.
Payment has not been taken yet (except for Pay Now methods).
2.
Customers will receive updates directly from Klarna.
3.
Purchases and payments can be tracked via the Klarna App.
Additionally, you can configure the payment method to display as "Purchased with Klarna" in the order confirmation email. To achieve this, follow these steps: