• Resolved windmeile

    (@windmeile)


    Hi,

    we are using an ERP-system which is connected to woocommerce via API. We are managing all our orders in the ERP. The ERP is also syncing the order status via API, so if an order is send out it sets the status of the order at woocommerce to ?Completed“ via API.

    However, the plugin does not recognize this status change, because when I log into woocommerce and want to refund the order, we get the following message:

    “Klarna order has not been captured and cannot be refunded.“

    But the status is set to ?Completed“ and also the Klarna Order Management widget shows:

    Klarna Environment:?Production
    Klarna order status:?CAPTURED
    Initial Payment method:?Direct Debit

    When I manually change the status back to ?Processing“ and then to ?Completed“ again, I can successfully refund the order.

    TLDR, can you change the code of the plugin in a was such that it can also recognize status changes via API?

    Thanks!

    The page I need help with: [log in to see the link]

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

    (@louisekrokedil)

    Hi,

    Are you using the WooCommerce REST API?
    Could you please send how you have implemented this API?

    Thread Starter windmeile

    (@windmeile)

    sure, under Woocommerce > Settings > Advanced > REST API. There we have created a key, which we set in the settings of the ERP.

    I cannot say for sure what call they are using to change the status because its closed source but I guess it will be standard call from the woo developer documentation.

    Let me know if you need more details. Happy to help.

    Plugin Support Andreas – Krokedil

    (@boozebrorsan)

    Hi!

    It should be able to do this through the Rest-API (we do this ourselves in some setups we have to similar ERP-systems but as we do not know how this is actually being done so it’s hard to tell. When doing something like this through the rest-api it usually skips filters and actions. So ask the service you are using how they do this and see if they can solve this.

    Thread Starter windmeile

    (@windmeile)

    wait, the problem is, that the klarna plugin is apparently not able to recognize that an order is being set to status ?completed“ (via api) and – even worse – that an order is already captured (or shown as captured and it is not). That is a huge flaw.

    I don’t need to ask them because you gave the answer yourself: a status change via api skips hooks and filters and apparently your plugin relies on them. I did all the debugging work and the bug should be clear, now I just need you to fix it.

    I am not a developer but it should be fairly easy to fix it….

    Plugin Support louisekrokedil

    (@louisekrokedil)

    Hi,

    As my colleague mentioned, when using the rest API it skips the most filters and actions but it should still be triggered if you also complete the order with the rest API.

    Thread Starter windmeile

    (@windmeile)

    how can this be explained then?

    Plugin Support Andreas – Krokedil

    (@boozebrorsan)

    Hi!

    First off,

    I have tested now to set an order from Processing to Completed through the WC rest-api following WC standard documentation: https://woocommerce.github.io/woocommerce-rest-api-docs/v3.html#orders and it works as expected.

    This error message “Klarna order has not been captured and cannot be refunded“ comes when the WC order “believe” that the order has not been captured. Even though I see that the order is captured in the Klarna portal. This what we need to look into what might be missing here.

    What has happened in the order you are showing in the screenshot is a bit strange and I have tried and re-create that scenario but I can not. So I wonder if it’s possible that you can start a support-ticket direct with us so we can have a look at the order in its full and perhaps check your logs? This way we can debug this deeper. The info is NOT something that should be shared here in a public forum.
    We can after debugging this summarize it here.

    I hope this sounds good to you?

    Thread Starter windmeile

    (@windmeile)

    the problem is solved after doing some maintenance (plugin/wordpress updates)

    Plugin Support Andreas – Krokedil

    (@boozebrorsan)

    @windmeile

    Great to hear that! Good luck with the store.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Klarna order has not been captured and cannot be refunded.’ is closed to new replies.