We are using the Klarna v3 payment provider, but there is a problem related to discounts.
This is returned from Klarna:
Bad value: order_tax_amount differs from the calculated value
We have decompiled the dll and found the issue:
while (((IEnumerator) enumerator).MoveNext())
{
OrderLine current = enumerator.Current;
if (current.HasType((OrderLineType) 0) || current.HasType((OrderLineType) 5) || current.HasType((OrderLineType) 2))
{
cartItemList.Add(new KlarnaCheckout.CartItem()
{
Number = current.get_Product().get_Number(),
Title = current.get_Product().get_Name(),
Quantity = current.get_AllowOverridePrices() ? 1 : (int) current.get_Quantity(),
PriceWithVAT = current.get_AllowOverridePrices() ? current.get_Price().get_PriceWithVAT() : current.get_UnitPrice().get_PriceWithVAT(),
TaxRate = current.get_Price().get_VATPercent(),
TotalAmount = current.get_Price().get_Price(),
TotalTaxAmount = current.get_Price().get_VAT()
});
}
else
{
bool flag = current.HasType((OrderLineType) 1) || current.HasType((OrderLineType) 3);
cartItemList.Add(new KlarnaCheckout.CartItem()
{
ItemType = flag ? "discount" : "physical",
Number = flag ? current.get_DiscountId() : current.get_Id(),
Title = current.get_ProductName(),
Quantity = 1,
PriceWithVAT = current.get_Price().get_PriceWithVAT(),
TaxRate = 0.0,
TotalAmount = current.get_Price().get_Price(),
TotalTaxAmount = 0.0
});
}
}
As you can see, the tax is hardcoded...
Can anyone in DW please provide a new dll where this is fixed? Support is informed, but we really need the fix ASAP!