Page 1 of 1

Klarna Checkout on Opencart v3.0.2.0

Posted: Tue Mar 06, 2018 9:27 pm
by extralevel
Hello,

After updating to Opencart version 3.0.2.0, I am now trying to install the payment module Klarna Checkout. However, as soon as I go to the configuration page, I am met with the following error:

"Internal Server Error
<b>Notice</b>: Undefined index: api_token in <b>/home/[website]/domains/[website.com]/public_html/catalog/controller/startup/session.php</b> on line <b>8</b> <b>Notice</b>: Undefined index: username in <b>/home/[website]/domains/[website.com]/public_html/catalog/controller/api/login.php</b> on line <b>11</b> "

I have tried to follow the instructions provided here by straightlight: https://github.com/opencart/opencart/issues/6014
However, the problem persists. What could be causing this issue and how do I solve it? Before the update, Klarna Checkout was working.

Re: Klarna Checkout on Opencart v3.0.2.0

Posted: Sat Mar 10, 2018 12:33 am
by straightlight
The posted instructions on the pointed topic have nothing to do with the error messages you are reporting on this topic. You have referred my username in your first post without knowing if this was the actual issue even when noticing if it was really working previously based on your assumption or rather based on a direction in the platform where it could not be reached until applying the provided fixes which then shows these errors.

Re: Klarna Checkout on Opencart v3.0.2.0

Posted: Sat Mar 10, 2018 12:42 am
by straightlight
In catalog/startup/session.php file,

find:

Code: Select all

if (isset($this->request->get['route']) && substr($this->request->get['route'], 0, 4) == 'api/') {
replace with:

Code: Select all

if (isset($this->request->get['route']) && substr($this->request->get['route'], 0, 4) == 'api/' && !empty($this->request->get['api_token']) && isset($this->request->server['REMOTE_ADDR'])) {
See if that rectifies the issue about the api_token error message.

Re: Klarna Checkout on Opencart v3.0.2.0

Posted: Wed Apr 25, 2018 6:05 pm
by Storeship
Thanks that solved my problem.