Torann / laravel-currency

This provides Laravel with currency functions such as currency formatting and conversion using up-to-date exchange rates.
http://lyften.com/projects/laravel-currency
BSD 2-Clause "Simplified" License
395 stars 136 forks source link

exchangeratesapi.io is not free anymore #146

Open Leonigas opened 3 years ago

Leonigas commented 3 years ago

It is now require to sign up on exchangeratesapi.io and get an API KEY to use the service.

We need to update the updateFromExchangeRatesApi function with the API

Change the call to the api from :

https://api.exchangeratesapi.io/latest?base={$defaultCurrency}

to

https://api.exchangeratesapi.io/latest?access_key=&base={$defaultCurrency}

--

And there is a bug in the updateFromExchangeRatesApi function :

Replace

    // Error getting content?
    if (isset($content->error)) {
        $this->error($content->description);

        return;
    }

To

    // Error getting content?
    if (isset($content->error)) {
        $this->error($content->error->info);

        return;
    }

I forked the project and I use laravel 5.8 so I cannot pull the last release to do the changes.