• Hello. Sometimes klarna is unavailable, logs point to wrong total tax amount

    Accept: */*
    Accept-Encoding: identity
    Content-Length: 1333
    Content-Type: application/json
    Host: payments-acquiring-service-eu.production.c2c.klarna.net:443
    User-Agent: WordPress/6.7.1; - WooCommerce: 9.4.2 - KP: 3.8.3 - PHP Version: 8.2.15 - Krokedil
    klarna-correlation-id: 2ebcf8fc-e49e-43aa-8c11-81e9ae672b10
    {
    "purchase_country": "IT",
    "purchase_currency": "EUR",
    "locale": "it-IT",
    "order_amount": 1200,
    "order_tax_amount": 100,
    "order_lines": [
    {
    "image_url": "-removed-",
    "name": "-removed-",
    "product_url": "-removed-",
    "quantity": 1,
    "quantity_unit": "pcs",
    "reference": "-removed-",
    "tax_rate": 2300,
    "total_amount": 620,
    "total_discount_amount": 0,
    "total_tax_amount": 100,
    "type": "physical",
    "unit_price": 620
    },
    {
    "name": "-removed-",
    "quantity": 1,
    "quantity_unit": "pcs",
    "reference": "flat_rate:14",
    "tax_rate": 0,
    "total_amount": 600,
    "total_discount_amount": 0,
    "total_tax_amount": 0,
    "type": "shipping_fee",
    "unit_price": 600
    }
    ],
    "customer": {
    "type": "person"
    },
    "billing_address": {
    "given_name": "test",
    "family_name": "test",
    "email": "-removed-",
    "phone": "-removed-",
    "street_address": "asd 12",
    "street_address2": "",
    "postal_code": "20019",
    "city": "asxasxa",
    "region": "AL",
    "country": "IT"
    },
    "shipping_address": {
    "given_name": "test",
    "family_name": "test",
    "email": "-removed-",
    "phone": "-removed-",
    "street_address": "asd 12",
    "street_address2": "",
    "postal_code": "20019",
    "city": "asxasxa",
    "region": "AL",
    "country": "IT"
    },
    "merchant_urls": {
    "authorization": "-removed-wc-api/KP_WC_AUTHORIZATION/"
    }
    }
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter mcdeth

    (@mcdeth)

    This one is however ok:

          "tax_rate": 2300,
    "total_amount": 4830,
    "total_discount_amount": 0,
    "total_tax_amount": 903

    I enter prices incl tax (“Yes, I will enter prices inclusive of tax”) and calculating based on shop base address. I’ve tried also calculating based on customer address.

    The error shows up when customer changes default country (no changes in currency)

    • This reply was modified 6 days, 4 hours ago by mcdeth.
    Plugin Support louisekrokedil

    (@louisekrokedil)

    Hi,

    If you go to WooCommerce Settings –> General, scroll down to the setting Number of decimals. Is it set to 2? If not change it to 2. This is required for the calculation between WooCommerce and the payment solution to be correct and can lead to errors in the checkout or with orders if it is set to 0 or other.

    Thread Starter mcdeth

    (@mcdeth)

    Hi, this problem showed after last update. Thousand separator is blank, decimal is “,” and number of decimals is 2. Trim all zeros at the last from decimal is set to true.

    It works fine only when shipped to default country.

    Plugin Support louisekrokedil

    (@louisekrokedil)

    Hi,

    What should the tax rate be instead of 0 in the first log? Are you using any specific plugin to handle tax?

    This issue might be caused by a compatibility issue with either the theme that you are using or any other plugin that you have activated on your site, please try the following:

    • Try and change the theme to Storefront which is the theme our plugins are tested for and see if that helps.
    • If that does not help try and deactivate all plugins except for WooCommerce and our Klarna plugin and see if the issue is solved. If so, activate all plugins again one by one to see what plugin might be causing the issue.
    • Also go to WooCommerce Status –> Tools, Clear customer sessions and Clear template cache.

    I suggest that you try this in a staging environment of your site to make sure not to effect your live site and customers or create a backup of your site. You can read more about staging environments here. 

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