Skip to content

Commit 649c5f1

Browse files
authored
Merge pull request #17 from florianv/sponsors
Updated the documentation and added our sponsors
2 parents 6701729 + 42c94b0 commit 649c5f1

File tree

3 files changed

+115
-35
lines changed

3 files changed

+115
-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: 58 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
# Installation
1+
# Documentation
2+
3+
## Index
4+
5+
* [Installation](#installation)
6+
* [Configuration](#configuration)
7+
* [Services](#services)
8+
* [Cache](#cache)
9+
* [Lifetime](#lifetime)
10+
* [Cache type](#cache-type)
11+
* [Usage](#usage)
12+
* [Sponsors](#sponsors)
13+
14+
## Installation
215

316
```bash
417
composer require florianv/swap-bundle php-http/message php-http/guzzle6-adapter
@@ -19,17 +32,26 @@ public function registerBundles()
1932
}
2033
```
2134

22-
# Configuration
35+
## Configuration
36+
37+
### Services
2338

24-
## Builtin providers
39+
We recommend to use one of the [services that support our project](#sponsors), providing a free plan up to 1,000 requests per day.
40+
41+
The complete list of all supported services is available here:
2542

2643
```yaml
2744
# app/config/config.yml
2845
florianv_swap:
2946
providers:
30-
google: ~ # Google Finance
3147
fixer:
3248
access_key: secret # Fixer
49+
currency_layer: # currencylayer
50+
access_key: secret
51+
enterprise: true
52+
forge: # Forge
53+
api_key: secret
54+
google: ~ # Google Finance
3355
webservicex: ~ # WebserviceX
3456
cryptonator: ~ # Cryptonator
3557
russian_central_bank: ~ # Russian Central Bank
@@ -40,13 +62,8 @@ florianv_swap:
4062
open_exchange_rates: # Open Exchange Rates
4163
app_id: secret
4264
enterprise: true
43-
currency_layer: # currencylayer
44-
access_key: secret
45-
enterprise: true
4665
xignite: # Xignite
4766
token: secret
48-
forge: # Forge
49-
api_key: secret
5067
array:
5168
rates:
5269
-
@@ -59,24 +76,30 @@ florianv_swap:
5976
```
6077
6178
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:
79+
In this example, Swap uses the [Fixer](http://fixer.io) service, and will fallback to [currencylayer](https://currencylayer.com)
80+
and then [1Forge](https://1forge.com), in case of failure.
6381
6482
```yaml
6583
# app/config/config.yml
6684
florianv_swap:
6785
providers:
68-
google: ~
69-
#priority: 0 (default)
7086
fixer:
7187
access_key: secret
88+
#priority: 0 (default)
89+
currency_layer:
90+
access_key: secret
91+
enterprise: true
7292
priority: 1
93+
forge:
94+
api_key: secret
95+
#priority: 2 (default)
7396
```
7497

75-
## Cache
98+
### Cache
7699

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

79-
### Lifetime
102+
#### Lifetime
80103

81104
You must specify a lifetime for your cache entries:
82105

@@ -87,7 +110,7 @@ florianv_swap:
87110
ttl: 3600 # seconds
88111
```
89112
90-
### Cache type
113+
#### Cache type
91114
92115
You can use a service id:
93116
@@ -107,7 +130,7 @@ florianv_swap:
107130
type: apcu
108131
```
109132

110-
# Usage
133+
## Usage
111134

112135
The Swap service is available in the container:
113136

@@ -117,3 +140,22 @@ $swap = $this->get('florianv_swap.swap');
117140
```
118141

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