class PayPalStandard in PayPal for Payment 2.0.x
Same name in this branch
- 2.0.x src/Plugin/Payment/MethodConfiguration/PayPalStandard.php \Drupal\paypal_payment\Plugin\Payment\MethodConfiguration\PayPalStandard
- 2.0.x src/Plugin/Payment/Method/PayPalStandard.php \Drupal\paypal_payment\Plugin\Payment\Method\PayPalStandard
Same name and namespace in other branches
- 8 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
- class \Drupal\paypal_payment\Plugin\Payment\MethodConfiguration\PayPalBasic extends \Drupal\payment\Plugin\Payment\MethodConfiguration\Basic
- class \Drupal\paypal_payment\Plugin\Payment\MethodConfiguration\PayPalStandard
Expanded class hierarchy of PayPalStandard
File
- src/
Plugin/ Payment/ MethodConfiguration/ PayPalStandard.php, line 18
Namespace
Drupal\paypal_payment\Plugin\Payment\MethodConfigurationView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PayPalBasic:: |
public | function | Gets the setting for the log level. | |
PayPalBasic:: |
public | function | Gets the setting for logging the PayPal API traffic. | |
PayPalBasic:: |
public | function | Gets the setting for the production server. | |
PayPalStandard:: |
public | function |
@inheritDoc Overrides PayPalBasic:: |
|
PayPalStandard:: |
public | function | Gets the email of this configuration. | |
PayPalStandard:: |
public | function |
Overrides PayPalBasic:: |
|
PayPalStandard:: |
public | function |
{} Overrides PayPalBasic:: |