Jump to content

installing new payment module, disapere after install (klarna module)

Recommended Posts

I am trying to install Klarna payment module.

After uploading the files via FTP and logging in to admin in oscommerce I can see the klarna payment module when pressing "install module" .. i highlight the "klarna invoice" and press install.

I then get back to main screen I it looks like klarna is installed but as soon as I click on something it disapere..


I am following klarnas own instucions step by step and cant figure out what I am doing wrong.. any clues?


I have change the currency to SEK(swedish krona) as klarna as and so on..

Share this post

Link to post
Share on other sites

Do you mean this module? If so, it's out of date and probably won't run on a modern server. You might contact them and ask for an updated module.




See my profile for a list of my addons and ways to get support.

Share this post

Link to post
Share on other sites

Hi All 


I am responsible for partner & technology connections for Klarna UK.

It would be good to establish some details around this requirement so that I can direct you to the correct resource.


My details are; paul.stephens@@Klarna.com


Kind Regards 


Share this post

Link to post
Share on other sites



I am trying to install Klarna modules on Osc 2.3.4, but the install fails on errors. I've tried on clean 2.3.4 install too, but it fails there too..  Is there anyone who has got Klarna working on latest Oscommerce or is someone at klarna working on it ?  Paul ?  I've asked Finland Klarna support, but they didn't get it working on their test either..

Share this post

Link to post
Share on other sites

I can't install Klarna payment module on 2.3.4.. It works fine on 2.3.1,but can anyone give some hint what has changed in  modules from 2.3.1 to 2.3.4, so I could try to find the issue ?  Klarna support didn't have any solution :(


The error the install script gives is:

Warning: mysqli_real_escape_string() expects exactly 2 parameters, 1 given in /home/vertical/public_html/catalog/includes/classes/klarna/class.KlarnaUtils.php on line 1519


And the code is (I have marked the error line in bold):

    public function installModule($configuration)
        $default = $this->getDefaultArray();

            'CREATE TABLE IF NOT EXISTS `klarna_ordernum` ('.
            '`orders_id` INT NOT NULL , '.
            '`klarna_ref` VARCHAR( 50 ) NOT NULL , '.
            'UNIQUE ( `orders_id` ), '.
            'FOREIGN KEY ( `orders_id` ) REFERENCES ' .
            TABLE_ORDERS . ' ( `orders_id` )' .

        foreach ($configuration as $config) {
            $merged = array_merge($default, $config);
            $query_string = implode(', ', array_keys($merged));
            $query_values = implode(
                '", "', array_map(
                    "mysqli_real_escape_string", array_values($merged)

                "({$query_string}) VALUES (\"{$query_values}\")"

    * Get the default array for installation method.
    * @@Return array with default values
    public function getDefaultArray()
        return array(
            'configuration_title' => 'null',
            'configuration_key' => 'null',
            'configuration_value' => '',
            'configuration_description' => 'null',
            'configuration_group_id' => 'null',
            'sort_order' => 'null',
            'use_function' => '',
            'set_function' => '',
            'date_added' => 'now()'

Share this post

Link to post
Share on other sites

The code can't call MySQL functions directly, like mysqli_real_escape_string,  without further code changes. They should be replaced with the oscommerce functions. In this case, replace mysqli_real_escape_string with tep_db_input.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now