Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic auth with & in APIkey #34

Closed
bekatoros opened this issue Dec 1, 2015 · 4 comments
Closed

Basic auth with & in APIkey #34

bekatoros opened this issue Dec 1, 2015 · 4 comments

Comments

@bekatoros
Copy link

Hi,
it seems to be a problem when a & is present in the APIKey.
Basic authorization fails for the php code.
Is there a fix?
curl_setopt($session, CURLOPT_USERPWD, $MerchantId.':'.$APIKey);

@dpnevmatikos
Copy link
Contributor

Hi there @bekatoros ,
Are you getting an error code?
Please also refer to this article for more info.

Let us know if that works out for you.

@bekatoros
Copy link
Author

The authorization error I receive.
HTTP/1.1 401 Invalid password for the merchant with id 45193634-###-###-###-cf6b72e925fb Cache-Control: no-cache Pragma: no-cache Expires: -1 Server: Microsoft-IIS/7.5 Date: Tue, 01 Dec 2015 15:55:36 GMT Content-Length: 0

@dpnevmatikos
Copy link
Contributor

You may need to encode your API key first.
I am not a PHP developer, but a quick Google search revealed this StackOverflow thread which might be what you need.

@bekatoros
Copy link
Author

Fixed by using
curl_setopt($session, CURLOPT_USERPWD, rawurldecode($MerchantId).':'.rawurldecode($APIKey));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants