MyOnlineStore / omnipay-klarna-checkout

Klarna Checkout gateway for Omnipay

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

401 Unauthorized on v2

DrRoach opened this issue · comments

I use v2 of this repo and for some reason all API requests to live klarna are returning a 401 unauthorised response.

I have checked the API keys being used and verified that they are valid via curl and I can see that the auth headers being set on the sendRequest() call are also correct.

Is v2 still supported? Any ideas what's going on?

Is v2 still supported? Any ideas what's going on?

Not actively no

I have checked the API keys being used and verified that they are valid via curl and I can see that the auth headers being set on the sendRequest() call are also correct.

Just to check the obvious:

  • Are you setting testMode to false?
  • Is the correct API version being used (EU vs. NA)
  • Is the auth header you see being set on sendRequest of the form Authorization => Basic base-64-encoded-username-and-secret ?

Thanks for the response.

testMode is definitely false, 401 logs are appearing in the live klarna site.

Yes the EU version is being used for all requests: api.klarna.com.

This last one may be the cause of the issue, the guzzle auth value is being used but that looks like it's using basic auth and may not be encoding the values? I will try manually setting the auth header with encoding to see if that makes any difference.

@DrRoach could you try with this branch?