Klarna Docs - Klarna payments

Klarna payments

Learn about the features offered by Klarna payments in the Klarna Adobe Commerce extension.

The Klarna payments extension lets you add any of Klarna's payment methods to your checkout page in Adobe Commerce.

The key features supported by Klarna payments in the extension are:

The following features aren’t currently supported:

For more information about Klarna payments, refer to the dedicated section of our product documentation.

Klarna payments can be used in all markets where Klarna is available without any technical restrictions, that is, North America, Europe, and Oceania. For a detailed list of countries, refer to the FAQ.

The store has to be configured to match the market's specifics, for example, the correct tax and currency settings. Once that’s configured, the Klarna payments API has to be configured in the Admin > Stores > Configuration > Sales > Payment Methods > Klarna > API configuration.

Screenshot of the API configuration settings in Klarna's Adobe Commerce extension.

Adjust the API configuration to enable Klarna payments orders in one of the supported regions.

The Klarna extension allows the use of all Klarna’s payment methods, including Sofort. The payment methods are shown and can be used in the store as long as Klarna provides these in the respective markets and these payment methods are part of the merchant’s contract.

Klarna handles the configuration of the payment methods, so you don’t need to configure individual payment method settings in the shop or in the extension. Based on it there is no need to do any configuration in the shop or on the extension.

You can also use Klarna payments in Adobe Commerce's Progressive Web Apps (PWA) environment. The extension’s configuration in PWA is the same as the configuration of Klarna payments in a non-Adobe Commerce PWA environment. However, an additional request must be sent to a specific endpoint in the extension in the PWA environment. Learn more about Adobe Commerce's PWA environment.

Introduced in m2-klarna extension version 2.0.5 (released May 2023), the authorization callback supports server-side communication for the creation of Klarna payments orders, as client-side order creation may not be successful for all orders.

For more about the Klarna payments authorization callbacks, refer to the Authorization callbacks article.

The shop's web server must allow public access for Klarna to call the shop's authorization callback provided within the m2-klarna extension, for example, https://{shop url}/checkout/klarna/authorize?token={token} . You can confirm the access using a REST API client, for example, Insomnia, by sending a POST request with Content-Type and Accept headers as 'application/json'.

Klarna payments allows business to business (B2B) purchases. The following updates are required for B2B purchases to work:

  1. B2B must be enabled by Klarna for the Merchant ID (MID).
  2. You have to enable B2B in the Admin. You can find the configuration option in Stores > Configuration > Sales > Payment Methods > Klarna > Klarna Payments.

Since currently there’s no supported Adobe Commerce standard selector for customers to flag the order as business to consumer (B2C) or B2B, an order is only considered a B2B one when a customer enters data in the Company Name billing address field.

Screenshot of the Klarna Payments configuration settings, showing the Enable B2B option.

You can enable B2B payments in the Klarna Payments settings in the Adobe Commerce Admin.

In some cases, we require additional information regarding the customer and the purchase in order to make a correct risk assessment. This information, called Extra merchant data (EMD), may consist of data about the customer performing the transaction, the product/services associated with the transaction, or the seller and their affiliates.

The following method returns the request instance, which is later converted to an array and sent as a request to Klarna:

PHP
\Klarna\Kp\Model\Api\Builder\Kasper::getRequest()

It returns the instance Klarna\Kp\Api\Data\RequestInterface (Klarna\Kp\Model\Api\Request).

To add EMD, create an after plugin on this method. To insert the EMD in the request, use the setAttachment method on the request instance.

To include merchant_reference1 and merchant_reference2 data fields, for example, to match the order's merchant references as included in Klarna's settlement files, you can create an after plugin for the \Klarna\Kp\Model\Api\Builder\Kasper::getMerchantReferences method.

PHP
    public function getMerchantReferences(CartInterface $quote): DataObject
    {
        return $this->dataObjectFactory->create([
            'data' => [
                'merchant_reference_1' => $quote->getReservedOrderId(),
                'merchant_reference_2' => ''
            ]
        ]);
    }

Adobe Commerce provides a default design for Klarna elements displayed in the checkout. Since each store can have a different look and feel, the default design may not go well with your store’s theme. The extension lets you change some elements of the default design.

To edit the design settings in the Admin, go to Stores > Configuration > Sales > Payment Methods > Klarna > Klarna Payments > Design.

Screenshot of the Design confuguration options in the Adobe Commerce Admin.

You can customize the way in which Klarna is displayed in your store in the Design section of the Admin.