KlarnaWidget
This page provides an overview of the payments methods provided by the KlarnaWidget adapter in the IXOPAY platform. It also includes a full list of all configuration options available to you when integrating KlarnaWidget within your payments landscape, as well as an overview of the parameters required when submitting a transaction via IXOPAY’s API.
Klarna is a payment provider that offers its own payment methods, but also supports businesses by offering a large selection of the most popular payment methods on the market.
Payment Methods
Connector Config
Integration Guide
To activate the Klarna Widget you will first have to include the payment-widget.js.
- Embed the payment-widget.min.js in your page
It is important to set the data-main="payment-widget-js" attribute on the script tag.
- Provide Container for the Klarna Widget.
- Retrieve a Widget-Token via a Prepare Call (Prepare-Debit or Prepare-Preauthorize). This Call is required to initialize a Klarna Session and provide it with all the checkout data.
- Endpoint:
POST https://gateway.ixopay.com/api/v3/transaction/{apiKey}/prepare-(debit or preauthorize)
Prepare Transaction Parameters
Note that even though Customer Data is required to create the Session, they won’t be emitted until the Klarna’s Authorization Call (EU Regulation)
- Initialize the Klarna Widget with the following parameters:
- The “Public Integration Key” of your Connector
- The “Widget-Token” that you received from the Prepare Call
- Javascript function to handle payment completion
- Javascript function to handle error events
- Authorize / Finalize the Klarna Widget with the following parameters:
- The “Public Integration Key” of your Connector
- The “Widget-Token” that you received from the Prepare Call
- Javascript function to handle payment completion
- Javascript function to handle error events
- Auto-Finalize Option (only available for the Sofort
pay_nowpayment method - default = true), as described in the Klarna Documentation:finalizeis a special call that is needed for the Pay Now payment method category in multistep checkouts. In a multistep checkout scenario theauthorize()call can be triggered when the consumer selects the payment method and then presses the “continue” button to go to the next step of the checkout. With Pay Now as payment method category however transferring the funds should only happen once the consumer has pressed the “buy” button to finalize the purchase. To cater for such a scenario authorize() can still be called when the consumer has selected the payment method, but with theauto_finalizeproperty set to false.
- Send Debit / Preauthorize Request with the received Auth-Token from Step 4.
Send the authorization_token in the extraData object to place the order.
Transaction Request Debit, Preauthorize, Capture
Transaction Parameters
Recurring Transactions
Klarna supports recurring Orders. To create a recurring Order you will have to send your Debit or Preauthorize with the extra “withRegister” flag. For every following recurring Transaction you will have to provide the initial Transaction Uuid as referenceUuid and the transactionIndicator with RECURRING.
Klarna Partial Capturing / Release remaining authorization
Klarna supports partial capturing of created orders. Therefore, send a regular Capture call with the desired capture amount and the corresponding reference Transaction ID. If you did not fully capture the original order amount, you can either send another Capture Request to actually capture the remaining amount or release it with a “Final Capture”. This will “release” the remaining amount and add it to your Klarna Merchant contingent. To release a remaining order amount, you will have to send a Capture with an amount of 0.
Klarna Discounts
Klarna supports transmit of Discount Data, these Data can be sent on either order level oder item level. For further information about this topic please visit the official Klarna Documentation. We assume to receive the correct Discount relevant Data and won’t apply any validation to it. If your send that Data don’t fit the Klarna convention you might be served with a Klarna provided Error.
On Order Level
To achieve an Order Level Discount, you will have to send an Item with the type discount.
Item Level
If you like to send the discount information for a specific Item, you will have to send / add these on the corresponding Item Level as extraData.