ash-jc-allen / laravel-exchange-rates

A Laravel wrapper package for interacting with the exchangeratesapi.io API.
MIT License
449 stars 49 forks source link

Undefined index: rates exception caused by missing_access_key API error #55

Closed SanderMuller closed 3 years ago

SanderMuller commented 3 years ago

I am getting an exception: Undefined index: rates

image

When looking further I see that the API is returning an error.

dd($this->requestBuilder->makeRequest($url, $queryParams));

Results in image

I requested an access key from exchangeratesapi.io, but currently there is no way of providing an access key to this package

ash-jc-allen commented 3 years ago

Hi @SanderMuller! Sorry that you're having problems with this package. I've just had a quick look at the API and it looks like that, as of the past few days, they now require an API key to make any requests.

This is going to need some changes to the package to support these new changes. I'll try and work on this over the next day or so to get it running again as usual.

SanderMuller commented 3 years ago

@ash-jc-allen thanks for your quick response and for being able to work on it the coming days!

amit-viacon commented 3 years ago

Quick and dirty fix:

Modify RequestBuilder.php to add different API URL

    private $baseUrl = 'https://api.ratesapi.io/api';

Works for my use case

ash-jc-allen commented 3 years ago

Just leaving this link here for reference: https://github.com/exchangeratesapi/exchangeratesapi/issues/117

Gigamick commented 3 years ago

This killed my app today too :-)

ash-jc-allen commented 3 years ago

@GigaMick I'm sorry about this. It seems like it's affected quite a lot of people and there was zero warning that any of this was going to happen (or if there was, I missed it) :disappointed:

ash-jc-allen commented 3 years ago

I've just tagged a new v4.0.0 release (https://github.com/ash-jc-allen/laravel-exchange-rates/releases/tag/v4.0.0) that should hopefully solve these issues. Unfortunately, it looks like the actual API has changed and some of the features that it used to offer are now behind paywalls. So, if you're only using the

I've done my best on such short notice to try and get this ready so that everyone gets up and running as quickly as possible again. So, if there are any issues with the code, I do apologise, as it was done in a bit of a rush.

I've heard other devs mentioning that you can possibly switch over to https://exchangerate.host/ if you're looking for a free API. If enough people think this might be useful, I'll try and take some time over the weekend to extend the package so that it can also be used with that service.

I hope that this works for everyone and that you all have a great weekend! :smile:

Gigamick commented 3 years ago

I've just tagged a new v4.0.0 release (https://github.com/ash-jc-allen/laravel-exchange-rates/releases/tag/v4.0.0) that should hopefully solve these issues. Unfortunately, it looks like the actual API has changed and some of the features that it used to offer are now behind paywalls. So, if you're only using the

I've done my best on such short notice to try and get this ready so that everyone gets up and running as quickly as possible again. So, if there are any issues with the code, I do apologise, as it was done in a bit of a rush.

I've heard other devs mentioning that you can possibly switch over to https://exchangerate.host/ if you're looking for a free API. If enough people think this might be useful, I'll try and take some time over the weekend to extend the package so that it can also be used with that service.

I hope that this works for everyone and that you all have a great weekend! 😄

Appreciate the quick work here. For now I've removed your package from my app but I do need it so I'll put it back in in a little while when things are confirmed to be stable again. Thanks for all the code!

ash-jc-allen commented 3 years ago

@GigaMick That's totally understandable. Hopefully, no other drastic changes like this will happen in the near future and we can get back to the usual stability.