danielme85 / laravel-cconverter

A simple currency converter plugin for Laravel 5. Currency providers: The European Central Bank, OpenExchange, CurrencyLayer and fixer.io
https://danielmellum.com/projects/currency-converter
MIT License
42 stars 10 forks source link

rateSeries() not working #11

Open luria opened 5 years ago

luria commented 5 years ago

Hi, I think the rateSeries is not working,

Even after fixing the minor typo in the date,

//Get historical rate series $rates = Currency::rateSeries('USD', 'NOK', '2016-12-24', ''2016-12-31);

//Get historical rate series $rates = Currency::rateSeries('USD', 'NOK', '2016-12-24', '2016-12-31');

the system says:

Call to undefined method danielme85\CConverter\Currency::rateSeries()

danielme85 commented 5 years ago

Hmm... Let me take a look at that, might be able this weekend or early next week. Not sure if readme is wrong or something might have been removed/changed when I re-wrote this a while back. Thank you for letting me know!

danielme85 commented 5 years ago

Try Currency::rates() I think I forgot to update the readme.

danielme85 commented 5 years ago

Sorry, there is no rateSeries anymore. This used to be supported by free Yahoo finance data, that source is not anymore. Only other provider supporting this is 'currencylayer' but only with a paid subscription plan, so I did not include this when I re-wrote this. I also don't want to have to pay for a service just to add this feature that I won't be using myself. I removed this example from the readme.

luria commented 5 years ago

Hi Daniel!. Thanks for your reply. I totally understand not including that feature if it is a paid option.

But does not the ECB provide this info? https://sdw-wsrest.ecb.europa.eu/help/

startPeriod & endPeriod Defining a date range

It is possible to define a date range for which observations should be returned by using the startPeriod and/or endPeriod parameters. The values should be given according to the syntax defined in ISO 8601 or as SDMX reporting periods. The format will vary depending on the frequency. The supported formats are:

YYYY for annual data (e.g.: 2013).
YYYY-S[1-2] for semi-annual data (e.g.: 2013-S1).
YYYY-Q[1-4] for quarterly data (e.g.: 2013-Q1).
YYYY-MM for monthly data (e.g.: 2013-01).
YYYY-W[01-53] for weekly data (e.g.: 2013-W01).
YYYY-MM-DD for daily data (e.g.: 2013-01-01).
danielme85 commented 5 years ago

Ah ok, yeah that sounds like a good idea. Eurobank is the default provider, it's free and don't require any signup/key so I like the idea of enhancing that source. I can't promise any timeline though but shouldn't not be too much work.