Troubleshooting the checkout flow
From version 2.0 of Klarna Checkout for WooCommerce the checkout flow has changed.
The WooCommerce order will now be created first (in Pending status), then the Klarna order is placed, and finally the WooCommerce order is updated to Processing status. This update is more compatible with other WooCommerce plugins.
The new checkout flow also means that Pending orders can be visible in WooCommerce, where the payment has not been finalized in Klarna (for example card payment where there was not enough funds on the card). This is part of the general WooCommerce checkout flow, and it does not implicate that something is wrong. It is just a new scenario for the Klarna Checkout payment gateway.
I see pending orders in WooCommerce, is something wrong?
As mentioned above – you can have pending orders in WooCommerce with Klarna Checkout as the payment method without any errors in your store. These might just be orders not finalized by the customer.
However, if you want to troubleshoot this a bit closer, here’s how you do it.
- Make sure that you have turned on Logging in the plugin settings.
- The logs can be found by navigating to WooCommerce > Status > Logs.
Order creation step by step
- When the customer clicks the Place order button in the Klarna iframe, the following log should be added to the log file:
validation_callback from Klarna triggered.
- In this sequence the Klarna Checkout plugin populates the address fields in the regular WooCommerce checkout form and submits the form. Now a pending order is created in WooCommerce.
- If the order creation went well you should now see the following logs:
Successfully placed order. Sending \"should_procede: true\" to Klarnaand
Confirm the klarna order from the confirmation page.
- If the payment went well you should now see the following log (where KR-KCO-XXXX is replaced by your order number):
Fraud status accepted for order KR-KCO-XXXX. payment_complete triggered.
- If the order creation didn’t go as expected you might see a
Checkout errorcaused by WooCommerce or an
AJAX errorin the log. If you see the AJAX error you need to talk to your developer or the support.
If you don’t see the log
Fraud status accepted for order KR-KCO-XXXX. payment_complete triggered., then there is something wrong in Klarnas system (or in the communication between Klarna and BankID/3DSecure/the acquiring bank). For more information in these cases you need to contact your regions Klarna Merchant Support.
If something went wrong in the confirmation (step 3) we have a backup function running and then you will see a
Confirm the klarna order from the thankyou page in the logs.
Klarna Order Management related logs that you see in the KCO Logs (between Step 3 and 4):
KCO get order management order
The plugin get the order from Klarnas order management API.
KCO acknowledge order
The plugin acknowledges that the order is done.
KCO set merchant reference
The WC order id and WC order number is set on the Klarna order.