Skip to content

Commit abe5108

Browse files
committed
Remove country ISO2 workaround (API now provides ISO2 code)
1 parent 3cc95e6 commit abe5108

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

Helper/ApiClientHelper.php

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,6 @@ public function getAddressDetails(string $context): array
125125
$response = $client->internationalGetDetails($context, $sessionId);
126126
$response = $this->_prepareResponse($response, $client);
127127

128-
// Workaround for missing ISO2 code.
129-
$response['country']['iso2Code'] = $this->getCountryIso2Code($response['country']['iso3Code']);
130-
131128
return $response;
132129

133130
} catch (\Exception $e) {
@@ -320,29 +317,6 @@ public function getCountryIso3Code(string $iso2Code): ?string
320317
return $this->_countryCodeMap[$mapKey][strtoupper($iso2Code)] ?? null;
321318
}
322319

323-
/**
324-
* Get country ISO2 code from ISO3 code, or NULL if not found.
325-
*
326-
* @access public
327-
* @param string $iso2Code
328-
* @return string|null Lowercase ISO3 country code or NULL.
329-
*/
330-
public function getCountryIso2Code(string $iso3Code): ?string
331-
{
332-
$mapKey = 'iso3_to_iso2';
333-
334-
if (!isset($this->_countryCodeMap[$mapKey])) {
335-
$countries = $this->_storeConfigHelper->getSupportedCountries();
336-
$this->_countryCodeMap[$mapKey] = [];
337-
338-
foreach ($countries as $country) {
339-
$this->_countryCodeMap[$mapKey][$country->iso3] = $country->iso2;
340-
}
341-
}
342-
343-
return $this->_countryCodeMap[$mapKey][strtoupper($iso3Code)] ?? null;
344-
}
345-
346320
public function getAccountInfo(): array
347321
{
348322
try {

0 commit comments

Comments
 (0)