• Resolved mb00

    (@mb00)


    Current implementation in klarna-payments-for-woocommerce/classes/class-wc-gateway-klarna-payments.php in WC_Gateway_Klarna_Payments::country_currency_check at line 230 has a flaw:

    $klarna_country = kp_get_klarna_country( $order );
    $country = strtolower( $klarna_country );
    $country_values = KP_Form_Fields::$kp_form_auto_countries[ $country ];

    if ( ! isset( KP_Form_Fields::$kp_form_auto_countries[ $country ] ) ) {
    kp_unset_session_values();
    return new WP_Error( 'country', "Country ({$country}) is not supported by Klarna Payments." );
    }

    You are trying to access array value by key (highlighted in bold) first and then do isset() check and exit the function if it’s not found. Unfortunately this generates a PHP warning for undefined array key every time this method is called.

Viewing 1 replies (of 1 total)
  • Plugin Support louisekrokedil

    (@louisekrokedil)

    Hi,

    We have already made a fix for this but it has not yet been released, a fix will be included in the next release of the Klarna Payments for WooCommerce plugin.

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