Skip to content

Commit df88656

Browse files
committed
ACP2E-1044: Fixer.IO API doesn't work
- change config paths
1 parent 95d68a9 commit df88656

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function fetchRates()
8282
*/
8383
private function convertBatch(array $data, string $currencyFrom, array $currenciesTo): array
8484
{
85-
$accessKey = $this->scopeConfig->getValue('currency/apilayer/api_key', ScopeInterface::SCOPE_STORE);
85+
$accessKey = $this->scopeConfig->getValue('currency/fixerio_apilayer/api_key', ScopeInterface::SCOPE_STORE);
8686
if (empty($accessKey)) {
8787
$this->_messages[] = __('No API Key was specified or an invalid API Key was specified.');
8888
$data[$currencyFrom] = $this->makeEmptyResponse($currenciesTo);
@@ -152,7 +152,7 @@ private function getServiceResponse(string $url, int $retry = 0): array
152152
$httpClient->setOptions(
153153
[
154154
'timeout' => $this->scopeConfig->getValue(
155-
'currency/apilayer/timeout',
155+
'currency/fixerio_apilayer/timeout',
156156
ScopeInterface::SCOPE_STORE
157157
),
158158
]

app/code/Magento/Directory/Test/Unit/Model/Currency/Import/FixerIoApiLayerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ public function testFetchRates(): void
7676

7777
$this->scopeConfig->method('getValue')
7878
->withConsecutive(
79-
['currency/apilayer/api_key', 'store'],
80-
['currency/apilayer/timeout', 'store']
79+
['currency/fixerio_apilayer/api_key', 'store'],
80+
['currency/fixerio_apilayer/timeout', 'store']
8181
)
8282
->willReturnOnConsecutiveCalls('api_key', 100);
8383

app/code/Magento/Directory/etc/adminhtml/system.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@
4747
<validate>validate-zero-or-greater validate-number</validate>
4848
</field>
4949
</group>
50-
<group id="apilayer" translate="label" sortOrder="35" showInDefault="1">
51-
<label>Fixer Api via APILayer</label>
50+
<group id="fixerio_apilayer" translate="label" sortOrder="35" showInDefault="1">
51+
<label>Fixer Api (APILayer)</label>
5252
<field id="api_key" translate="label" type="obscure" sortOrder="5" showInDefault="1">
5353
<label>API Key</label>
54-
<config_path>currency/apilayer/api_key</config_path>
54+
<config_path>currency/fixerio_apilayer/api_key</config_path>
5555
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
5656
</field>
5757
<field id="timeout" translate="label" type="text" sortOrder="10" showInDefault="1">

app/code/Magento/Directory/etc/config.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
<timeout>100</timeout>
2323
<api_key backend_model="Magento\Config\Model\Config\Backend\Encrypted" />
2424
</fixerio>
25-
<apilayer>
25+
<fixerio_apilayer>
2626
<timeout>100</timeout>
2727
<api_key backend_model="Magento\Config\Model\Config\Backend\Encrypted" />
28-
</apilayer>
28+
</fixerio_apilayer>
2929
<currencyconverterapi>
3030
<timeout>100</timeout>
3131
<api_key backend_model="Magento\Config\Model\Config\Backend\Encrypted" />

app/code/Magento/Directory/etc/di.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
<item name="label" xsi:type="string" translatable="true">Fixer.io (legacy)</item>
1515
<item name="class" xsi:type="string">Magento\Directory\Model\Currency\Import\FixerIo</item>
1616
</item>
17-
<item name="apilayer" xsi:type="array">
18-
<item name="label" xsi:type="string" translatable="true">Fixer Api via APILayer</item>
17+
<item name="fixerio_apilayer" xsi:type="array">
18+
<item name="label" xsi:type="string" translatable="true">Fixer Api (APILayer)</item>
1919
<item name="class" xsi:type="string">Magento\Directory\Model\Currency\Import\FixerIoApiLayer</item>
2020
</item>
2121
<item name="currencyconverterapi" xsi:type="array">

0 commit comments

Comments
 (0)