Skip to content

Commit 496442a

Browse files
committed
Updated readme
1 parent 6701729 commit 496442a

File tree

3 files changed

+114
-35
lines changed

3 files changed

+114
-35
lines changed

README.md

Lines changed: 56 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,68 @@
1-
# FlorianvSwapBundle
1+
# <img src="https://s3.amazonaws.com/swap.assets/swap_logo.png" height="30px" width="30px"/> Symfony Swap
22

3-
[![Build status][travis-image]][travis-url]
4-
[![Version][version-image]][version-url]
5-
[![Downloads][downloads-image]][downloads-url]
3+
[![Build status](http://img.shields.io/travis/florianv/symfony-swap.svg?style=flat-square)](https://travis-ci.org/florianv/symfony-swap)
4+
[![Total Downloads](https://img.shields.io/packagist/dt/florianv/swap-bundle.svg?style=flat-square)](https://packagist.org/packages/florianv/symfony-swap)
5+
[![Version](http://img.shields.io/packagist/v/florianv/swap-bundle.svg?style=flat-square)](https://packagist.org/packages/florianv/symfony-swap)
66

7-
> Integrates the [Swap](https://github.com/florianv/swap) library with Symfony
7+
Swap allows you to retrieve currency exchange rates from various services such as **[Fixer](https://fixer.io)**, **[currencylayer](https://currencylayer.com)** or **[1Forge](https://1forge.com)**
8+
and optionally cache the results.
9+
10+
## QuickStart
11+
12+
```bash
13+
$ composer require florianv/swap-bundle php-http/message php-http/guzzle6-adapter
14+
```
815

916
## Documentation
1017

11-
[Read the Documentation for master](https://github.com/florianv/FlorianvSwapBundle/blob/master/Resources/doc/index.md)
18+
The complete documentation can be found [here](https://github.com/florianv/symfony-swap/blob/master/Resources/doc/index.md).
1219

13-
All the installation instructions are located in the documentation.
20+
## Sponsors :heart_eyes:
1421

15-
## License
22+
We are proudly supported by the following echange rate providers offering *free plans up to 1,000 requests per day*:
1623

17-
This bundle is under the MIT license. See the complete license in the bundle:
24+
<img src="https://s3.amazonaws.com/swap.assets/fixer_icon.png?v=2" height="20px" width="20px"/> **[Fixer](https://fixer.io)**
1825

19-
```
20-
Resources/meta/LICENSE
21-
```
26+
Fixer is a simple and lightweight API for foreign exchange rates that supports up to 170 world currencies.
27+
They provide real-time rates and historical data, however, EUR is the only available base currency on the free plan.
28+
29+
<img src="https://s3.amazonaws.com/swap.assets/currencylayer_icon.png" height="20px" width="20px"/> **[currencylayer](https://currencylayer.com)**
30+
31+
Currencylayer provides reliable exchange rates and currency conversions for your business up to 168 world currencies.
32+
They provide real-time rates and historical data, however, USD is the only available base currency on the free plan.
2233

23-
[travis-url]: https://travis-ci.org/florianv/symfony-swap
24-
[travis-image]: http://img.shields.io/travis/florianv/symfony-swap.svg
34+
<img src="https://s3.amazonaws.com/swap.assets/1forge_icon.png" height="20px" width="20px"/> **[1Forge](https://1forge.com)**
2535

26-
[version-url]: https://packagist.org/packages/florianv/swap-bundle
27-
[version-image]: http://img.shields.io/packagist/v/florianv/swap-bundle.svg
36+
1Forge provides Forex and Cryptocurrency quotes for over 700 unique currency pairs.
37+
They provide the fastest price updates available of any provider, however, they don’t support smaller currencies or historical data.
38+
39+
## Services
40+
41+
Here is the list of the currently implemented services:
42+
43+
| Service | Base Currency | Quote Currency | Historical |
44+
|---------------------------------------------------------------------------|----------------------|----------------|----------------|
45+
| [Fixer](https://fixer.io) | EUR (free, no SSL), * (paid) | * | Yes |
46+
| [currencylayer](https://currencylayer.com) | USD (free), * (paid) | * | Yes |
47+
| [1Forge](https://1forge.com) | * (free but limited or paid) | * (free but limited or paid) | No |
48+
| [European Central Bank](https://www.ecb.europa.eu/home/html/index.en.html) | EUR | * | Yes |
49+
| [National Bank of Romania](http://www.bnr.ro) | RON | * | Yes |
50+
| [Central Bank of the Republic of Turkey](http://www.tcmb.gov.tr) | * | TRY | No |
51+
| [Central Bank of the Czech Republic](https://www.cnb.cz) | * | CZK | Yes |
52+
| [Central Bank of Russia](https://cbr.ru) | * | RUB | Yes |
53+
| [WebserviceX](http://www.webservicex.net) | * | * | No |
54+
| [Google](https://www.google.com/finance) | * | * | No |
55+
| [Cryptonator](https://www.cryptonator.com) | * Crypto (Limited standard currencies) | * Crypto (Limited standard currencies) | No |
56+
| [CurrencyDataFeed](https://currencydatafeed.com) | * (free but limited or paid) | * (free but limited or paid) | No |
57+
| [Open Exchange Rates](https://openexchangerates.org) | USD (free), * (paid) | * | Yes |
58+
| [Xignite](https://www.xignite.com) | * | * | Yes |
59+
| Array | * | * | Yes |
60+
61+
## Credits
62+
63+
- [Florian Voutzinos](https://github.com/florianv)
64+
- [All Contributors](https://github.com/florianv/symfony-swap/contributors)
65+
66+
## License
2867

29-
[downloads-url]: https://packagist.org/packages/florianv/swap-bundle
30-
[downloads-image]: https://img.shields.io/packagist/dt/florianv/swap-bundle.svg
68+
The MIT License (MIT). Please see [LICENSE](https://github.com/florianv/symfony-swap/blob/master/Resources/meta/LICENSE) for more information.

Resources/doc/index.md

Lines changed: 57 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
1-
# Installation
1+
# Documentation
2+
3+
## Index
4+
* [Installation](#installation)
5+
* [Configuration](#configuration)
6+
* [Services](#services)
7+
* [Cache](#cache)
8+
* [Lifetime](#lifetime)
9+
* [Cache type](#cache-type)
10+
* [Usage](#usage)
11+
* [Sponsors](#sponsors)
12+
13+
## Installation
214

315
```bash
416
composer require florianv/swap-bundle php-http/message php-http/guzzle6-adapter
@@ -19,17 +31,26 @@ public function registerBundles()
1931
}
2032
```
2133

22-
# Configuration
34+
## Configuration
35+
36+
### Services
37+
38+
We recommend to use one of the [services that support our project](#sponsors), providing a free plan up to 1,000 requests per day.
2339

24-
## Builtin providers
40+
The complete list of all supported services is available here:
2541

2642
```yaml
2743
# app/config/config.yml
2844
florianv_swap:
2945
providers:
30-
google: ~ # Google Finance
3146
fixer:
3247
access_key: secret # Fixer
48+
currency_layer: # currencylayer
49+
access_key: secret
50+
enterprise: true
51+
forge: # Forge
52+
api_key: secret
53+
google: ~ # Google Finance
3354
webservicex: ~ # WebserviceX
3455
cryptonator: ~ # Cryptonator
3556
russian_central_bank: ~ # Russian Central Bank
@@ -40,13 +61,8 @@ florianv_swap:
4061
open_exchange_rates: # Open Exchange Rates
4162
app_id: secret
4263
enterprise: true
43-
currency_layer: # currencylayer
44-
access_key: secret
45-
enterprise: true
4664
xignite: # Xignite
4765
token: secret
48-
forge: # Forge
49-
api_key: secret
5066
array:
5167
rates:
5268
-
@@ -59,24 +75,30 @@ florianv_swap:
5975
```
6076
6177
You can register multiple providers, they will be called in chain regarding to their priorities (higher first).
62-
In this example __Fixer__ is the first one and __Google Finance__ is the second one:
78+
In this example, Swap uses the [Fixer](http://fixer.io) service, and will fallback to [currencylayer](https://currencylayer.com)
79+
and then [1Forge](https://1forge.com), in case of failure.
6380
6481
```yaml
6582
# app/config/config.yml
6683
florianv_swap:
6784
providers:
68-
google: ~
69-
#priority: 0 (default)
7085
fixer:
7186
access_key: secret
87+
#priority: 0 (default)
88+
currency_layer:
89+
access_key: secret
90+
enterprise: true
7291
priority: 1
92+
forge:
93+
api_key: secret
94+
#priority: 2 (default)
7395
```
7496

75-
## Cache
97+
### Cache
7698

7799
Currently only some of the [Symfony Cache](https://symfony.com/doc/current/components/cache.html#available-simple-cache-psr-16-classes) adapters are supported.
78100

79-
### Lifetime
101+
#### Lifetime
80102

81103
You must specify a lifetime for your cache entries:
82104

@@ -87,7 +109,7 @@ florianv_swap:
87109
ttl: 3600 # seconds
88110
```
89111
90-
### Cache type
112+
#### Cache type
91113
92114
You can use a service id:
93115
@@ -107,7 +129,7 @@ florianv_swap:
107129
type: apcu
108130
```
109131

110-
# Usage
132+
## Usage
111133

112134
The Swap service is available in the container:
113135

@@ -117,3 +139,22 @@ $swap = $this->get('florianv_swap.swap');
117139
```
118140

119141
For more information about how to use it, please consult the [Swap documentation](https://github.com/florianv/swap).
142+
143+
## Sponsors
144+
145+
We are proudly supported by the following echange rate providers offering *free plans up to 1,000 requests per day*:
146+
147+
<img src="https://s3.amazonaws.com/swap.assets/fixer_icon.png?v=2" height="20px" width="20px"/> **[Fixer](https://fixer.io)**
148+
149+
Fixer is a simple and lightweight API for foreign exchange rates that supports up to 170 world currencies.
150+
They provide real-time rates and historical data, however, EUR is the only available base currency on the free plan.
151+
152+
<img src="https://s3.amazonaws.com/swap.assets/currencylayer_icon.png" height="20px" width="20px"/> **[currencylayer](https://currencylayer.com)**
153+
154+
Currencylayer provides reliable exchange rates and currency conversions for your business up to 168 world currencies.
155+
They provide real-time rates and historical data, however, USD is the only available base currency on the free plan.
156+
157+
<img src="https://s3.amazonaws.com/swap.assets/1forge_icon.png" height="20px" width="20px"/> **[1Forge](https://1forge.com)**
158+
159+
1Forge provides Forex and Cryptocurrency quotes for over 700 unique currency pairs.
160+
They provide the fastest price updates available of any provider, however, they don’t support smaller currencies or historical data.

Resources/meta/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2014 - 2016 Florian Voutzinos
3+
Copyright (c) 2014 - 2018 Florian Voutzinos
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)