Some merchants have reported when using Klarna Checkout, double orders happen - that is same order created by the end customer twice, while they only intended to create only one order.
This article gives explanations and how to reduce incidents of double orders when using Klarna checkout.
Reason for double orders
The reason for double orders is, the end-customer does not see the Receipt page or gets some error in the receipt page. Thinking that the order could not be placed, the end customer repeats the order again.
Since Klarna KCO is an iframe, the original order is placed in Klarna. Even if the receipt page fails, Klarna comes back with a background push notification to Litium thus creating the original order.
This results in two legitimate orders, the original one, and the one placed by the end customer thinking the original one failed.
Technical
When Klarna is having service connection problems, calls from Litium to Klarna timeouts. This makes it not possible for Litium to know the details of the Klarna order. This may cause the receipt page to not properly work.
There are possibilities for
- Litium AddOn complain of Klarna connection issues by way of errors or exceptions, causing the receipt page to not get shown. Note that, Litium Klarna AddOn cannot hide these errors from bubbling up, as it will be incorrect to do so. Developers need to handle the errors in the receipt page UI level, please see resolutions below.
- The Klarna KCO receipt iframe snippet may itself fail and show errors
- End-customers device browser may crash
Resolution
It is not possible to fix the issue because it is in the end-users browser, and it is the end customer who places the second order.
However, there is a possibility to reduce the number of double orders.
- Update the Litium Klarna AddOn to its latest version, we have made it more resilient to connection errors to Klarna.
- If Klarna redirects to Confirmation Url, irrespective of any failures, at least show a "Thank you for your order" message. Klarna will later come with a background call push notification to create actual order.
- Implement the following SQL script as a periodic scheduled task, running every hour, and generate an administrative e-mail that has information for administrators to deal with double orders from the business process side.
SQL script to check double orders
Following sql script can be used to check "probable" double orders, the accuracy of it decreases if the time span is increased,
as same end-customer may place the order twice.
Also, we are not checking the actual items ordered (for performance reasons) there is a possibility that the same customer orders two different items in two different orders during the timespan, which ends up having same order grand total.
declare @startTime dateTime
declare @endTime dateTime
declare @paymentState int
-- NOTE: Only finds Probable doubel orders.
-- Accuracy decreases if timespan between start and end is large, as same customer may put two legitimate orders.
set @startTime = '2017-12-21 00:00:00' --2018-12-17 15:17:48.270
set @endTime = '2017-12-21 14:59:59'
set @paymentState = 2 --reseved.
select c.CurrencyCode, w.WebSiteName, o1.ExternalOrderID, o1.GrandTotal, ad1.Email, o1.OrderDate, o1.OrderID as orderId, pi1.PaymentProvider, pi1.PaymentStatus, pi1.TransactionNumber, pi1.TransactionReference, o1.ClientBrowser, o1.ClientIp from ECommerce_Order o1
inner join ECommerce_PaymentInfo pi1 on o1.OrderID = pi1.OrderID
inner join ECommerce_Address ad1 on ad1.AddressID = pi1.BillingAddressID
inner join (
select o.GrandTotal as grandTotal, ad.Email as email, count(1) as orderCount from ECommerce_Order o
inner join ECommerce_PaymentInfo p on o.OrderID = p.OrderID
inner join ECommerce_Address ad on p.BillingAddressID = ad.AddressID
where (o.OrderDate between @startTime AND @endTime)
and p.PaymentStatus = @paymentState --Reserved state
group by o.GrandTotal, ad.Email
having count(1) > 1 ) g on g.grandTotal = o1.GrandTotal and g.email = ad1.Email
inner join Foundation_Currency c on o1.CurrencyID = c.CurrencyID
inner join CMS_WebSite w on o1.WebSiteID = w.WebSiteID
where (o1.OrderDate between @startTime AND @endTime)
order by o1.OrderDate, ad1.Email, o1.ExternalOrderID