You are here

class PayPalStandard in PayPal for Payment 8

Same name in this branch
  1. 8 src/Plugin/Payment/MethodConfiguration/PayPalStandard.php \Drupal\paypal_payment\Plugin\Payment\MethodConfiguration\PayPalStandard
  2. 8 src/Plugin/Payment/Method/PayPalStandard.php \Drupal\paypal_payment\Plugin\Payment\Method\PayPalStandard
Same name and namespace in other branches
  1. 2.0.x src/Plugin/Payment/MethodConfiguration/PayPalStandard.php \Drupal\paypal_payment\Plugin\Payment\MethodConfiguration\PayPalStandard

Provides the configuration for the PayPal Standard payment method plugin.

Plugin annotation


@PaymentMethodConfiguration(
  description = @Translation("PayPal Standard payment method type."),
  id = "paypal_payment_standard",
  label = @Translation("PayPal Standard")
)

Hierarchy

Expanded class hierarchy of PayPalStandard

File

src/Plugin/Payment/MethodConfiguration/PayPalStandard.php, line 18

Namespace

Drupal\paypal_payment\Plugin\Payment\MethodConfiguration
View source
class PayPalStandard extends PayPalBasic {

  /**
   * Gets the email of this configuration.
   *
   * @return string
   */
  public function getEmail() : string {
    return $this->configuration['email'] ?? '';
  }

  /**
   * {@inheritdoc}
   */
  public function processBuildConfigurationForm(array &$element, FormStateInterface $form_state, array &$form) {
    parent::processBuildConfigurationForm($element, $form_state, $form);
    $element['paypal']['email'] = [
      '#type' => 'email',
      '#title' => $this
        ->t('Email'),
      '#default_value' => $this
        ->getEmail(),
      '#maxlength' => 255,
      '#required' => TRUE,
    ];
    return $element;
  }

  /**
   * {@inheritdoc}
   */
  public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
    parent::submitConfigurationForm($form, $form_state);
    $parents = $form['plugin_form']['paypal']['#parents'];
    array_pop($parents);
    $values = $form_state
      ->getValues();
    $values = NestedArray::getValue($values, $parents);
    $this->configuration['email'] = $values['paypal']['email'];
  }

  /**
   * @inheritDoc
   */
  public function getDerivativeConfiguration() : array {
    return parent::getDerivativeConfiguration() + [
      'email' => $this
        ->getEmail(),
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Basic::$paymentStatusType protected property The payment status plugin type.
Basic::$pluginSelectorManager protected property The plugin selector manager.
Basic::buildConfigurationForm public function Form constructor. Overrides PaymentMethodConfigurationBase::buildConfigurationForm
Basic::create public static function Creates an instance of the plugin. Overrides PaymentMethodConfigurationBase::create
Basic::defaultConfiguration public function Gets default configuration for this plugin. Overrides PaymentMethodConfigurationBase::defaultConfiguration
Basic::getBrandLabel public function Gets the brand label.
Basic::getCapture public function Gets whether or not capture is supported.
Basic::getCapturePaymentStatusSelector protected function Gets the payment status selector for the capture phase.
Basic::getCaptureStatusId public function Gets the status to set on payment capture.
Basic::getExecutePaymentStatusSelector protected function Gets the payment status selector for the execute phase.
Basic::getExecuteStatusId public function Gets the status to set on payment execution.
Basic::getPaymentStatusSelector protected function Gets the payment status selector.
Basic::getRefund public function Gets whether or not refunds are supported.
Basic::getRefundPaymentStatusSelector protected function Gets the payment status selector for the refund phase.
Basic::getRefundStatusId public function Gets the status to set on payment refund.
Basic::setBrandLabel public function Sets the brand label.
Basic::setCapture public function Sets whether or not capture is supported.
Basic::setCaptureStatusId public function Sets the status to set on payment capture.
Basic::setExecuteStatusId public function Sets the status to set on payment execution.
Basic::setRefund public function Sets whether or not refunds are supported.
Basic::setRefundStatusId public function Sets the status to set on payment refund.
Basic::validateConfigurationForm public function Form validation handler. Overrides PaymentMethodConfigurationBase::validateConfigurationForm
Basic::__construct public function Constructs a new instance. Overrides PaymentMethodConfigurationBase::__construct
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__wakeup public function 2
MessengerTrait::$messenger protected property The messenger. 29
MessengerTrait::messenger public function Gets the messenger. 29
MessengerTrait::setMessenger public function Sets the messenger.
PaymentMethodConfigurationBase::$moduleHandler protected property The module handler.
PaymentMethodConfigurationBase::calculateDependencies public function Calculates dependencies for the configured plugin. Overrides DependentPluginInterface::calculateDependencies
PaymentMethodConfigurationBase::getConfiguration public function Gets this plugin's configuration. Overrides ConfigurableInterface::getConfiguration
PaymentMethodConfigurationBase::getMessageText public function Gets the payer message text.
PaymentMethodConfigurationBase::getMessageTextFormat public function Gets the payer message text format.
PaymentMethodConfigurationBase::setConfiguration public function Sets the configuration for this plugin instance. Overrides ConfigurableInterface::setConfiguration
PaymentMethodConfigurationBase::setMessageText public function Sets payer message text.
PaymentMethodConfigurationBase::setMessageTextFormat public function Sets payer message text format.
PayPalBasic::getLogLevel public function Gets the setting for the log level.
PayPalBasic::isLogging public function Gets the setting for logging the PayPal API traffic.
PayPalBasic::isProduction public function Gets the setting for the production server.
PayPalStandard::getDerivativeConfiguration public function @inheritDoc Overrides PayPalBasic::getDerivativeConfiguration
PayPalStandard::getEmail public function Gets the email of this configuration.
PayPalStandard::processBuildConfigurationForm public function Implements a form API #process callback. Overrides PayPalBasic::processBuildConfigurationForm
PayPalStandard::submitConfigurationForm public function {} Overrides PayPalBasic::submitConfigurationForm
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$pluginDefinition protected property The plugin implementation definition. 1
PluginBase::$pluginId protected property The plugin_id.
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::getBaseId public function Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition 3
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::isConfigurable public function Determines if the plugin is configurable.
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.