During the checkout billing step, Klarna payment options are dynamically displayed based on the customer’s cart details and the payment method categories available for the current Klarna session.
When the customer selects a payment method, a widget displaying additional information about the Klarna product will appear.
The payment methods shown depend on market availability and the contractual agreement with Klarna.
Klarna payment methods may not be displayed under the following conditions:
This functionality is deprecated as of release 24.4.0
By default no action will be applied upon authorization rejections. No configuration changes required.
We've implemented a site preference, kpRejectedMethodDisplay
, allowing merchants to choose how to handle authorization rejections (refer to section 2.3.5 Refusal of Klarna Payments on Payment Method – Authorization). The available options are:
The cartridge implementation follows best practices for integrating Klarna payment methods, offering the inclusion of Extra Merchant Data (EMD) to optimize acceptance rates. EMD can include customer information and Buy Online, Pickup in Store (BOPIS) details when the custom site preference attachments is enabled. Merchants should review and validate EMD data based on their data privacy requirements prior to going live.
When a customer selects a Klarna payment method and clicks "Continue to Place Order," their personally identifiable information (PII) is sent. This information is essential for assessing and verifying the customer's data to display available payment method options.
Steps:
approved = false
), the customer remains on the billing page, no changes to payment options display.Special Case: Pay Now
For the Pay Now payment category, an additional "finalize" call is required when the customer clicks the "Place Order" button on the review page. This ensures that funds are transferred only when the customer decides to place the order. A cookie called selectedKlarnaPaymentCategory
is set in the customer's browser to initialize the finalize
call to Klarna.
The Klarna order is placed just before the SFCC order is created:
APPROVED
) result in the creation of both Klarna and SFCC orders with a "Paid" order payment status and "Ready for Export" export status.REJECTED
and PENDING
) result in a "Not Paid" order payment status and "Not Exported" export status.If a customer authorizes a Klarna payment and then returns to the billing page to select a different non-Klarna payment method, an automatic cancelAuthorization
call is triggered. This releases the authorized funds and frees up the available purchase amount. Merchants can utilize this function for specific use cases.
Merchants should thoroughly test the checkout flow, including scenarios such as:
This functionality is deprecated as of release 24.4.0
By default no action will be applied upon authorization rejections. No configuration changes required.
Upon selecting Klarna as the payment method on the billing step of checkout and based on the customer information provided, Klarna Payments can be refused as a payment method. If the payment method is rejected with show_form=false and approved=false (i.e., hard reject), the merchant can choose how the payment option is displayed on the Billing page using the Business Manager (BM) preference Hide Payment Methods on Deny (kpRejectedMethodDisplay):
Reloading the page will show the denied Klarna payment method again.
The customer is presented with an appropriate message in the Klarna widget when the customer attempts to choose Klarna in the billing step.
If the Klarna API is unavailable or the site/storefront is inapplicable, Klarna will not be presented as a payment option on the billing page. It is recommended that a Klarna session not be created when a customer selects a non-Klarna market or merchant store. This also applies to cases where merchants have multi-currency storefronts with a basket currency not supported by Klarna.
When a Klarna order is created but flagged for additional review, the Commerce Cloud order remains in the Created
status with a Fraud Status of PENDING
. This order is marked with EXPORT_STATUS_NOTEXPORTED
, confirmation status NOTCONFIRMED
, and NOTPAID
.
For orders with a Fraud Status of PENDING
, updates are sent to the pre-configured notification_url
on the merchant's Commerce Cloud site once the review is complete. The updated Fraud Status, such as FRAUD_RISK_ACCEPTED
, is displayed in Business Manager (BM). Push notifications are sent repeatedly (up to 24 hours, every 10 minutes) until the POST request is acknowledged with a 200
response.
Klarna sends one of the following event types in the notification to SFCC to update the risk status:
FRAUD_RISK_ACCEPTED
FRAUD_RISK_REJECTED
FRAUD_RISK_STOPPED
Notifications are generally received within 4-24 hours. The order’s payment transaction is updated accordingly (see kpFraudStatus). This status can be viewed in BM on the order details Payment tab.
FRAUD_RISK_ACCEPTED
FRAUD_RISK_REJECTED or FRAUD_RISK_STOPPED
The Klarna pending functionality availability is dependent on markets and enabled based on the contractual agreement with Klarna.
This feature is disabled by default. However, if standard order management is not suitable for your Klarna integration, you can utilize Klarna’s Merchant Card Service-based virtual card solution. The virtual card is issued against a Klarna order to capture the authorized order amount using standard card rails.
When a customer places an order, it is first booked in SFCC. Once Klarna accepts the order, the Klarna cartridge integration creates a virtual card-based settlement using the Merchant Card Services (MCSv3) API.
After the settlement is created (virtual card returned), the encrypted card details are saved in SFCC. These details can later be used by the merchant's OMS platform or custom PSP integration to authorize the virtual card until the Klarna order is valid. On successful order fulfillment, the funds on the virtual card may be captured. (For delays in capture or special use cases, please speak with the Klarna Key Account Manager in advance). While Klarna is the original payment method, the order amount will be settled with the merchant using the issued virtual credit card instead of a direct bank account transfer.
Please review the procedures with the Klarna team for details of the settlement process using virtual cards. Refer to the code in scripts/payments/processor.js and update accordingly to the integrated cards processor.
If the Klarna order has a fraud_status of PENDING
, action is not taken on the order until receiving Klarna’s push notification that the fraud_status has changed to FRAUD_RISK_ACCEPTED
. The virtual card issued is limited to 1 single successful authorization per order for a given MID. For decrypting the credit card details refer to section Decrypt VCN Card Details.
Credit card authorization call:
If enabled and fully configured, a virtual card settlement request is made successfully. For orders placed with the VCN settlement option, the related custom attributes are shown below:
If required, the additional virtual card details can be assigned to this group in Administration > Site Development > System Object Types > select “Order”. In the Attribute Grouping tab, select Klarna_Payments
and click on “edit”. Assign the new attributes and save the data.
Work with your Klarna Account Manager and Delivery contact in advance to select the appropriate virtual card product based on your business requirements and use cases. You can find information here about other supported use cases.
DO NOT SAVE DECRYPTED PCI DATA ON THE SERVER
It is the responsibility of the merchant to ensure PCI-DSS compliance and to ensure the card data is handled securely in coordination with required partners/Payment Service Provider/Acquirer. Please review in advance the order export details required for virtual card-based Klarna orders. Any historical decrypted PCI data should also be expunged, regardless of the validity date (see the “OrderCleanUp” job section of the installation guide).
Depending on their credentials configuration, merchants should follow these steps to utilize the virtual card integration option:
order_id
as the idempotency key.key_id
+ public key
combination in JWK format to Klarna before testing and going live. It will be used to encrypt the AES key, which encrypts the PCI data on Klarna's side when the settlement request is made. After confirmation from Klarna that the key has been successfully added to your merchant profile, you will be able to use the virtual card-based settlement option for Klarna payment methods.KlarnaActivation
.order_id
as the idempotency key. key_id
+ public key
combination in JWK format to Klarna before testing and going live. It will be used to encrypt the AES key, which encrypts the PCI data on Klarna's side when the settlement request is made. After confirmation from Klarna that the key has been successfully added to your merchant profile, you will be able to use the virtual card-based settlement option for Klarna payment methods.To decrypt the virtual card details stored at the order level and authorize the credit card processor, you can use the following code snippet. This script utilizes the Salesforce Commerce Cloud (SFCC) APIs and classes for cryptographic operations.
OrderMgr.getOrder("order_id")
to fetch the order by its ID.2. Store the VCN Private Key in SFCC: Create a custom attribute to store the private key.
3. Create Site Preference for Single Site Credentials: Go to Administration > System Object Types; select Site Preferences; click on Attribute Definitions; click New to create a custom attribute; define the attribute with ID vcnPrivateKey
, Display Name VCN Private Key, Description SSL private key used only to decode Virtual Card information (used with kpVCNEnabled
), Type Text, and set Mandatory to false; click Apply to save; click on Attribute Grouping; select the Klarna_KP group; add the new attribute vcnPrivateKey
and save; navigate to Merchant Tools > Site Preferences > Custom Site Preference Groups > Klarna Payments and update the vcnPrivateKey
value.
4. Create Custom Object Attribute for Multiple Klarna Credentials per Site: In Business Manager, go to Administration > Site Development > Custom Object Types; edit the custom object type named KlarnaActivation; navigate to the Attributes tab; click New to create a new attribute with Attribute ID vcnPrivateKey
, Display Name VCN Private Key, Description SSL private key used only to decode Virtual Card information (used with kpVCNEnabled
), Value Type Text, and ensure Mandatory is unchecked; navigate to the Attribute Groups tab; edit the vcn attributes group; add the attribute vcnPrivateKey
to the group; go to Merchant Tools > Custom Objects > Manage Custom Objects; select the KlarnaActivation ObjectType and search; enter the vcnPrivateKey
for each entry.
5. Retrieve the VCN Private Key: From Site Preferences (single credentials), use Site.getCurrent().getCustomPreferenceValue('vcnPrivateKey')
; from Custom Object, review KlarnaHelper.getVCNKeyId()
and create a similar function to retrieve the private key using its ID vcnPrivateKey
.
6. Decrypt the AES Key: Convert the encrypted AES key from Base64 to bytes using Encoding.fromBase64
; decrypt the AES key using cipher.decryptBytes
with the RSA algorithm.
7. Decrypt the Card Data: Convert the encrypted card data from Base64 to bytes using Encoding.fromBase64
; decrypt the card data using cipher.decryptBytes
with the AES algorithm.
8. Parse and Extract Card Details: Decode the decrypted card data from URL encoding to UTF-8 format; parse the JSON string to obtain the card details object; extract the card PAN, CVV, and expiry date.
9. Authorize the Credit Card Processor: Use the decrypted card details to proceed with the credit card authorization process.
Auto-capture is enabled via a site preference kpAutoCapture located in the Klarna_Payments preference group. By default, auto-capture is disabled. When enabled, the system attempts to capture the full payment amount automatically.
Paid
.Captured
.The Klarna Payments widget can be styled to align with the marketing and branding needs of the merchant's store. Various graphic elements of the widget can be customized through site preferences.
The payment method name “Klarna Payments” can be customized in the Business Manager.
Steps to Customize
The customized payment method name will be displayed in: