From 409c80ff701aed32ae78eb45d075a302286e33d9 Mon Sep 17 00:00:00 2001 From: Artur Smolarek Date: Sun, 16 Aug 2020 11:59:52 +0200 Subject: [PATCH] xChangeApi.com support --- README.md | 1 + doc/readme.md | 1 + tests/Service/FactoryTest.php | 2 ++ 3 files changed, 4 insertions(+) diff --git a/README.md b/README.md index 1a291be..cc55147 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,7 @@ Here is the list of the currently implemented services: | [Open Exchange Rates](https://openexchangerates.org) | USD (free), * (paid) | * | Yes | | [Xignite](https://www.xignite.com) | * | * | Yes | | [Currency Converter API](https://www.currencyconverterapi.com) | * | * | Yes (free but limited or paid) | +| [xChangeApi.com](https://xchangeapi.com) | * | * | Yes | | Array | * | * | Yes | Additionally, you can add your own services as long as they implement the `ExchangeRateService` interface. diff --git a/doc/readme.md b/doc/readme.md index 5de03da..1d2fb41 100644 --- a/doc/readme.md +++ b/doc/readme.md @@ -342,6 +342,7 @@ $swap = (new Builder()) ->add('currency_converter', ['access_key' => 'secret', 'enterprise' => false]) ->add('open_exchange_rates', ['app_id' => 'secret', 'enterprise' => false]) ->add('xignite', ['token' => 'token']) + ->add('xchangeapi', ['api-key' => 'secret']) ->add('array', [ [ 'EUR/USD' => 1.1, diff --git a/tests/Service/FactoryTest.php b/tests/Service/FactoryTest.php index 4d4811a..4756df9 100644 --- a/tests/Service/FactoryTest.php +++ b/tests/Service/FactoryTest.php @@ -27,6 +27,7 @@ use Exchanger\Service\WebserviceX; use Exchanger\Service\Xignite; use Exchanger\Service\RussianCentralBank; +use Exchanger\Service\XchangeApi; use Http\Mock\Client; use PHPUnit\Framework\TestCase; use Swap\Service\Factory; @@ -61,6 +62,7 @@ public function servicesProvider() ['xignite', Xignite::class, ['token' => 'token']], ['russian_central_bank', RussianCentralBank::class], ['cryptonator', Cryptonator::class], + ['xchangeapi', XchangeApi::class, ['api-key' => 'api-key']] ]; }