mollie / mollie-api-php

Mollie API client for PHP
http://www.mollie.com
BSD 2-Clause "Simplified" License
552 stars 191 forks source link

Improve api_key validation #40

Closed a3020 closed 8 years ago

a3020 commented 8 years ago

These checks could be improved:

If somehow the .env file in a Laravel application isn't loaded correctly, the default key in the Laravel library remains "test_xxx", and that will pass the tests in the Client.php class.

The API will respond with an "Unauthorized request". A better response would be "Invalid API-key", which would be in line with the for example the "The payment id is invalid" error message.

Note: this is not a bug, but a suggestion.

willemstuursma commented 8 years ago

Thanks @a3020