Skip to content

Commit 40e4ae6

Browse files
author
Stanislav Idolov
committed
ENGCOM-2719: Add Currency Converter API connecting feature #15542
1 parent 949773b commit 40e4ae6

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
28
namespace Magento\Directory\Model\Currency\Import;
39

410
class CurrencyConverterApi extends AbstractImport
511
{
612
/**
713
* @var string
814
*/
9-
const CURRENCY_CONVERTER_URL = 'http://free.currencyconverterapi.com/api/v3/convert?q={{CURRENCY_FROM}}_{{CURRENCY_TO}}&compact=ultra';
15+
const CURRENCY_CONVERTER_URL = 'http://free.currencyconverterapi.com/api/v3/convert?q={{CURRENCY_FROM}}_{{CURRENCY_TO}}&compact=ultra'; //@codingStandardsIgnoreLine
1016

1117
/**
1218
* Http Client Factory
1319
*
1420
* @var \Magento\Framework\HTTP\ZendClientFactory
1521
*/
16-
protected $httpClientFactory;
22+
private $httpClientFactory;
1723

1824
/**
1925
* Core scope config
@@ -68,7 +74,7 @@ public function fetchRates()
6874
*/
6975
private function convertBatch($data, $currencyFrom, $currenciesTo)
7076
{
71-
foreach($currenciesTo as $to) {
77+
foreach ($currenciesTo as $to) {
7278
set_time_limit(0);
7379
try {
7480
$url = str_replace('{{CURRENCY_FROM}}', $currencyFrom, self::CURRENCY_CONVERTER_URL);

0 commit comments

Comments
 (0)