/** * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { // Need to use configFactory() and getEditable() here, because this form is // wrapped by PaymentMethodSettingsForm so $this->getEditableConfigNames() // never gets called $ice_config = \Drupal::configFactory()->getEditable('uc_icepay.settings'); $ice_config->set('merchant_id', $form_state->getValue('uc_icepay_merchant_id'))->set('secret_code', $form_state->getValue('uc_icepay_secret_code'))->set('currency', $form_state->getValue('uc_icepay_currency'))->set('country', $form_state->getValue('uc_icepay_country'))->set('language', $form_state->getValue('uc_icepay_language'))->set('mailing', $form_state->getValue('uc_icepay_mailing'))->set('stream_method', $form_state->getValue('uc_icepay_stream_method'))->set('ipcheck', $form_state->getValue('uc_icepay_ipcheck'))->set('https_protocol', $form_state->getValue('uc_icepay_https_protocol'))->set('url.ok', $form_state->getValue('uc_icepay_url_ok'))->set('url.err', $form_state->getValue('uc_icepay_url_err'))->set('url.notify', $form_state->getValue('uc_icepay_url_notify')); $static = new IcepayStatics(); foreach ($static->getIdealIssuersOption() as $code => $issuer) { $ice_config->set('ideal_issuer.' . $code, $form_state->getValue('uc_icepay_ideal_issuer_' . $code)); } $ice_config->save(); }
/** * {@inheritdoc} */ public function customerView(OrderInterface $order) { $build = array(); if (!empty($order->payment_details['ideal_issuer'])) { $icepay_static = new IcepayStatics(); $build['#markup'] = t('iDeal issuer') . ':<br />' . $icepay_static->getSingleIdealIssuer($order->payment_details['ideal_issuer']); } return $build; }
/** * Banks. * * @return string * Return Hello string. */ public function banks() { $static = new IcepayStatics(); $issuers = $static->getIdealIssuersOption(); return ['#type' => 'markup', '#markup' => $this->t('Available iDeal issuers on ICEPAY provider') . ': <ul><li>' . implode('</li><li>', $issuers) . '</li></ul>']; }