abstract class PaymentMethodPluginBase in Ubercart 8.4
Defines a base payment method plugin implementation.
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\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
Expanded class hierarchy of PaymentMethodPluginBase
7 files declare their use of PaymentMethodPluginBase
- CashOnDelivery.php in payment/
uc_payment_pack/ src/ Plugin/ Ubercart/ PaymentMethod/ CashOnDelivery.php - Check.php in payment/
uc_payment_pack/ src/ Plugin/ Ubercart/ PaymentMethod/ Check.php - CreditCardPaymentMethodBase.php in payment/
uc_credit/ src/ CreditCardPaymentMethodBase.php - FreeOrder.php in payment/
uc_payment/ src/ Plugin/ Ubercart/ PaymentMethod/ FreeOrder.php - Other.php in payment/
uc_payment_pack/ src/ Plugin/ Ubercart/ PaymentMethod/ Other.php
File
- payment/
uc_payment/ src/ PaymentMethodPluginBase.php, line 15
Namespace
Drupal\uc_paymentView source
abstract class PaymentMethodPluginBase extends PluginBase implements PaymentMethodPluginInterface, ContainerFactoryPluginInterface {
/**
* The database service.
*
* @var \Drupal\Core\Database\Connection
*/
protected $database;
/**
* Constructs the PaymentMethodPluginBase object.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin ID for the plugin instance.
* @param mixed $plugin_definition
* The plugin implementation definition.
* @param \Drupal\Core\Database\Connection $database
* A database connection.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, Connection $database) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->configuration += $this
->defaultConfiguration();
$this->database = $database;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container
->get('database'));
}
/**
* {@inheritdoc}
*/
public function getDisplayLabel($label) {
return [
'#plain_text' => $label,
];
}
/**
* {@inheritdoc}
*/
public function defaultConfiguration() {
return [];
}
/**
* {@inheritdoc}
*/
public function getConfiguration() {
return $this->configuration;
}
/**
* {@inheritdoc}
*/
public function setConfiguration(array $configuration) {
$this->configuration = $configuration;
}
/**
* {@inheritdoc}
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
return $form;
}
/**
* {@inheritdoc}
*/
public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
}
/**
* {@inheritdoc}
*/
public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
}
/**
* {@inheritdoc}
*/
public function cartDetails(OrderInterface $order, array $form, FormStateInterface $form_state) {
return [];
}
/**
* {@inheritdoc}
*/
public function cartProcess(OrderInterface $order, array $form, FormStateInterface $form_state) {
return TRUE;
}
/**
* {@inheritdoc}
*/
public function cartReviewTitle() {
return $this->pluginDefinition['name'];
}
/**
* {@inheritdoc}
*/
public function cartReview(OrderInterface $order) {
return [];
}
/**
* {@inheritdoc}
*/
public function orderDelete(OrderInterface $order) {
}
/**
* {@inheritdoc}
*/
public function orderEditDetails(OrderInterface $order) {
return [];
}
/**
* {@inheritdoc}
*/
public function orderEditProcess(OrderInterface $order, array $form, FormStateInterface $form_state) {
return [];
}
/**
* {@inheritdoc}
*/
public function orderLoad(OrderInterface $order) {
}
/**
* {@inheritdoc}
*/
public function orderSave(OrderInterface $order) {
}
/**
* {@inheritdoc}
*/
public function orderSubmit(OrderInterface $order) {
}
/**
* {@inheritdoc}
*/
public function orderView(OrderInterface $order) {
return [];
}
/**
* {@inheritdoc}
*/
public function customerView(OrderInterface $order) {
return $this
->orderView($order);
}
}
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 |
Form constructor. Overrides PluginFormInterface:: |
5 |
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 default configuration for this plugin. Overrides ConfigurableInterface:: |
5 |
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 submission handler. Overrides PluginFormInterface:: |
5 |
PaymentMethodPluginBase:: |
public | function |
Form validation handler. Overrides PluginFormInterface:: |
|
PaymentMethodPluginBase:: |
public | function |
Constructs the PaymentMethodPluginBase object. Overrides PluginBase:: |
|
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. |