Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


apmuskel

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..

Link to comment
Share on other sites

  • 6 months later...
  • 11 months later...

Hi,

 

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..

Link to comment
Share on other sites

  • 3 weeks later...

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();

        tep_db_query(
            '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)
                )
            );

            tep_db_query(
                "INSERT INTO ". TABLE_CONFIGURATION .
                "({$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()'
        );
    }

Link to comment
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.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...