laravel-currency
laravel-currency copied to clipboard
Now API key is needed in exchangerate.host
All calls now prompt the following error:
AmrShawky\Exceptions\RequestException { "success": false, "error": { "code": 101, "type": "missing_access_key", "info": "You have not supplied an API Access Key. [Required format: access_key=YOUR_ACCESS_KEY]" } }
Could it be possible to include an option to use an API key?
Thank you!
Any news? Will you extend this package?
Thanks for reporting this, yes I will extend the package please wait for a new release. meanwhile please use the withOptions method and add the api key as a query param https://docs.guzzlephp.org/en/stable/request-options.html#query
Thanks bro! It seems that they have a problem on their side because every time I try to send a request with the basic plan I get the response "Access Restricted - Your current Subscription Plan does not support this API Function", and I try to send just a basic request which should be included in basic plan :)
No worries, looks like there are a few plans and the higher the plan the more functions you get, nothing stay free forever right :D
https://exchangerate.host/product
Thanks for reporting this, yes I will extend the package please wait for a new release. meanwhile please use the withOptions method and add the api key as a query param https://docs.guzzlephp.org/en/stable/request-options.html#query
Thanks for checking in so quick. Yeah, apparently their service has changed even their website is different, it is still free for 1K requests/month, but now an API key is needed: https://exchangerate.host/
About your workaround, I tried but it still gave me the same error, not sure if I'm missing something?
Currency::convert()->from('USD')->to('EUR')->amount(1)->withOptions(['query' => ['access_key' => env('CURRENCY_API_ID')]])->throw()->get();
Thank you for the package and support!
Oh shot okay thanks, other options works no idea why the query doesn't, maybe you should call the api directly for now using Laravel HTTP client
Thank you for reporting again
Probably this is not working for a trial version
Probably this is not working for a trial version
Annoying I just purchased the basic plan and currency switching still doesn't work even though it is stated on the plan.
@asntcrz just so you know.
I made it work with changing for the free version the end point to not be secured and use http instead of https.
In order for this to be fixed I believe you must add settings for both - api key and the endpoint it self.
Hope this helps.
@asntcrz just so you know.
I made it work with changing for the free version the end point to not be secured and use http instead of https.
In order for this to be fixed I believe you must add settings for both - api key and the endpoint it self.
Hope this helps.
How/where exactly did you update the endpoint to use http instead of https?
Probably this is not working for a trial version
How are you passing the API key to get this error? When I try it just tells me I haven't even supplied an API key. Looks like for you it is seeing your API key but telling you that your plan doens't support the function.
I needed a quick drop in replacement for the convert()
function. Here is something thats working for me, very much a quick fix that uses a free conversion endpoint: https://gist.github.com/ClaraLeigh/7a325b8c12138167b8a3eb7e6976700a
You can use this API to get all the exchange rates from a specific currency
https://open.er-api.com/v6/latest/USD
(change USD to the base you want)
@amrshawky Could you accept, or check the last pull request regarding this topic ?
thanks a lot!
The tests in the PR https://github.com/amrshawky/currency/pull/3 are failing
It's easier guys to use Laravel Http client for now, I just don't have the time now, The package is not only for conversion and the provider seems to change a lot of things so I have to go through all of their docs.