• Resolved robertrosanke

    (@robertrosanke)


    Hello.

    We have been using the plugin for a while and keep having problems with orders that do not go directly to processing and are sent from the warehouse as usual.

    The order notes then say “customer aborted purche with klarna” and orders are “pending” for ages.

    However, customers don’t seem to notice that the payment has failed.
    So after a few weeks without any progress on the order, we receive an inquiry from the customer and embarrassingly have to admit that they should pay again because we didn’t realize that it didn’t work.

    Other payment methods set the order status to “failed” if the payment fails.
    We already have an automatic mechanism that sends customers an email when the order is changed from “on hold” or “pending” to “failed”.
    However, this does not work with Klarna because Klarna leaves the order status on “pending”.

    How can we get Klarna – like the other payment service providers – to set an order to “failed” if something goes wrong with the payment?

    Regards
    Robert

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Support louisekrokedil

    (@louisekrokedil)

    Hi Robert,

    Order note “customer aborted purchase with klarna” means that the customer have not completed the payment process most often it is because the customer no longer wants to buy the order. As soon as the customer click on Pay order button and Klarna modal opens a Pending Payment order is created in WooCommerce and if the customer do not pay the order the status remains as Pending Payment on the WooCommerce order. If you set a time in the WooCommerce Hold Stock setting the Pending Payment order will automatically be cancelled if the Pending Payment order has not been paid within a certain time.

    However if the customer claims to have paid for the order even though the order is in status Pending Payment in WooCommerce that needs to be investigated further. Or if the customers contact you because of issues in the checkout and therefore can not pay for the order, that also needs to be investigated further.

    We can not set the order status to failed because we do not know why the order was not paid for. If the customer just did not have enough money and wants to pay for the order later, if the customer choose not to pay for the order or if an issue appeared in the checkout.

    Thread Starter robertrosanke

    (@robertrosanke)

    Thanks for the clarification.

    I believe that several inaccuracies lead to the problem.

    Firstly, Klarna seems to be storing orders in the WooCommerce system that a customer (maybe) does not want to make (with Klarna).

    Secondly, Klarna does not communicate failed orders via the order status.

    Now one after the other.

    Problem 1: Orders are saved when a customer cancels the process in the Klarna popup

    “As soon as the customer clicks on Pay order button and Klarna modal opens a Pending Payment order is created in WooCommerce and if the customer do not pay the order the status remains as Pending Payment on the WooCommerce order.”

    As far as I observed it, the official PayPal plugin, for example, only creates an order once the customer has completed the payment process. If I want to buy with PayPal and cancel the process in the PayPal popup, the order is not even created and the user ends up back in the WooCommerce checkout.

    This is logical for me and expected behavior.

    Regardless of whether the customer wants to cancel the order completely or spontaneously decide on a different payment method: the checkout is the right place for the customer to help themselves.

    In the checkout, they can simply close the tab and end the order process. However, they can also simply change the payment method and continue.

    Klarna should proceed in the same way instead of creating an order that is “pending” and leaving the customer and the shop operator in the lurch.

    Problem 2: Failed payments are not communicated via the order status

    “We can not set the order status to failed because we do not know why the order was not paid for.”

    In case of doubt, it doesn’t matter.
    If it didn’t work, it didn’t work.
    And that should be communicated via the order status, I think.

    “We can not set the order status to failed because we do not know why the order was not paid for. If the customer just did not have enough money and wants to pay for the order later, if the customer choose not to pay for the order or if an issue appeared in the checkout.”

    The chosen Klarna method has nothing to do with the order status in WooCommerce.
    If a customer agrees to “pay later” with Klarna, the order will still be set to “in process” in order to be shipped directly.
    The actual payment from the customer to Klarna has nothing to do with the WooCommerce status.

    This applies to all well known payment services that offer customers their own options for more convenient, later payments, or am I wrong?

    So it would be good – if an order fails – to also set the status to failed.
    Then we get the error and can take action.

    At the moment, we should apparently look at every order with “Payment pending” manually and then act manually, depending on what the order notes say?
    Who is supposed to manage this in a store with many orders?

    We have an email template with the order payment link.
    We would like to send this automatically if an order fails.
    No matter which payment method was used.

    Currently it works with all payment methods except Klarna.

    How should we act automatically if Klarna does not inform us via the status change that the order has failed?

    As I said, other payment methods set the status to “failed” in such a case and the issue is resolved.
    We expect the same from Klarna.

    What solution do you suggest?

    Plugin Support louisekrokedil

    (@louisekrokedil)

    Hi Robert,

    Problem 1:
    It is WooCommerce standard behavior to create a Pending Payment order in the background when the payment process starts, you can read more on how WooCommerce Pending Payment status works here. It is not Klarna that creates this Pending Payment order in WooCommerce, it is WooCommerce functionality.

    Problem 2:
    If you set an amount of time in the WooCommerce Hold stock feature (minutes) you do not have to worry about the Pending Payment orders. They will be automatically set to cancelled if they have not been paid for within the set minutes. You only need to worry about the Pending Payment orders if you all of a sudden get more Pending orders then usual or if a customer contacts you regarding an issue when trying to checkout. When an order fails when using our Klarna plugin the order status is set to On Hold on the WooCommerce order.

    Thread Starter robertrosanke

    (@robertrosanke)

    Thank you for your feedback, we have given it some more thought.

    It is WooCommerce standard behavior to create a Pending Payment order in the background when the payment process starts, […].

    That in itself is perfectly fine. It would just be good if Klarna adjusted the status of the created order accordingly after Klarna recognizes that the payment has failed.

    We have analyzed the code of the Klarna plugin. We noticed that Klarna recognizes errors. E.g. in KP_AJAX::kp_wc_auth_failed(), the plugin sets the error message that we have for some failed payments.
    However, there are also other methods that Klarna uses to communicate errors via $order->add_order_note().

    As I said: It would be good if Klarna could automatically change the order status to “failed” if there are problems with the payment.
    If you don’t want to do this, then it would be good if there was an action hook for an individual reaction to errors or a filter, or perhaps simply a plugin setting that can be used to optionally define the order status that failed Klarna orders should have.

    Examples:

    • do_action(‘kp_wc_order_payment_failed’, $order): Fire in any situation where Klarna plugin has set the order_note and completed the handling of a failed payment. Third parties can then react according to their own wishes.
    • apply_filter(‘kp_wc_order_payment_failed_status’, null): Instead of an action hook, you can also change the WooCommerce status automatically if a developer specifies this via the filter and the filtered value is not null.

    If you set an amount of time in the WooCommerce Hold stock feature (minutes) you do not have to worry about the Pending Payment orders. They will be automatically set to cancelled if they have not been paid for within the set minutes.

    We don’t want that.
    It’s not about people not wanting to buy. It’s about the fact that something sometimes doesn’t work when paying via Klarna.
    The customer doesn’t seem to notice. Neither do we. The customer doesn’t want to cancel. So the “hold stock” setting does not correspond to our objective.

    Conclusion:

    It would be good if you could help us to integrate your plugin in a meaningful way.

    To be honest, there is no point in automatically canceling orders that may not be paid due to a technical error. Nor does it do us any good to leave them on “Pending payment”.

    Payment services should clearly and simply indicate when something fails. There is a failed status for this purpose, which other payment providers also use.

    The official plugins from Stripe and PayPal solve this much better. We would be delighted if Klarna were to follow their example.

    If you don’t want to implement this, then I respect that. Nevertheless, it would be nice if you could help us and other plugin users to implement such a status change behavior when a Klarna order has payment problems.

    The best way to do this is via an action hook that you ALWAYS fire after you have registered and handled a payment error. Third parties can then intervene and adapt the behavior to their needs.

    Alternatively, a plugin setting could also be sufficient and you can change the order status yourself if a user has set the setting and a payment has failed. I assume that other Klarna customers will also benefit from this. If you want to automate processes, you won’t get very far with the current approach of the Klarna plugin.

    Thread Starter robertrosanke

    (@robertrosanke)

    I would like to point out once again that the other payment service providers, as far as we are aware, automatically set the order to “failed”. I think it would be a great thing if the plugins of the major payment providers all handled such a case in a similar way. This should make it easier for store operators because a kind of standard behavior is expected and understood.

    Plugin Support louisekrokedil

    (@louisekrokedil)

    Hi @robertrosanke,

    Thanks for your detailed reply.

    We will ask our developers to respond to these questions as it is of more technical nature. Hopefully our devs can respond back to you next week.

    Plugin Support louisekrokedil

    (@louisekrokedil)

    Hi @robertrosanke,

    Respond from developer:
    Your suggestions are reasonable. However, it is difficult to change the existing behavior out of concern for breaking existing stores that might rely on how it works today: remaining “pending payment” or put to “on-hold”. As a compromise, we’ll add a filter to let you modify the order status for when it is most appropriate to set the order status to “failed”.?

    Thread Starter robertrosanke

    (@robertrosanke)

    Hello.

    Thank you for contacting the developer.
    We appreciate the positive feedback and will keep an eye on the plugin changelogs.

    Our support will be happy if failed orders are also handled automatically for orders via Klarna, leaving more time for the really important tasks.

    Thank you!

    If no more input is required from our side, you are welcome to close the ticket.

    Regards
    Robert

    Plugin Support louisekrokedil

    (@louisekrokedil)

    Hi @robertrosanke,

    After further internal discussions, we have decided to enhance the workflow for all plugin users so no filter will be necessary. The updated workflow is planned for release early next year. Until then, the current flow will remain in place.

    Thread Starter robertrosanke

    (@robertrosanke)

    Thank you for the new update. We are happy about this news and are eagerly awaiting the corresponding entry in the plugin changelog.

    We appreciate that you have discussed the whole issue internally again and are ready to make this change.
    Thank you for your help.

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.