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

Error when running currency:update #79

Closed RalphMRivera closed 7 years ago

RalphMRivera commented 7 years ago

I ran this:

php artisan currency:manage add AFA,AWG,AUD,ARS,AZN,BSD,BDT,BBD,BYR,BOB,BRL,GBP,BGN,KHR,CAD,KYD,CLP,CNY,COP,CRC,HRK,CPY,CZK,DKK,DOP,XCD,EGP,ERN,EEK,EUR,GEL,GHC,GIP,GTQ,HNL,HKD,HUF,ISK,INR,IDR,ILS,JMD,JPY,KZT,KES,KWD,LVL,LBP,LTL,MOP,MKD,MGA,MYR,MTL,BAM,MUR,MXN,MZM,NPR,ANG,TWD,NZD,NIO,NGN,KPW,NOK,OMR,PKR,PYG,PEN,PHP,QAR,RON,RUB,SAR,CSD,SCR,SGD,SKK,SIT,ZAR,KRW,LKR,SRD,SEK,CHF,TZS,THB,TTD,TRY,AED,USD,UGX,UAH,UYU,UZS,VEB,VND,AMK,ZWD

followed by this:

php artisan currency:update

And got the following error:

Updating currency exchange rates from Finance Yahoo...

  [ErrorException]                 
  A non-numeric value encountered  
pan85 commented 7 years ago

Yep, this is problem when you run the command on php 71

ghost commented 7 years ago

Whats the solution to this?

ghost commented 7 years ago

I can confirm this problem. It appears that Yahoo is no longer allowing the service. You'' have to use openexchangerates.org

Torann commented 7 years ago

Sadly Yahoo is no longer supported. The good news is you can run the update command once an hour and still fall inside of the free tier for openexchangerates

ghost commented 7 years ago

Yes, but you can’t change the base rate for free. Maybe add fixer.io. It works well.

Torann commented 7 years ago

This is true. I'll have to look into it more tomorrow. fixer.io seems really simple to implement.

ghost commented 7 years ago

It is. I had an implementation working with the currency package in 15 mins. 👍🏻

azrahn commented 7 years ago

I have no problems pulling from Yahoo with php 7.0, Only problem is when pulling with php 7.1.

Torann commented 7 years ago

I don't see how @azrahn, this is what Yahoo sends back when using their old endpoint:

It has come to our attention that this service is being used in violation of the Yahoo Terms of Service. As such, the service is being discontinued. For all future markets and equities data research, please refer to finance.yahoo.com.

http://download.finance.yahoo.com/d/quotes.csv