Skip to content

Commit e1113d2

Browse files
committed
feat: updated doc
1 parent be3e4b3 commit e1113d2

File tree

2 files changed

+48
-44
lines changed

2 files changed

+48
-44
lines changed

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,28 @@
55
[![Scrutinizer](https://img.shields.io/scrutinizer/g/florianv/exchanger.svg?style=flat-square)](https://scrutinizer-ci.com/g/florianv/exchanger)
66
[![Version](http://img.shields.io/packagist/v/florianv/exchanger.svg?style=flat-square)](https://packagist.org/packages/florianv/exchanger)
77

8-
Exchanger is a PHP framework to work with currency exchange rates from various services such as
9-
**[Fixer](https://fixer.io)**, **[currencylayer](https://currencylayer.com)**,
10-
**[exchangeratesapi](https://exchangeratesapi.io)** or **[Abstract](https://www.abstractapi.com)**.
8+
Exchanger is a PHP framework to work with currency exchange rates from various services such as
9+
**[Fixer](https://apilayer.com/marketplace/fixer-api)**, **[Currency Data](https://apilayer.com/marketplace/currency_data-api)**,
10+
**[Exchange Rates Data](https://apilayer.com/marketplace/exchangerates_data-api)** or **[Abstract](https://www.abstractapi.com)**.
1111
Looking for a simple library based on Exchanger ? Check out [Swap](https://github.com/florianv/swap) !
1212

1313
## Sponsors
1414

1515
<table>
1616
<tr>
17-
<td><img src="https://s3.amazonaws.com/swap.assets/fixer_icon.png?v=2" width="50px"/></td>
18-
<td><a href="https://fixer.io">Fixer</a> is a simple and lightweight API for foreign exchange rates that supports up to 170 world currencies.</td>
17+
<td><img src="https://assets.apilayer.com/apis/fixer.png" width="50px"/></td>
18+
<td><a href="https://apilayer.com/marketplace/fixer-api">Fixer</a> is a simple and lightweight API for foreign exchange rates that supports up to 170 world currencies.</td>
1919
</tr>
2020
<tr>
21-
<td><img src="https://s3.amazonaws.com/swap.assets/currencylayer_icon.png" width="50px"/></td>
22-
<td><a href="https://currencylayer.com">currencylayer</a> provides reliable exchange rates and currency conversions for your business up to 168 world currencies.</td>
21+
<td><img src="https://assets.apilayer.com/apis/currency_data.png" width="50px"/></td>
22+
<td><a href="https://apilayer.com/marketplace/currency_data-api">Currency Data</a> provides reliable exchange rates and currency conversions for your business up to 168 world currencies.</td>
2323
</tr>
2424
<tr>
25-
<td><img src="https://exchangeratesapi.io/assets/images/api-logo.svg" width="50px"/></td>
26-
<td><a href="https://exchangeratesapi.io">exchangeratesapi</a> provides reliable exchange rates and currency conversions for your business with over 15 data sources.</td>
25+
<td><img src="https://assets.apilayer.com/apis/exchangerates_data.png" width="50px"/></td>
26+
<td><a href="https://apilayer.com/marketplace/exchangerates_data-api">Exchange Rates Data</a> provides reliable exchange rates and currency conversions for your business with over 15 data sources.</td>
2727
</tr>
2828
<tr>
29-
<td><img src="https://global-uploads.webflow.com/5ebbd0a566a3996636e55959/5ec2ba27ede983917dbff22f_favicon.png" width="50px"/></td>
29+
<td><img src="https://global-uploads.webflow.com/5ebbd0a566a3996636e55959/5ec2ba29feeeb05d69160e7b_webclip.png" width="50px"/></td>
3030
<td><a href="https://www.abstractapi.com/">Abstract</a> provides simple exchange rates for developers and a dozen of APIs covering thousands of use cases.</td>
3131
</tr>
3232
</table>
@@ -41,9 +41,9 @@ Here is the complete list of the currently implemented services:
4141

4242
| Service | Base Currency | Quote Currency | Historical |
4343
|---------------------------------------------------------------------------|----------------------|----------------|----------------|
44-
| [Fixer](https://fixer.io) | EUR (free, no SSL), * (paid) | * | Yes |
45-
| [currencylayer](https://currencylayer.com) | USD (free), * (paid) | * | Yes |
46-
| [exchangeratesapi](https://exchangeratesapi.io) | EUR (free), * (paid) | * | Yes |
44+
| [Fixer](https://apilayer.com/marketplace/fixer-api) | EUR (free, no SSL), * (paid) | * | Yes |
45+
| [Currency Data](https://apilayer.com/marketplace/currency_data-api) | USD (free), * (paid) | * | Yes |
46+
| [Exchange Rates Data](https://apilayer.com/marketplace/exchangerates_data-api) | USD (free), * (paid) | * | Yes |
4747
| [Abstract](https://www.abstractapi.com) | * | * | Yes |
4848
| [coinlayer](https://coinlayer.com) | * Crypto (Limited standard currencies) | * Crypto (Limited standard currencies) | Yes |
4949
| [European Central Bank](https://www.ecb.europa.eu/home/html/index.en.html) | EUR | * | Yes |

doc/readme.md

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44

55
<table>
66
<tr>
7-
<td><img src="https://s3.amazonaws.com/swap.assets/fixer_icon.png?v=2" width="50px"/></td>
8-
<td><a href="https://fixer.io">Fixer</a> is a simple and lightweight API for foreign exchange rates that supports up to 170 world currencies.</td>
7+
<td><img src="https://assets.apilayer.com/apis/fixer.png" width="50px"/></td>
8+
<td><a href="https://apilayer.com/marketplace/fixer-api">Fixer</a> is a simple and lightweight API for foreign exchange rates that supports up to 170 world currencies.</td>
99
</tr>
1010
<tr>
11-
<td><img src="https://s3.amazonaws.com/swap.assets/currencylayer_icon.png" width="50px"/></td>
12-
<td><a href="https://currencylayer.com">currencylayer</a> provides reliable exchange rates and currency conversions for your business up to 168 world currencies.</td>
11+
<td><img src="https://assets.apilayer.com/apis/currency_data.png" width="50px"/></td>
12+
<td><a href="https://apilayer.com/marketplace/currency_data-api">Currency Data</a> provides reliable exchange rates and currency conversions for your business up to 168 world currencies.</td>
1313
</tr>
1414
<tr>
15-
<td><img src="https://exchangeratesapi.io/assets/images/api-logo.svg" width="50px"/></td>
16-
<td><a href="https://exchangeratesapi.io">exchangeratesapi</a> provides reliable exchange rates and currency conversions for your business with over 15 data sources.</td>
15+
<td><img src="https://assets.apilayer.com/apis/exchangerates_data.png" width="50px"/></td>
16+
<td><a href="https://apilayer.com/marketplace/exchangerates_data-api">Exchange Rates Data</a> provides reliable exchange rates and currency conversions for your business with over 15 data sources.</td>
1717
</tr>
1818
<tr>
19-
<td><img src="https://global-uploads.webflow.com/5ebbd0a566a3996636e55959/5ec2ba27ede983917dbff22f_favicon.png" width="50px"/></td>
19+
<td><img src="https://global-uploads.webflow.com/5ebbd0a566a3996636e55959/5ec2ba29feeeb05d69160e7b_webclip.png" width="50px"/></td>
2020
<td><a href="https://www.abstractapi.com/">Abstract</a> provides simple exchange rates for developers and a dozen of APIs covering thousands of use cases.</td>
2121
</tr>
2222
</table>
@@ -62,9 +62,9 @@ The complete list of all supported services is available [here](https://github.c
6262

6363
```php
6464
use Http\Client\Curl\Client as CurlClient;
65-
use Exchanger\Service\Fixer;
66-
use Exchanger\Service\CurrencyLayer;
67-
use Exchanger\Service\ExchangeRatesApi;
65+
use Exchanger\Service\ApiLayer\CurrencyData;
66+
use Exchanger\Service\ApiLayer\ExchangeRatesData;
67+
use Exchanger\Service\ApiLayer\Fixer;
6868
use Exchanger\Service\AbstractApi;
6969
use Exchanger\Exchanger;
7070

@@ -74,17 +74,17 @@ $options = [
7474
];
7575
$client = new CurlClient(null, null, $options);
7676

77-
// Use the Fixer.io service
78-
$service = new Fixer($client, null, ['access_key' => 'YOUR_KEY']);
77+
// Use the Fixer service
78+
$service = new Fixer($client, null, ['api_key' => 'Get your key here: https://apilayer.com/marketplace/fixer-api']);
7979

80-
// Or use the currencylayer.com service
81-
$service = new CurrencyLayer($client, null, ['access_key' => 'access_key', 'enterprise' => false]);
80+
// Or use the CurrencyData service
81+
$service = new CurrencyData($client, null, ['api_key' => 'Get your key here: https://apilayer.com/marketplace/currency_data-api']);
8282

83-
// Or use the exchangeratesapi.io service
84-
$service = new ExchangeRatesApi($client, null, ['access_key' => 'access_key', 'enterprise' => false]);
83+
// Or use the ExchangeRatesData service
84+
$service = new ExchangeRatesData($client, null, ['api_key' => 'Get your key here: https://apilayer.com/marketplace/exchangerates_data-api']);
8585

86-
// Or use the abstractapi.com service
87-
$service = new AbstractApi($client, null, ['api_key' => 'api_key']);
86+
// Or use the AbstractApi service
87+
$service = new AbstractApi($client, null, ['api_key' => 'Get your key here: https://app.abstractapi.com/users/signup']);
8888

8989
// Create Exchanger with your service
9090
$exchanger = new Exchanger($service);
@@ -143,20 +143,20 @@ Simply create a `Chain` service to wrap the services you want to chain.
143143

144144
```php
145145
use Exchanger\Service\Chain;
146-
use Exchanger\Service\Fixer;
147-
use Exchanger\Service\CurrencyLayer;
148-
use Exchanger\Service\ExchangeRatesApi;
146+
use Exchanger\Service\ApiLayer\CurrencyData;
147+
use Exchanger\Service\ApiLayer\ExchangeRatesData;
148+
use Exchanger\Service\ApiLayer\Fixer;
149149
use Exchanger\Service\AbstractApi;
150150

151151
$service = new Chain([
152-
new Fixer($client, null, ['access_key' => 'YOUR_KEY']),
153-
new CurrencyLayer($client, null, ['access_key' => 'access_key', 'enterprise' => false]),
154-
new ExchangeRatesApi($client, null, ['access_key' => 'access_key', 'enterprise' => false]),
155-
new AbstractApi($client, null, ['api_key' => 'api_key'])
152+
new Fixer($client, null, ['api_key' => 'Get your key here: https://apilayer.com/marketplace/fixer-api']),
153+
new CurrencyData($client, null, ['api_key' => 'Get your key here: https://apilayer.com/marketplace/currency_data-api']),
154+
new ExchangeRatesData($client, null, ['api_key' => 'Get your key here: https://apilayer.com/marketplace/exchangerates_data-api']),
155+
new AbstractApi($client, null, ['api_key' => 'Get your key here: https://app.abstractapi.com/users/signup'])
156156
]);
157157
```
158158

159-
The rates will be first fetched using the `Fixer` service, will fallback to `CurrencyLayer`.
159+
The rates will be first fetched using the `Fixer` service, will fallback to `CurrencyData`.
160160

161161
> You can consult the list of the supported services and their options [here](#supported-services)
162162
@@ -415,15 +415,19 @@ use Exchanger\Service\CoinLayer;
415415
use Exchanger\Service\XchangeApi;
416416
use Exchanger\Service\AbstractApi;
417417
use Exchanger\Service\ExchangerateHost;
418-
use Exchanger\Service\FixerApiLayer;
418+
use Exchanger\Service\ApiLayer\CurrencyData;
419+
use Exchanger\Service\ApiLayer\ExchangeRatesData;
420+
use Exchanger\Service\ApiLayer\Fixer;
419421

420422
$service = new Chain([
421-
new Fixer($client, null, ['access_key' => 'YOUR_KEY']),
422-
new FixerApiLayer($client, null, ['api_key' => 'YOUR_KEY']),
423+
new Fixer($client, null, ['api_key' => 'Get your key here: https://apilayer.com/marketplace/fixer-api']),
424+
new CurrencyData($client, null, ['api_key' => 'Get your key here: https://apilayer.com/marketplace/currency_data-api']),
425+
new ExchangeRatesData($client, null, ['api_key' => 'Get your key here: https://apilayer.com/marketplace/exchangerates_data-api']),
426+
new AbstractApi($client, null, ['api_key' => 'Get your key here: https://app.abstractapi.com/users/signup']),
427+
new CoinLayer($client, null, ['access_key' => 'access_key', 'paid' => false]),
428+
new Exchanger\Service\Fixer($client, null, ['access_key' => 'YOUR_KEY']),
423429
new CurrencyLayer($client, null, ['access_key' => 'access_key', 'enterprise' => false]),
424430
new ExchangeRatesApi($client, null, ['access_key' => 'access_key', 'enterprise' => false]),
425-
new AbstractApi($client, null, ['api_key' => 'api_key']),
426-
new CoinLayer($client, null, ['access_key' => 'access_key', 'paid' => false]),
427431
new EuropeanCentralBank(),
428432
new NationalBankOfRomania(),
429433
new CentralBankOfRepublicTurkey(),

0 commit comments

Comments
 (0)