Klarna: Provide own value for merchant_reference2 before payment is activated

The Litium 7 Klarna plug-in sets the merchant_reference2 (“Butiksreferens #2”) to the Delivery id/guid. Is there a way to provide our own value instead?

We don’t have the desired value at checkout when the payment is created, but we would like the value to be set in Klarna before the payment is activated. The Klarna plug-in activates the payment when the order/delivery is set to Delivered.

We can probably do this by manually updating the Klarna order (using the Klarna API), but this would be a completely separate Klarna API integration next to the one the plug-in already has. So something in the plug-in would be preferable.

So the flow would be:

  1. Create Klarna order/payment (handled by plug-in already)
  2. Create Litium Order (handled by plug-in already)
  3. Set Litium order/delivery to Delivered (we do this already using Integration Kit)
  4. Something to update Klarna merchant_reference2 (set something on the Litium Payment?)
  5. Activate/charge Klarna payment (handled by plug-in already)

Litium version: 7 & 8 + accelerator

When public method NotifyOrderCreated is called then Merchant reference 1 & 2 gets set in a private method like this:

if (string.IsNullOrEmpty(kcoOrderData.MerchantReference1))
{
    adapter.UpdateMerchantReferences(kcoOrderData.OrderId, new OrderManagementMerchantReferences()
    {
        MerchantReference1 = paymentInfo.Order.ExternalOrderID,
        MerchantReference2 = paymentInfo.OrderID.ToString()
    });
}

So if you need to change it then you need to call the Klarna API separately.
Klarna API Reference

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.