You are here

public function CreditSettingsForm::buildForm in Ubercart 8.4

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides ConfigFormBase::buildForm

File

payment/uc_credit/src/Form/CreditSettingsForm.php, line 24

Class

CreditSettingsForm
Credit card settings form.

Namespace

Drupal\uc_credit\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form = parent::buildForm($form, $form_state);
  $config = $this
    ->config('uc_credit.settings');
  $form['cc_security']['uc_credit_encryption_path'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Encryption key directory'),
    '#description' => $this
      ->t('The card type, expiration date and last four digits of the card number are encrypted and stored temporarily while the customer is in the process of checking out.<br /><b>You must enable encryption</b> by following the <a href=":url">encryption instructions</a> in order to accept credit card payments.<br />In short, you must enter the path of a directory outside of your document root where the encryption key may be stored.<br />Relative paths will be resolved relative to the Drupal installation directory.<br />Once this directory is set, you should not change it.', [
      ':url' => Url::fromUri('https://www.drupal.org/node/1309226')
        ->toString(),
    ]),
    '#default_value' => uc_credit_encryption_key() ? $config
      ->get('encryption_path') : $this
      ->t('Not configured.'),
  ];
  return $form;
}