Skip to content

Commit

Permalink
Update to latest Swap version
Browse files Browse the repository at this point in the history
  • Loading branch information
florianv committed Apr 19, 2018
1 parent 68194ac commit 9b9fbc8
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 24 deletions.
32 changes: 16 additions & 16 deletions README.md
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -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"
},
Expand Down
10 changes: 7 additions & 3 deletions config/swap.php
Expand Up @@ -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
Expand All @@ -59,7 +63,7 @@
|
*/
'services' => [
'fixer' => true,
'fixer' => ['access_key' => 'YOUR_KEY'],
],

/*
Expand Down
4 changes: 2 additions & 2 deletions doc/readme.md
Expand Up @@ -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,
]
```
Expand Down Expand Up @@ -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],
Expand Down
4 changes: 2 additions & 2 deletions tests/SwapServiceProviderTest.php
Expand Up @@ -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],
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit 9b9fbc8

Please sign in to comment.