From 9b9fbc8ec109329775208cc1d24b9013166f2c41 Mon Sep 17 00:00:00 2001 From: florianv Date: Thu, 19 Apr 2018 16:35:06 +0200 Subject: [PATCH] Update to latest Swap version --- README.md | 32 +++++++++++++++---------------- composer.json | 2 +- config/swap.php | 10 +++++++--- doc/readme.md | 4 ++-- tests/SwapServiceProviderTest.php | 4 ++-- 5 files changed, 28 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 3094490..b810a40 100644 --- a/README.md +++ b/README.md @@ -85,23 +85,23 @@ The complete documentation can be found [here](https://github.com/florianv/larav Here is the list of the currently implemented services. -| Service | Base Currency | Quote Currency | Historical | -|---------------------------------------------------------------------------|----------------------|----------------|----------------| -| [Fixer](http://fixer.io) | * | * | Yes | -| [European Central Bank](http://www.ecb.europa.eu/home/html/index.en.html) | EUR | * | Yes | -| [Google](http://www.google.com/finance) | * | * | No | +| Service | Registry Alias | Base Currency | Quote Currency | Historical | +|----------------------------------------------------------------|---------------|----------------------|----------------|----------------| +| [Fixer](http://fixer.io) | `fixer` | * | * | Yes | +| [European Central Bank](http://www.ecb.europa.eu/home/html/index.en.html) | `european_central_bank` | EUR | * | Yes | +| [Google](http://www.google.com/finance) | `google` | * | * | No | | [Open Exchange Rates](https://openexchangerates.org) | USD (free), * (paid) | * | Yes | -| [Xignite](https://www.xignite.com) | * | * | Yes | -| [WebserviceX](http://www.webservicex.net/ws/default.aspx) | * | * | No | -| [National Bank of Romania](http://www.bnr.ro) | RON | * | No | -| [Central Bank of the Republic of Turkey](http://www.tcmb.gov.tr) | * | TRY | No | -| [Central Bank of the Czech Republic](http://www.cnb.cz) | * | CZK | No | -| [Russian Central Bank](http://http://www.cbr.ru) | * | RUB | Yes | -| [currencylayer](https://currencylayer.com) | USD (free), * (paid) | * | Yes | -| [Cryptonator](https://www.cryptonator.com) | * Crypto (Limited standard currencies) | * Crypto (Limited standard currencies) | No | -| [1Forge](https://1forge.com) | * (free but limited or paid) | * (free but limited or paid) | No | -| [CurrencyDataFeed](https://currencydatafeed.com) | * (free but limited or paid) | * (free but limited or paid) | No | -| Array | * | * | Yes | +| [Xignite](https://www.xignite.com) | `xignite` | * | * | Yes | +| [WebserviceX](http://www.webservicex.net/ws/default.aspx) | `webservicex` | * | * | No | +| [National Bank of Romania](http://www.bnr.ro) | `national_bank_of_romania` | RON | * | No | +| [Central Bank of the Republic of Turkey](http://www.tcmb.gov.tr) | `central_bank_of_republic_turkey` | * | TRY | No | +| [Central Bank of the Czech Republic](http://www.cnb.cz) | `central_bank_of_czech_republic` | * | CZK | No | +| [Russian Central Bank](http://http://www.cbr.ru) | `russian_central_bank` | * | RUB | Yes | +| [currencylayer](https://currencylayer.com) | `currency_layer` | USD (free), * (paid) | * | Yes | +| [Cryptonator](https://www.cryptonator.com) | `cryptonator` | * Crypto (Limited standard currencies) | * Crypto (Limited standard currencies) | No | +| [1Forge](https://1forge.com) | `forge` | * (free but limited or paid) | * (free but limited or paid) | No | +| [CurrencyDataFeed](https://currencydatafeed.com) | `currency_data_feed` | * (free but limited or paid) | * (free but limited or paid) | No | +| Array | `array` | * | * | Yes | ## Credits diff --git a/composer.json b/composer.json index 743510d..bbe799c 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ }, "require": { "php": "^5.5|^7.0", - "florianv/swap": "^3.3", + "florianv/swap": "^3.4", "psr/cache": "^1.0", "cache/adapter-common": "^0.3" }, diff --git a/config/swap.php b/config/swap.php index 9401e73..7605a2b 100644 --- a/config/swap.php +++ b/config/swap.php @@ -32,8 +32,12 @@ | | Here is the config spec for each service: | - | * "central_bank_of_czech_republic", "central_bank_of_republic_turkey", "european_central_bank", "fixer" - | "google", "national_bank_of_romania", "webservicex", "russian_central_bank", "cryptonator" can be enabled with "true" as value. + | * "central_bank_of_czech_republic", "central_bank_of_republic_turkey", "european_central_bank", "google", + | "national_bank_of_romania", "webservicex", "russian_central_bank", "cryptonator" can be enabled with "true" as value. + | + | * 'fixer' => [ + | 'access_key' => 'secret', // Your app id + | ] | | * 'currency_layer' => [ | 'access_key' => 'secret', // Your app id @@ -59,7 +63,7 @@ | */ 'services' => [ - 'fixer' => true, + 'fixer' => ['access_key' => 'YOUR_KEY'], ], /* diff --git a/doc/readme.md b/doc/readme.md index f52f7e1..80cc1d6 100644 --- a/doc/readme.md +++ b/doc/readme.md @@ -78,7 +78,7 @@ If you wish to use different services, you can modify the `services` configurati ```php // app/config/swap.php 'services' => [ - 'fixer' => true, + 'fixer' => ['access_key' => 'YOUR_KEY'], 'google' => true, ] ``` @@ -229,7 +229,7 @@ Here is the complete list of supported services and their possible configuration 'central_bank_of_republic_turkey' => true, 'currency_layer' => ['access_key' => 'secret', 'enterprise' => false], 'european_central_bank' => true, - 'fixer' => true, + 'fixer' => ['access_key' => 'YOUR_KEY'], 'google' => true, 'national_bank_of_romania' => true, 'open_exchange_rates' => ['app_id' => 'secret', 'enterprise' => false], diff --git a/tests/SwapServiceProviderTest.php b/tests/SwapServiceProviderTest.php index 30d428f..65ba551 100644 --- a/tests/SwapServiceProviderTest.php +++ b/tests/SwapServiceProviderTest.php @@ -81,7 +81,7 @@ public function testAllServices() 'central_bank_of_republic_turkey' => true, 'currency_layer' => ['access_key' => 'secret', 'enterprise' => false], 'european_central_bank' => true, - 'fixer' => true, + 'fixer' => ['access_key' => 'secret'], 'google' => true, 'national_bank_of_romania' => true, 'open_exchange_rates' => ['app_id' => 'secret', 'enterprise' => false], @@ -183,7 +183,7 @@ public function testCustomCache() public function testTaggedService() { $this->app->singleton('service_custom', function ($app) { - return new Fixer($app['swap.http_client'], $app['swap.request_factory']); + return new Fixer($app['swap.http_client'], $app['swap.request_factory'], ['access_key' => 'test']); }); $this->app->tag('service_custom', 'swap.service');