/** * Updates the Config and writes changes into db * @param configurationModel $model */ public function updateConfiguration(configurationModel $model) { Configuration::updateValue('PIGMBH_PAYMILL_DEBIT', $model->getDirectdebit()); Configuration::updateValue('PIGMBH_PAYMILL_CREDITCARD', $model->getCreditcard()); Configuration::updateValue('PIGMBH_PAYMILL_PUBLICKEY', $model->getPublicKey()); Configuration::updateValue('PIGMBH_PAYMILL_PRIVATEKEY', $model->getPrivateKey()); Configuration::updateValue('PIGMBH_PAYMILL_DEBUG', $model->getDebug()); Configuration::updateValue('PIGMBH_PAYMILL_LOGGING', $model->getLogging()); Configuration::updateValue('PIGMBH_PAYMILL_FASTCHECKOUT', $model->getFastcheckout()); Configuration::updateValue('PIGMBH_PAYMILL_DEBIT_DAYS', $model->getDebitDays()); Configuration::updateValue('PIGMBH_PAYMILL_ACCEPTED_BRANDS', json_encode($model->getAccpetedCreditCards())); }
/** * @param configurationModel $configurationModel * @return string */ private function _getAccepetdBrandOptions(configurationModel $configurationModel) { $html = ''; foreach ($configurationModel->getAccpetedCreditCards() as $brand => $selected) { $selectedHtml = $selected ? 'selected' : ''; $html .= '<option value="' . $brand . '" ' . $selectedHtml . '>' . $brand . '</option>'; } return $html; }