Skip to content

Commit

Permalink
fix: readme
Browse files Browse the repository at this point in the history
  • Loading branch information
florianv committed May 15, 2021
1 parent 187302d commit 4c64fea
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
[![Version](http://img.shields.io/packagist/v/florianv/exchanger.svg?style=flat-square)](https://packagist.org/packages/florianv/exchanger)

Exchanger is a PHP framework to work with currency exchange rates from various services such as
**[Fixer](https://fixer.io)**, **[currencylayer](https://currencylayer.com)** or **[exchangeratesapi](https://exchangeratesapi.io)**.
**[Fixer](https://fixer.io)**, **[currencylayer](https://currencylayer.com)**,
**[exchangeratesapi](https://exchangeratesapi.io)** or **[Abstract](https://www.abstractapi.com)**.
Looking for a simple library based on Exchanger ? Check out [Swap](https://github.com/florianv/swap) !

## Sponsors
Expand All @@ -23,7 +24,11 @@ Looking for a simple library based on Exchanger ? Check out [Swap](https://githu
<tr>
<td><img src="https://exchangeratesapi.io/assets/images/api-logo.svg" width="50px"/></td>
<td><a href="https://exchangeratesapi.io">exchangeratesapi</a> provides reliable exchange rates and currency conversions for your business with over 15 data sources.</td>
</tr>
</tr>
<tr>
<td><img src="https://global-uploads.webflow.com/5ebbd0a566a3996636e55959/5ec2ba27ede983917dbff22f_favicon.png" width="50px"/></td>
<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>
</tr>
</table>

## Documentation
Expand Down
10 changes: 10 additions & 0 deletions doc/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
<td><img src="https://exchangeratesapi.io/assets/images/api-logo.svg" width="50px"/></td>
<td><a href="https://exchangeratesapi.io">exchangeratesapi</a> provides reliable exchange rates and currency conversions for your business with over 15 data sources.</td>
</tr>
<tr>
<td><img src="https://global-uploads.webflow.com/5ebbd0a566a3996636e55959/5ec2ba27ede983917dbff22f_favicon.png" width="50px"/></td>
<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>
</tr>
</table>

## Index
Expand Down Expand Up @@ -61,6 +65,7 @@ use Http\Client\Curl\Client as CurlClient;
use Exchanger\Service\Fixer;
use Exchanger\Service\CurrencyLayer;
use Exchanger\Service\ExchangeRatesApi;
use Exchanger\Service\AbstractApi;
use Exchanger\Exchanger;

// Create your http client (we choose curl here)
Expand All @@ -75,6 +80,9 @@ $service = new CurrencyLayer($client, null, ['access_key' => 'access_key', 'ente
// Or use the exchangeratesapi.io service
$service = new ExchangeRatesApi($client, null, ['access_key' => 'access_key']);

// Or use the abstractapi.com service
$service = new AbstractApi($client, null, ['api_key' => 'api_key']);

// Create Exchanger with your service
$exchanger = new Exchanger($service);
```
Expand Down Expand Up @@ -135,11 +143,13 @@ use Exchanger\Service\Chain;
use Exchanger\Service\Fixer;
use Exchanger\Service\CurrencyLayer;
use Exchanger\Service\ExchangeRatesApi;
use Exchanger\Service\AbstractApi;

$service = new Chain([
new Fixer($client, null, ['access_key' => 'YOUR_KEY']),
new CurrencyLayer($client, null, ['access_key' => 'access_key', 'enterprise' => false]),
new ExchangeRatesApi($client, null, ['access_key' => 'access_key']),
new AbstractApi($client, null, ['api_key' => 'api_key'])
]);
```

Expand Down

0 comments on commit 4c64fea

Please sign in to comment.