ash-jc-allen / laravel-exchange-rates

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

ExchangeRateHost Driver now needs an API key #131

Closed tykobradyer closed 10 months ago

tykobradyer commented 11 months ago

Hello!

The driver https://api.exchangerate.host/ now requires an API key. Using the said driver will now return an error:

{
  "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]"
  }
}

e.g. https://api.exchangeratesapi.io/history?base=GBP&symbols=USD


Additionally, it looks like the endpoint has now different paths and parameters according to their documentation. This makes the class SharedDriverLogicHandler incompatible anymore.

ash-jc-allen commented 11 months ago

Hey! Thanks for letting me know about this. I'm having flashbacks to when this happened a couple of years ago with another API service: https://github.com/ash-jc-allen/laravel-exchange-rates/issues/55

I'll try and take a look at this over the weekend or next week and get it working again 🙂

ash-jc-allen commented 10 months ago

Hey! Apologies that it's taken so long for me to get to this. Life has been crazy hectic recently! 😅

I've just tagged and released v7.1.1 (https://github.com/ash-jc-allen/laravel-exchange-rates/releases/tag/v7.1.1) that should hopefully get the package working with this API again.

However, please note that if you're using the free plan, this API service doesn't allow HTTPS requests anymore. So you'll need to set the newly added laravel-exchange-rates.https config option to false so that the requests are sent using HTTP.

You'll also need to add your new API key to the .env file like so:

EXCHANGE_RATES_API_KEY={Your-API-Key-Here}

Hopefully, this should get everything back up and running and there shouldn't be any more surprise API changes.

If you spot any issues, please give me a shout so I can investigate and fix! 😄