diff --git a/controllers/admin/AdminSaferPayOfficialPaymentController.php b/controllers/admin/AdminSaferPayOfficialPaymentController.php index 8b9ac801..ca4f9be1 100755 --- a/controllers/admin/AdminSaferPayOfficialPaymentController.php +++ b/controllers/admin/AdminSaferPayOfficialPaymentController.php @@ -164,6 +164,11 @@ protected function renderShoppingPointOptions() $fieldsForm = []; $fieldsForm[0]['form'] = $this->fields_form; + /** @var \Invertus\SaferPay\Service\SaferPayObtainPaymentMethods $saferPayObtainPaymentMethods */ + $saferPayObtainPaymentMethods = $this->module->getService(SaferPayObtainPaymentMethods::class); + + $paymentMethodsList = $saferPayObtainPaymentMethods->obtainPaymentMethods(); + foreach ($paymentMethods as $paymentMethod) { $isActive = $paymentRepository->isActiveByName($paymentMethod); $isLogoActive = $logoRepository->isActiveByName($paymentMethod); @@ -184,7 +189,7 @@ protected function renderShoppingPointOptions() 'paymentMethod' => $paymentMethod, 'countryOptions' => $this->getActiveCountriesList(), 'countrySelect' => $selectedCountries, - 'currencyOptions' => $this->getActiveCurrenciesList($paymentMethod), + 'currencyOptions' => $this->getActiveCurrenciesList($paymentMethod, $paymentMethodsList), 'currencySelect' => $selectedCurrencies, 'is_field_active' => $isFieldActive, 'supported_field_payments' => SaferPayConfig::FIELD_SUPPORTED_PAYMENT_METHODS, @@ -219,13 +224,8 @@ public function getActiveCountriesList($onlyActive = true) return $countriesWithNames; } - public function getActiveCurrenciesList($paymentMethod) + public function getActiveCurrenciesList($paymentMethod, $paymentMethods) { - /** @var \Invertus\SaferPay\Service\SaferPayObtainPaymentMethods $saferPayObtainPaymentMethods */ - $saferPayObtainPaymentMethods = $this->module->getService(SaferPayObtainPaymentMethods::class); - - $paymentMethods = $saferPayObtainPaymentMethods->obtainPaymentMethods(); - $currencyOptions[0] = $this->l('All'); foreach ($paymentMethods[$paymentMethod]['currencies'] as $currencyIso) { if (Currency::getIdByIsoCode($currencyIso)) {