Klarna with multiple countries and channel config

Hi!

I want to create a global channel and klarna for multiple countries. But I can not make it work. The klarna widget doesn’t appear and the error message says “Can’t change payment method”.

I have a channel called en-eu with url-prefix, English (united kingdom) as language and United states as country with euro as currency. Doesn’t it work to have it that way?

I Klarna config I have:

<paymentAccount
          paymentAccIdentifier="KCOV3_EU"
          merchantId="#####"
          sharedSecret="######"
          isTestAccount="true"
          isKlarnaShippingServiceEnabled="true"
          isKlarnaCheckoutEnabled="true"
          isKlarnaPaymentsHppEnabled="true"
          headlessCheckout="false"
          salesCountry="US"
          captureFraudRiskOrders="false"
          distributeHppSessionPaymentLink="false">
      </paymentAccount>

I also tried salesCountry as “BE,BG,CY,CZ,HR,EE,ES,FR,GR,HU,IE,IT,LV,LT,LU,MT,NL,PL,PT,RO,AT,SK,SI”

And in UpdateDataSentToKlarna, I set “klarnaCheckoutOrder.ShippingCountries” with countries BE,BG,CY,CZ,HR,EE,ES,FR,GR,HU,IE,IT,LV,LT,LU,MT,NL,PL,PT,RO,AT,SK,SI.

It works in the local environment (sometimes) but not in the staging.

Thanks!

Litium version: [Version number]

SalesCountry should only include one country. And then you add the individual shipping countries as a list in UpdateDataSentToKlarna, like here.

If you have trace logging for Klarna enabled, you should be able to find the real error behind Can’t change payment method in the litium.log file.

Is the merchant account for NA or EU? Since you’re sending US the addon will try and use the NA environments.
Does staging use a live merchant account? Is multiple countries enabled by Klarna?

I’ve changed the salesCountry to “AT” and we are adding the shipping countries as:

if (string.Equals(klarnaCheckoutOrder.Locale, ConfigurationManager.AppSettings["channel_en-eu"], StringComparison.OrdinalIgnoreCase))
            {
                klarnaCheckoutOrder.ShippingCountries = new List<string>
                {
                    ConfigurationManager.AppSettings["ShippingCountry_be"],
                    ConfigurationManager.AppSettings["ShippingCountry_bg"],
                    ConfigurationManager.AppSettings["ShippingCountry_cy"],
                    ConfigurationManager.AppSettings["ShippingCountry_cz"],
                    ConfigurationManager.AppSettings["ShippingCountry_hr"],
                    ConfigurationManager.AppSettings["ShippingCountry_ee"],
                    ConfigurationManager.AppSettings["ShippingCountry_es"],
                    ConfigurationManager.AppSettings["ShippingCountry_fr"],
                    ConfigurationManager.AppSettings["ShippingCountry_gr"],
                    ConfigurationManager.AppSettings["ShippingCountry_hu"],
                    ConfigurationManager.AppSettings["ShippingCountry_ie"],
                    ConfigurationManager.AppSettings["ShippingCountry_it"],
                    ConfigurationManager.AppSettings["ShippingCountry_lv"],
                    ConfigurationManager.AppSettings["ShippingCountry_lt"],
                    ConfigurationManager.AppSettings["ShippingCountry_lu"],
                    ConfigurationManager.AppSettings["ShippingCountry_mt"],
                    ConfigurationManager.AppSettings["ShippingCountry_nl"],
                    ConfigurationManager.AppSettings["ShippingCountry_pl"],
                    ConfigurationManager.AppSettings["ShippingCountry_pt"],
                    ConfigurationManager.AppSettings["ShippingCountry_ro"],
                    ConfigurationManager.AppSettings["ShippingCountry_at"],
                    ConfigurationManager.AppSettings["ShippingCountry_sk"],
                    ConfigurationManager.AppSettings["ShippingCountry_si"]
                };
            }

In the local enviroment:

In staging:

And we are using the same Klarna for both environments (https://playground.eu.portal.klarna.com)

I guess multiple countries are enabled since it works in the locale environment.
Can’t see any error in the litium.log file.

Do you have the same settings in both environments? The message “The address should be in Austria.” suggests that no additional shipping countries were sent.

You should be able to see in litium.log (again if trace mode is enabled) what values are sent for shipping_countries.

1 Like

Shipping_countries was null. The problem is solved now!
Thank you @NilsN :pray:

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.