Skip to content

Commit 9025307

Browse files
authored
Update CurrencyConverterApi.php
1 parent 405fbcb commit 9025307

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

app/code/Magento/Directory/Model/Currency/Import/CurrencyConverterApi.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,7 @@ class CurrencyConverterApi extends AbstractImport
1717
/**
1818
* @var string
1919
*/
20-
const CURRENCY_CONVERTER_URL = 'http://free.currencyconverterapi.com/api/v3/convert?q={{CURRENCY_FROM}}_{{CURRENCY_TO}}&compact=ultra'; //@codingStandardsIgnoreLine
21-
22-
/**
23-
* @var string
24-
*/
25-
const API_KEY = 'apiKey';
20+
const CURRENCY_CONVERTER_URL = 'http://free.currencyconverterapi.com/api/v3/convert?q={{CURRENCY_FROM}}_{{CURRENCY_TO}}&compact=ultra&apiKey={{API_KEY}}'; //@codingStandardsIgnoreLine
2621

2722
/**
2823
* Http Client Factory
@@ -98,7 +93,7 @@ private function convertBatch($data, $currencyFrom, $currenciesTo)
9893
try {
9994
$url = str_replace('{{CURRENCY_FROM}}', $currencyFrom, self::CURRENCY_CONVERTER_URL);
10095
$url = str_replace('{{CURRENCY_TO}}', $to, $url);
101-
$url = $url . '&' . self::API_KEY . '=' . $apiKey;
96+
$url = str_replace('{{API_KEY}}', $apiKey, $url);
10297
$response = $this->getServiceResponse($url);
10398
if ($currencyFrom == $to) {
10499
$data[$currencyFrom][$to] = $this->_numberFormat(1);

0 commit comments

Comments
 (0)