Definition at line 10 of file CurrencyConverterApi.php.
◆ __construct()
Initialize dependencies
- Parameters
-
\Magento\Directory\Model\CurrencyFactory | $currencyFactory | |
\Magento\Framework\App\Config\ScopeConfigInterface | $scopeConfig | |
\Magento\Framework\HTTP\ZendClientFactory | $httpClientFactory | |
Definition at line 38 of file CurrencyConverterApi.php.
43 parent::__construct($currencyFactory);
44 $this->scopeConfig = $scopeConfig;
45 $this->httpClientFactory = $httpClientFactory;
◆ _convert()
_convert |
( |
|
$currencyFrom, |
|
|
|
$currencyTo |
|
) |
| |
|
protected |
◆ fetchRates()
{Fetch rates
- Returns
- array
}
Implements ImportInterface.
Definition at line 51 of file CurrencyConverterApi.php.
57 foreach ($defaultCurrencies as $currencyFrom) {
58 if (!isset(
$data[$currencyFrom])) {
59 $data[$currencyFrom] = [];
61 $data = $this->convertBatch(
$data, $currencyFrom, $currencies);
62 ksort(
$data[$currencyFrom]);
_getDefaultCurrencyCodes()
◆ CURRENCY_CONVERTER_URL
const CURRENCY_CONVERTER_URL = 'http://free.currencyconverterapi.com/api/v3/convert?q={{CURRENCY_FROM}}_{{CURRENCY_TO}}&compact=ultra' |
The documentation for this class was generated from the following file: