• Resolved deca90

    (@deca90)


    Hi,
    unfortunately Klarna does not work on my website https://www.foodhubmagazine.com
    This error appears:
    —-
    Invalid payment_method_options[klarna][preferred_locale]: must be one of de-AT, en-AT, da-DK, en-DK, fi-FI, sv-FI, en-FI, de-DE, en-DE, nl-NL, en-NL, nb-NO, en-NO, sv-SE, en-SE, en-GB, en-US, es-US, nl-BE, fr-BE, en-BE, es-ES, en-ES, it-IT, en-IT, fr-FR, en-FR, or en-IE

    I absolutely need to fix this.`

    Thanks for your support

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Payment Plugins

    (@mrclayton)

    Hi @deca90

    Does the error message say which locale was sent to Stripe that triggered the error?

    If not can you log into your stripe.com account and look at the log entries and see if it indicates what value was passed?

    What is your stripe account ID? You can find that on the API settings page of the stripe plug-in.

    Kind regards

    Plugin Author Payment Plugins

    (@mrclayton)

    @deca90 I was able to locate the error log. It says the locale that was passed was -.

    Can you go to your WordPress > Settings > General page and check what your locale setting is?

    Kind Regards,

    Thread Starter deca90

    (@deca90)

    Do I have to check the language of the site?

    Currently the language set is Italian.

    Plugin Author Payment Plugins

    (@mrclayton)

    Do I have to check the language of the site?

    Yes, what is the locale/language option that you have set? The actual value will be something like it-IT or it etc.

    I suspect it’s just a 2 character value but if you can confirm that will help track down why the locale value that’s sent to Stripe is -.

    Kind Regards,

    Thread Starter deca90

    (@deca90)

    The language is Italian.
    Where exactly should I check for this code?

    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @deca90,

    If you go to the WordPress > Settings > General page > Site Language in your WordPress Admin there will be a language selected. Please provide what that value is in case there are multiple options for Italian on your site such as IT, en-IT, it-IT etc.

    You can also view that value in the WordPress options table. It’s option_name is WPLANG.

    Kind Regards,

    Thread Starter deca90

    (@deca90)


    This is my site’s language setting display screen.

    As you can see, only Italian is indicated without any initials.
    Thanks for your support.

    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @deca90,

    For now, add the following snippet of code to your site.

    add_filter('wc_stripe_payment_intent_args', function($args){
        if(isset($args['payment_method_options']['klarna'])){
            $args['payment_method_options']['klarna']['preferred_locale'] = 'it-IT';
        }
        return $args;
    }, 10, 1);

    That will send the locale you want.

    Kind Regards,

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Invalid payment_method_options[klarna][preferred_locale]’ is closed to new replies.