abstract class PayPalPaymentMethodPluginBase in Ubercart 8.4
Defines the PayPal Express Checkout payment method.
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
- class \Drupal\uc_payment\PaymentMethodPluginBase implements ContainerFactoryPluginInterface, PaymentMethodPluginInterface
- class \Drupal\uc_paypal\Plugin\Ubercart\PaymentMethod\PayPalPaymentMethodPluginBase
- class \Drupal\uc_payment\PaymentMethodPluginBase implements ContainerFactoryPluginInterface, PaymentMethodPluginInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
Expanded class hierarchy of PayPalPaymentMethodPluginBase
File
- payment/
uc_paypal/ src/ Plugin/ Ubercart/ PaymentMethod/ PayPalPaymentMethodPluginBase.php, line 13
Namespace
Drupal\uc_paypal\Plugin\Ubercart\PaymentMethodView source
abstract class PayPalPaymentMethodPluginBase extends PaymentMethodPluginBase {
/**
* {@inheritdoc}
*/
public function defaultConfiguration() {
return [
'wps_email' => '',
'wpp_server' => 'https://api-3t.sandbox.paypal.com/nvp',
'api' => [
'api_username' => '',
'api_password' => '',
'api_signature' => '',
],
];
}
/**
* {@inheritdoc}
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$form['wps_email'] = [
'#type' => 'email',
'#title' => $this
->t('PayPal e-mail address'),
'#description' => $this
->t('The e-mail address you use for the PayPal account you want to receive payments.'),
'#default_value' => $this->configuration['wps_email'],
];
$form['wpp_server'] = [
'#type' => 'select',
'#title' => $this
->t('API server'),
'#description' => $this
->t('Sign up for and use a Sandbox account for testing.'),
'#options' => [
'https://api-3t.sandbox.paypal.com/nvp' => $this
->t('Sandbox'),
'https://api-3t.paypal.com/nvp' => $this
->t('Live'),
],
'#default_value' => $this->configuration['wpp_server'],
];
$form['api'] = [
'#type' => 'details',
'#title' => $this
->t('API credentials'),
'#description' => $this
->t('@link for information on obtaining credentials. You need to acquire an API Signature. If you have already requested API credentials, you can review your settings under the API Access section of your PayPal profile.', [
'@link' => Link::fromTextAndUrl($this
->t('Click here'), Url::fromUri('https://developer.paypal.com/docs/classic/api/apiCredentials/'))
->toString(),
]),
'#open' => TRUE,
];
$form['api']['api_username'] = [
'#type' => 'textfield',
'#title' => $this
->t('API username'),
'#default_value' => $this->configuration['api']['api_username'],
];
$form['api']['api_password'] = [
'#type' => 'textfield',
'#title' => $this
->t('API password'),
'#default_value' => $this->configuration['api']['api_password'],
];
$form['api']['api_signature'] = [
'#type' => 'textfield',
'#title' => $this
->t('Signature'),
'#default_value' => $this->configuration['api']['api_signature'],
];
return $form;
}
/**
* {@inheritdoc}
*/
public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
$this->configuration['wps_email'] = trim($form_state
->getValue('wps_email'));
$this->configuration['wpp_server'] = $form_state
->getValue('wpp_server');
$this->configuration['api']['api_username'] = $form_state
->getValue([
'settings',
'api',
'api_username',
]);
$this->configuration['api']['api_password'] = $form_state
->getValue([
'settings',
'api',
'api_password',
]);
$this->configuration['api']['api_signature'] = $form_state
->getValue([
'settings',
'api',
'api_signature',
]);
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DependencySerializationTrait:: |
protected | property | An array of entity type IDs keyed by the property name of their storages. | |
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
DependencySerializationTrait:: |
public | function | 1 | |
DependencySerializationTrait:: |
public | function | 2 | |
MessengerTrait:: |
protected | property | The messenger. | 29 |
MessengerTrait:: |
public | function | Gets the messenger. | 29 |
MessengerTrait:: |
public | function | Sets the messenger. | |
PaymentMethodPluginBase:: |
protected | property | The database service. | |
PaymentMethodPluginBase:: |
public | function |
Returns the form or render array to be displayed at checkout. Overrides PaymentMethodPluginInterface:: |
5 |
PaymentMethodPluginBase:: |
public | function |
Called when checkout is submitted with this payment method selected. Overrides PaymentMethodPluginInterface:: |
3 |
PaymentMethodPluginBase:: |
public | function |
Returns the payment method review details. Overrides PaymentMethodPluginInterface:: |
3 |
PaymentMethodPluginBase:: |
public | function |
Returns the payment method title to be used on the checkout review page. Overrides PaymentMethodPluginInterface:: |
2 |
PaymentMethodPluginBase:: |
public static | function |
Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface:: |
|
PaymentMethodPluginBase:: |
public | function |
Called when an order is being viewed by a customer. Overrides PaymentMethodPluginInterface:: |
2 |
PaymentMethodPluginBase:: |
public | function |
Gets this plugin's configuration. Overrides ConfigurableInterface:: |
|
PaymentMethodPluginBase:: |
public | function |
Returns the payment method label with logo. Overrides PaymentMethodPluginInterface:: |
3 |
PaymentMethodPluginBase:: |
public | function |
Called when an order is being deleted. Overrides PaymentMethodPluginInterface:: |
1 |
PaymentMethodPluginBase:: |
public | function |
Called when an order is being edited with this payment method. Overrides PaymentMethodPluginInterface:: |
3 |
PaymentMethodPluginBase:: |
public | function |
Called when an order is being submitted after being edited. Overrides PaymentMethodPluginInterface:: |
1 |
PaymentMethodPluginBase:: |
public | function |
Called when an order is being loaded with this payment method. Overrides PaymentMethodPluginInterface:: |
3 |
PaymentMethodPluginBase:: |
public | function |
Called when an order is being saved with this payment method. Overrides PaymentMethodPluginInterface:: |
3 |
PaymentMethodPluginBase:: |
public | function |
Called when an order is being submitted with this payment method. Overrides PaymentMethodPluginInterface:: |
4 |
PaymentMethodPluginBase:: |
public | function |
Called when an order is being viewed by an administrator. Overrides PaymentMethodPluginInterface:: |
6 |
PaymentMethodPluginBase:: |
public | function |
Sets the configuration for this plugin instance. Overrides ConfigurableInterface:: |
|
PaymentMethodPluginBase:: |
public | function |
Form validation handler. Overrides PluginFormInterface:: |
|
PaymentMethodPluginBase:: |
public | function |
Constructs the PaymentMethodPluginBase object. Overrides PluginBase:: |
|
PayPalPaymentMethodPluginBase:: |
public | function |
Form constructor. Overrides PaymentMethodPluginBase:: |
2 |
PayPalPaymentMethodPluginBase:: |
public | function |
Gets default configuration for this plugin. Overrides PaymentMethodPluginBase:: |
2 |
PayPalPaymentMethodPluginBase:: |
public | function |
Form submission handler. Overrides PaymentMethodPluginBase:: |
2 |
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |