You are here

public function PayPalBasic::processBuildConfigurationForm in PayPal for Payment 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/Payment/MethodConfiguration/PayPalBasic.php \Drupal\paypal_payment\Plugin\Payment\MethodConfiguration\PayPalBasic::processBuildConfigurationForm()

Implements a form API #process callback.

Overrides Basic::processBuildConfigurationForm

2 calls to PayPalBasic::processBuildConfigurationForm()
PayPalExpress::processBuildConfigurationForm in src/Plugin/Payment/MethodConfiguration/PayPalExpress.php
Implements a form API #process callback.
PayPalStandard::processBuildConfigurationForm in src/Plugin/Payment/MethodConfiguration/PayPalStandard.php
Implements a form API #process callback.
2 methods override PayPalBasic::processBuildConfigurationForm()
PayPalExpress::processBuildConfigurationForm in src/Plugin/Payment/MethodConfiguration/PayPalExpress.php
Implements a form API #process callback.
PayPalStandard::processBuildConfigurationForm in src/Plugin/Payment/MethodConfiguration/PayPalStandard.php
Implements a form API #process callback.

File

src/Plugin/Payment/MethodConfiguration/PayPalBasic.php, line 47

Class

PayPalBasic
Abstract class for PayPal payment method configurations.

Namespace

Drupal\paypal_payment\Plugin\Payment\MethodConfiguration

Code

public function processBuildConfigurationForm(array &$element, FormStateInterface $form_state, array &$form) {
  parent::processBuildConfigurationForm($element, $form_state, $form);
  $element['paypal'] = [
    '#type' => 'container',
  ];
  $element['paypal']['production'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Production Server'),
    '#default_value' => $this
      ->isProduction(),
  ];
  $element['paypal']['logging'] = [
    '#type' => 'fieldset',
    '#title' => $this
      ->t('Logging'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  ];
  $element['paypal']['logging']['loglevel'] = [
    '#type' => 'select',
    '#title' => $this
      ->t('Log Level'),
    '#options' => [
      'DEBUG' => $this
        ->t('Debugging'),
    ],
    '#default_value' => $this
      ->getLogLevel(),
  ];
  $element['paypal']['logging'][PayPalBasicMethod::PAYPAL_CONTEXT_TYPE_ADMIN] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Logging admin tasks'),
    '#default_value' => $this
      ->isLogging(PayPalBasicMethod::PAYPAL_CONTEXT_TYPE_ADMIN),
  ];
  $element['paypal']['logging'][PayPalBasicMethod::PAYPAL_CONTEXT_TYPE_CREATE] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Logging when creating payment'),
    '#default_value' => $this
      ->isLogging(PayPalBasicMethod::PAYPAL_CONTEXT_TYPE_CREATE),
  ];
  $element['paypal']['logging'][PayPalBasicMethod::PAYPAL_CONTEXT_TYPE_WEBHOOK] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Logging the webhooks'),
    '#default_value' => $this
      ->isLogging(PayPalBasicMethod::PAYPAL_CONTEXT_TYPE_WEBHOOK),
  ];
  $element['paypal']['logging'][PayPalBasicMethod::PAYPAL_CONTEXT_TYPE_REDIRECT] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Logging the redirects back from PayPal'),
    '#default_value' => $this
      ->isLogging(PayPalBasicMethod::PAYPAL_CONTEXT_TYPE_REDIRECT),
  ];
  return $element;
}