Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Michelle 9 posts 109 karma points
    Aug 30, 2022 @ 08:27
    Michelle
    0

    Vendr Klarna Payment provider issues: Discounts and mixed tax rates

    Hello!

    We have a 20% off all products, including products with 12% VAT and 25% VAT. But now we cant create the order in Klarna because Bad request error.

    We had a bad configured tax property on products, so we didn’t activate 12% until yesterday.

    We believe this new error might be because of the tax rate on the discount, and believe we need to send a discount orderline for each VAT bracket (12 & 25%)

    From current code it seems to take a “static” taxrate from the order and not respect individual discounts.

    Do you agree that this might cause the issue? We can’t find anything in the documentation that explicitly states you have to send discount order line for each tax rate, but it’s the only thing that makes sense right now? We also believe if we didn’t have the 20% all product discount, this wouldn’t be an issue since normally discount is only for shipping in normal cases.

    Kind regards, Michelle

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Aug 30, 2022 @ 08:38
    Matt Brailsford
    0

    Hi Michelle,

    Hmm, yea, I think that could very well be the issue.

    Unfortunately Klarna requires you to send through every value and they MUST add up accordingly (unlike other providers where you can often just send the total to be captured). Whilst the values passed for the actual discount are likely correct as those are created by adding all the discounts together, the tax rate won't be as like you say it's been fixed to the order tax rate and so when Klarna tries to do their calculation, it's probably not right.

    I guess there are 2 options here

    1) Split discounts up per tax rate like you suggested. This would be a little tricky as you'd basically have to go through every discount now and add them together yourself, rather than using the pre-calculated values on the Vendr prices.

    2) Calculate the tax rate of the total fee / adjustment and send that through to Klarna. So rather than it being 20% or 12%, it would end up being some weird percentage that just ends up ensuring the discount value is calculated correctly at Klarnas end.

    In your example then, we would need to do the following for option 2 (6093/(34820-6093))*10000 which would get you 2121 or 21.21% tax rate.

    I guess in the name of clarity, it should probably be option 1, but option 2 would certainly be easier, and I don't suppose option 2 is any less correct from a total perspective, it would just be displaying a calculated tax rate that isn't a tax rate you would have defined.

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Aug 30, 2022 @ 09:47
    Matt Brailsford
    100

    Ok, I've tested opion 2 and it seems to work fine. The Klarna checkout doesn't seem to give you a tax breakdown so I don't think spliting things up will offer much benefit so I think option 2 should be fine.

    If you want to test this too (I already have on my local install) you can find a 2.0.3-beta004 build on our unstable nuget feed at https://nuget.outfield.digital/unstable/vendr/v3/index.json It would be a big help if you were able to confirm this resolves your issue.

    Many thanks

    Matt

  • Michelle 9 posts 109 karma points
    Aug 31, 2022 @ 07:54
    Michelle
    0

    Hello Matt,

    This beta works excellent and fixed our problem.

    Thank you for your quick support!

    Kind regards, Michelle

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Aug 31, 2022 @ 08:50
    Matt Brailsford
    0

    Hi Michelle,

    That's great and thank you for testing.

    I'll get an official version pushed out today.

    Matt

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Aug 31, 2022 @ 13:04
    Matt Brailsford
    0

    Just to let you know v2.0.3 of the Klarna payment provider is out now.

    Many thanks for reporting this issue.

    Matt

Please Sign in or register to post replies

Write your reply to:

Draft