Skip to content

Commit

Permalink
Correct new fixer.io API urls.
Browse files Browse the repository at this point in the history
  • Loading branch information
ddinchev committed Apr 17, 2018
1 parent 723b49f commit 5474e59
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Here is the list of the currently implemented services.

| Service | Base Currency | Quote Currency | Historical |
|---------------------------------------------------------------------------|----------------------|----------------|----------------|
| [Fixer](http://fixer.io) | * | * | Yes |
| [Fixer](http://fixer.io) | EUR (free, no SSL), * (paid) | * | Yes |
| [European Central Bank](http://www.ecb.europa.eu/home/html/index.en.html) | EUR | * | Yes |
| [Google](http://www.google.com/finance) | * | * | No |
| [Open Exchange Rates](https://openexchangerates.org) | USD (free), * (paid) | * | Yes |
Expand Down
4 changes: 2 additions & 2 deletions src/Service/Fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class Fixer extends HistoricalService
{
const ACCESS_KEY_OPTION = 'access_key';

const LATEST_URL = 'https://api.fixer.io/latest?base=%s&access_key=%s';
const HISTORICAL_URL = 'https://api.fixer.io/%s?base=%s&access_key=%s';
const LATEST_URL = 'http://data.fixer.io/api/latest?base=%s&access_key=%s';
const HISTORICAL_URL = 'http://data.fixer.io/api/%s?base=%s&access_key=%s';

/**
* {@inheritdoc}
Expand Down
6 changes: 3 additions & 3 deletions tests/Tests/Service/FixerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function it_supports_all_queries()
*/
public function it_throws_an_exception_with_error_response()
{
$uri = 'https://api.fixer.io/latest?base=USD&access_key=x';
$uri = 'http://data.fixer.io/api/latest?base=USD&access_key=x';
$content = file_get_contents(__DIR__.'/../../Fixtures/Service/Fixer/error.json');

$service = new Fixer($this->getHttpAdapterMock($uri, $content), null, ['access_key' => 'x']);
Expand All @@ -46,7 +46,7 @@ public function it_throws_an_exception_with_error_response()
*/
public function it_fetches_a_rate()
{
$uri = 'https://api.fixer.io/latest?base=EUR&access_key=x';
$uri = 'http://data.fixer.io/api/latest?base=EUR&access_key=x';
$content = file_get_contents(__DIR__.'/../../Fixtures/Service/Fixer/latest.json');

$service = new Fixer($this->getHttpAdapterMock($uri, $content), null, ['access_key' => 'x']);
Expand All @@ -61,7 +61,7 @@ public function it_fetches_a_rate()
*/
public function it_fetches_a_historical_rate()
{
$uri = 'https://api.fixer.io/2000-01-03?base=USD&access_key=x';
$uri = 'http://data.fixer.io/api/2000-01-03?base=USD&access_key=x';
$content = file_get_contents(__DIR__.'/../../Fixtures/Service/Fixer/historical.json');
$date = new \DateTime('2000-01-03');

Expand Down

0 comments on commit 5474e59

Please sign in to comment.