- Issue created by @gillmead
- 🇸🇪Sweden cruze72
I have tested the latest version of the module beta-3.0.0 and get the following error message:
An error occurred for order #698: [Klarna\ApiException]: [401] Client error: `POST https://api.klarna.com/payments/v1/sessions` resulted in a `401 Unauthorized` response: @"error_code": "PERMISSION_DENIED", "error_message": "Authentication failed or permission not granted"
I added suggested fix but still get the error.
- First commit to issue fork.
- Merge request !11#3499488 - Set maxlength to 255 on password field → (Merged) created by Fernando_Silva
- 🇫🇮Finland tuutti
I have tested the latest version of the module beta-3.0.0 and get the following error message
Can you check if overriding the API key in settings.php works?
Add something like this to your settings.php file, just replace the
klarna_payments
with the actual ID of your Klarna payment gateway:$config['commerce_payment.commerce_payment_gateway.klarna_payments']['configuration']['password'] = '123';
- 🇸🇪Sweden cruze72
Hi,
Unfortunately not.Error when processing a transaction:
An error occurred for order #709: [Klarna\ApiException]: [401] Client error: `POST https://api.klarna.com/payments/v1/sessions` resulted in a `401 Unauthorized` response: @"error_code": "PERMISSION_DENIED", "error_message": "Authentication failed or permission not granted"Error when running drush command:
[error] Config commerce_payment.commerce_payment_gateway.klarna_payments does not existI have tested with password key in the following formats:
$config['commerce_payment.commerce_payment_gateway.klarna_payments']['configuration']['password']
= '';
$config['commerce_payment.commerce_payment_gateway.klarna_payments']['configuration']['password']
= ''; - 🇫🇮Finland tuutti
You need to change the
klarna_payments
part to match whatever your payment gateway ID is.You can find it by going to Commerce -> Configuration -> Payment gateways.
It should be the value of "ID" field. In my case it's
klarna_payments
:
So if your ID were called
klarna_something
, then the drush command should be:drush cget commerce_payment.commerce_payment_gateway.klarna_something --include-overridden
And the $config:
$config['commerce_payment.commerce_payment_gateway.klarna_something']['configuration']['password'] = 'apikey';
- 🇸🇪Sweden cruze72
Got it. Here is the result:
uuid: f7d15d54-b589-4a9c-bfdf-55716c0716d7
langcode: en
status: true
dependencies:
module:
- commerce_klarna_payments
id: klarna
label: Klarna
weight: null
plugin: klarna_payments
configuration:
display_label: 'Klarna Payments'
mode: live
payment_method_types:
- 'Credit card'
collect_billing_information: true
username: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
password: bnlNIW8pL0NXUGw_TTJLKjY4akpqRXB0SVdmSmxrVU0sYzQyZDg0YzktYjYxMy00NzJlLThlYjYtYjM0ZmYwNDQ4Y2VhLDEsNWJIQTU2ajFBa3Ro
region: eu
cancel_fraudulent_orders: false
options:
color_border: ''
color_border_selected: ''
color_text: ''
color_details: ''
radius_border: ''
conditions: { }
conditionOperator: AND - 🇸🇪Sweden cruze72
Upon further testing it appears the same error message is shown with the similar Commerce Klarna Checkout module.
"PERMISSION_DENIED", "error_message": "Authentication failed or permission not granted"
Would this indicate that either Klarna has changed their API or i am using the wrong login credentials.
Within the Klarna merchant portal there are three options for integrating:
1.Klarna API keys
2. Client ID with password
3. SMTP authenticationI've tried with all three variants and in the case of #1 - with and without the 'klarna_live_api_' prefix in the password.
I am assuming i should use #1 ...?
- 🇫🇮Finland tuutti
Go to Settings -> Klarna API Keys -> click "Generate new Klarna API Key" button and it should give a downloadable text file with "username" and "password".
The password should include the
klarna_live_api_
prefix -
fernando_silva →
committed a0e9cfab on 3.x
#3499488 - Set maxlength to 255 on password field
-
fernando_silva →
committed a0e9cfab on 3.x
Automatically closed - issue fixed for 2 weeks with no activity.