예제 #1
0
 /**
  * {@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();
 }
예제 #2
0
 /**
  * Generate form fields needed for icepay ideal, such as iDeal issuers selection
  * @param OrderInterface $order
  * @return array
  */
 protected function icepayIdealForm(OrderInterface $order)
 {
     $icepay_static = new IcepayStatics();
     $config = \Drupal::config('uc_icepay.settings');
     $form['icepay_note'] = array('#markup' => t('After order submission, you will be redirected to the ICEPAY page to complete the payment.'));
     $ideal_issuers = [];
     foreach ($icepay_static->getIdealIssuersOption() as $code => $issuer) {
         if ($config->get('ideal_issuer.' . $code)) {
             $ideal_issuers[$code] = $issuer;
         }
     }
     $form['ideal_issuer'] = array('#type' => 'select', '#title' => t('iDeal issuer'), '#options' => $ideal_issuers, '#default_value' => $order->payment_details['ideal_issuer']);
     return $form;
 }
예제 #3
0
 /**
  * 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>'];
 }