Fixerio
Fixerio copied to clipboard
Wrong parameters for Fadion\Fixerio\Exceptions\ResponseException([string $message [, long $code [, Throwable $previous = NULL]]])
I did upgrade to version to 2 also created a key but now I am facing this problem.
How to solve?
this is happening on first example from your manual.
This was fixed with #12.
You may need to update your dependency version of this package to dev-master
until a release is made.
updated. Now the problem is :
Type: Fadion\Fixerio\Exceptions\ResponseException
Code: 105
File: /project/vendor/fadion/fixerio/src/Exchange.php
Line: 276
According to their API docs a 105
is Your current subscription doesn’t support this endpoint
. The response exception is supposed to be thrown in this case.
Is the corresponding error message not there?
Yeah I think so. I was doing USD to GBP and EUR. So no more free service here. That's a problem for us, we would have to develop own lib for that.
It's simple enough to convert to another base. You could do so using this well designed PHP money library or simply re-base the rates yourself using something like so:
$rates = [
'USD' => .9,
'EUR' => 1,
// ...
];
$base = $rates['USD'];
$rebasedConversionRates = array_map(function (string $rate) use ($base) {
return bcdiv($rate, (string) $base, 16);
}, $rates);
I'm currently working on an integration library for fixers API and the money lib but that's a few weeks out still.
Edit: fixed the snippet