It is recommended to test the installation process on a test environment before deploying to your production environment.
The Klarna Checkout Module can be installed using the following commands from a command line:
# php bin/magento maintenance:enable
# php bin/magento cache:flush
# php bin/magento cache:disable
# composer require klarna/m2-checkout
# php bin/magento setup:upgrade
# php bin/magento setup:di:compile
# php bin/magento setup:static-content:deploy [languages] (eg: en_US de_AT de_DE fi_FI sv_SE)
# php bin/magento cache:enable
# php bin/magento maintenance:disable
Klarna Checkout can be integrated quickly with a few configurations. Advanced options do exist if further configuration is needed.
The Klarna Checkout Module is also very extensible. This allows merchants to easily enhance and customize certain features to fit specific needs.
Magento uses a base currency that is configured at the website level (not store view) along with tax configuration done at the website level (not store view). To avoid rounding and mismatch issues we only work with base currency and do not support using display currency (which is used by the currency switcher). So if you want to support multiple currencies you will need to setup multiple websites (with different URLs, configured in Magento at the "Website" level, not store view) for each currency.
After installation of the Klarna Checkout Module, a few configuration settings need to be set to enable Klarna Checkout.
These settings can be found by following the admin navigation path of: Stores ⇒ Configuration ⇒ Sales ⇒ Payment Methods ⇒ Klarna ⇒ Klarna API
NOTE: These options have a different appearance beginning with Magento 2.3.5. See the text in parenthesis “()” for their new display
Option | Description |
---|---|
API Version (Endpoint) | The API version you should connect to. This is based on your region. |
Merchant ID | Your merchant ID for API interaction. (Provided to you by Klarna) |
Shared secret (Password) | Your private password for API interaction. (Provided to you by Klarna) |
Test Mode (Mode) | Credentials are specific to each environment. Select ‘Disabled’ (Production) for Live |
Debug Mode (Logging) | API requests to Klarna are logged in the default log directory. (Should not be enabled on production. Sensitive information is logged.) |
Additional options can be configured for Klarna Checkout to adjust checkout behavior. These settings can be found by following the admin navigation paths:
Stores ⇒ Configuration ⇒ Sales ⇒ Checkout ⇒ Klarna Checkout
And
Stores ⇒ Configuration ⇒ Sales ⇒ Payment Methods ⇒ Klarna ⇒ Klarna Checkout
Klarna Checkout can be restricted to select customer groups. Simply select the customer groups you wish to limit Klarna Checkout. All non selected groups will be presented with your existing checkout. If no groups are selected, all customers will be directed to Klarna Checkout.
Alternative payment methods can be displayed within Klarna Checkout as an alternative to Klarna’s standard offering. These options will appear when the customer must choose a payment method before completing the purchase. Only certain external payment methods are supported by Klarna. Only PayPal Express support is provided by the Klarna Checkout Module.
Klarna Checkout will not appear until the payment method is enabled. The Klarna Checkout Module does have several additional features that can be enabled and configured to modify the checkout experience.
Payment settings is configured via the following path:
Stores ⇒ Configuration ⇒ Sales ⇒ Payment Methods ⇒ Klarna ⇒ Klarna Checkout
Option | Description |
---|---|
Enable this Solution | Whether or not to use Klarna Checkout |
New order status | Status that an order gets set to after fraud processing has completed |
Shipping Countries | Supported shipping countries for Klarna. |
Disable Klarna for specific customer groups | Selected groups will see standard checkout instead of Klarna checkout. |
External Payment Methods | Additional payment methods not processed through Klarna, e.g. PayPal, that can be included on the Klarna checkout page. Make sure to enable the specific payment method first for it to show up in the list. See External Payment Methods section above for more info on adding custom payment methods |
Checkout options can be configured via the following path:
Stores ⇒ Configuration ⇒ Sales ⇒ Checkout ⇒ Klarna Checkout Options
Option | Description |
---|---|
Merchant Checkbox | A checkbox will be added to Klarna Checkout that will trigger the event selected before order is placed. |
Merchant Checkbox Text | Predefined checkbox options will have label text by default. Use this field to override the default text. Leave blank to use default text. |
Merchant Checkbox Required | Select if the checkbox is required to place the order. Not required by default. |
Merchant Checkbox Checked | Select if the checkbox should be checked by default. Not checked by default. |
Allow Guest Checkout | Used to determine if guest customers should be offered the Klarna Checkout. If set to ‘Yes,’ guest customer will be allowed to checkout with Klarna. |
URL to terms and conditions | The URL to your terms and conditions. This is required in all markets. If left empty, Klarna Checkout will fail to initialize. |
URL to cancellation terms | The URL to your cancellation terms and conditions. This is only applicable in the DACH market. Field is ignored if left blank. |
URL to redirect for checkout failures | Must be a fully qualified URL. If left blank, defaults to the cart URL. Useful for redirecting checkout failures to a specific page other than the shopping cart |
Shipping methods in iframe | Display shipping methods inside the Klarna iframe. This is ignored and forced to 'no' in some markets. This is ignored and forced to "yes" if KSA is enabled (starting from version 9.2.2) |
Packstation Enabled | Only applicable in DACH market. Enables support for Packstation. Forces “Separate shipping address” to “Yes” (ignores whatever value specified in that setting) |
Separate shipping addresses | Used to enable shipping address to be different than billing address |
Auto focus Klarna Checkout | Focus will automatically be set to the Klarna Checkout on load. This allows for entry of customer details without requiring the customer to move their mouse. |
Pre-fill Customer Details | Prefill Klarna Checkout with stored customer data. |
Customer pre-fill notice | Display a pre-fill notice to registered customer before submitting details to Klarna. The customer must accept the notice to have their account details shared with Klarna. |
Title mandatory | Requires that the customer specifies title (not supported in all markets) |
Date of birth mandatory | Requires that the customer enters the date of birth (not supported in all markets). |
National Identification number mandatory | Requires that the customer enters their NIN/SSN (not supported in all markets). Enabling this can also have the effect of requiring DOB in some markets |
Telephone number mandatory | Requires that the customer enters a phone number (not supported in all markets). |
Enable B2B mode | See B2B section |
Business ID attribute | Only visible if “Enable B2B mode” is “Yes”. |
Custom Checkboxes | See Multiple Checkbox Support section |
Checkout design options can be configured via the following path:
Stores ⇒ Configuration ⇒ Sales ⇒ Checkout ⇒ Klarna Checkout Design
CSS hex colors are used, e.g. #FF9900
Option | Description |
---|---|
Checkout button color | Modify the color of buttons. |
Checkout button text color | Modify the color of button text |
Checkout checkbox color | Modify the background color of a checkbox |
Checkout checkbox checkmark color | Modify the color of the checkbox checkmark |
Checkout header color | Modify the color of headers on checkout |
Checkout link color | Modify the color of links on checkout |
Checkout border radius | Modify the border radius of the iframe |