From 605a71841897340972966a5df9bd00000de16e86 Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 13 Apr 2017 21:19:00 +0200 Subject: [PATCH] Turns out open exchange rates is useless. --- .env.example | 2 ++ app/Http/Controllers/Json/ExchangeController.php | 4 +++- config/firefly.php | 1 - 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index eaa69b5d82..9a28c9f373 100755 --- a/.env.example +++ b/.env.example @@ -41,6 +41,8 @@ SHOW_INCOMPLETE_TRANSLATIONS=false CACHE_PREFIX=firefly +EXCHANGE_RATE_SERVICE=fixerio + GOOGLE_MAPS_API_KEY= ANALYTICS_ID= SITE_OWNER=mail@example.com diff --git a/app/Http/Controllers/Json/ExchangeController.php b/app/Http/Controllers/Json/ExchangeController.php index b37f5e392c..082b476ee4 100644 --- a/app/Http/Controllers/Json/ExchangeController.php +++ b/app/Http/Controllers/Json/ExchangeController.php @@ -32,6 +32,8 @@ class ExchangeController extends Controller * @param TransactionCurrency $fromCurrency * @param TransactionCurrency $toCurrency * @param Carbon $date + * + * @return \Illuminate\Http\JsonResponse */ public function getRate(Request $request, TransactionCurrency $fromCurrency, TransactionCurrency $toCurrency, Carbon $date) { @@ -51,7 +53,7 @@ class ExchangeController extends Controller $return['amount'] = null; if (!is_null($request->get('amount'))) { // assume amount is in "from" currency: - $return['amount'] = bcmul($request->get('amount'), $rate->rate); + $return['amount'] = bcmul($request->get('amount'), strval($rate->rate)); } return Response::json($return); diff --git a/config/firefly.php b/config/firefly.php index 879c45e0ee..9e02292848 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -211,7 +211,6 @@ return [ // tag notes has_attachments 'currency_exchange_services' => [ 'fixerio' => 'FireflyIII\Services\Currency\FixerIO', - 'openexchangerates' => 'FireflyIII\Services\Currency\OpenExchangeRates', ], 'preferred_exchange_service' => 'fixerio',