Skip to content

Commit

Permalink
[SL-270] initialize
Browse files Browse the repository at this point in the history
  • Loading branch information
MarijusCoding committed Nov 21, 2024
1 parent da24530 commit bc6dd43
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions controllers/admin/AdminSaferPayOfficialPaymentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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,
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit bc6dd43

Please sign in to comment.