Get started
Customization
Troubleshooting
- Embedded checkouts in WooCommerce
- Checkout blocks in WooCommerce
- Error codes
- Compatible plugins
- Known compatibility issues
- Shipping Methods in iframe
- FAQ
- Optimizing your checkout when using an Iframe-based checkout
- Callbacks
- Troubleshooting the checkout flow
- Troubleshooting the Pay for order/Hosted Payment Page flow
- Troubleshooting WooCommerce Subscriptions and KCO
- Pending payment orders and held stock
Troubleshooting WooCommerce Subscriptions and KCO
The Checkout flow in Klarna Checkout is constructed in a way that a WooCommerce order will be created first (in Pending status), then the Klarna order is placed, and finally the WooCommerce order is updated to Processing status. This flow is more compatible with other WooCommerce plugins.
This 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.
First, make sure that you have turned on Logging in the plugin settings:
The logs can be found by navigating to WooCommerce → Status → Logs.
Recurring token
When purchasing a subscription product the log will also create a recurring_token
after step 15 KCO get order (GET) in the order creation step by step guide.
The following will also be logged:…"recurring_token": your-recurring-token...
This request is made whenever Klarna notifies us about a change that occurred. We need to retrieve the updated form data from them in such cases. It’s important to note that this type of request can occur multiple times. In this case Klarna notifies that a recurring_token
is created.
Manage Subscription
When handling the subscription order via My account as a customer or via backend as an administrator, for example Suspend, Cancel, Reactivate or Change address on the subscription, nothing will be logged.
Process Renewal order log flow
When processing a renewal order on an already existing subscription a new order should be created in WooCommerce that is connected to this Subscription and this will be added to the log:
KCO create recurring order
id:klarna-order-id, type: POST, title: KCO create recurring order...
Change payment via the My Account page
When a customer change payment via the Change payment-button on the Subscription via the My Account page, this will be logged:
1. KCO create order (POST)
id:klarna-order-id, type:POST,"title": KCO create order
When changing the payment method the customer has to place a new order with a order total of 0 kr. When customers visit the checkout page, a new checkout session is initiated. This action generates a fresh Klarna order ID that will be linked to the ongoing session.
This event should happen once.
2. KCO create HPP (POST)
id:klarna-order-id,type:POST, title: KCO create HPP
A pending payment Woo order was created successfully. Attempting to create a new hosted payment page session at Klarna.
This event should happen once.
3. Redirecting to hosted payment page
Processing order WC order ID (Klarna ID: klarna-order-id) OK. Redirecting to hosted payment page.
The hosted payment page was successfully created, and the customer will be redirected to there. You should see “Customer redirected to Klarna Hosted Payment Page.” in the Woo order note if the redirect was successful.
This event should happen once.
4. KCO get order (GET)
…"recurring_token":your-recurring-token}...
This request is made whenever Klarna notifies us about a change that occurred. We need to retrieve the updated form data from them in such cases. In this case Klarna notifies that a recurring_token
is created.
This event can happen more than once.
Errors that might happen
Failed to redirect to hosted payment page
Failed to create a HPP session with Klarna. Order WC order ID|merchant reference (Klarna ID: klarna-order-id) OK. Redirecting to hosted payment page
We couldn’t create a new hosted payment page session for some reason. At this point, the pending payment order that was created earlier will remain, and similarly, the customer will stay on the same page.
If this error happens it should happen between step 2 and 3 above.