You are here

class PaymentReference in Payment 8.2

Same name in this branch
  1. 8.2 modules/payment_reference/src/PaymentReference.php \Drupal\payment_reference\PaymentReference
  2. 8.2 modules/payment_reference/src/Element/PaymentReference.php \Drupal\payment_reference\Element\PaymentReference
  3. 8.2 modules/payment_reference/src/Plugin/Payment/Type/PaymentReference.php \Drupal\payment_reference\Plugin\Payment\Type\PaymentReference
  4. 8.2 modules/payment_reference/src/Plugin/Field/FieldWidget/PaymentReference.php \Drupal\payment_reference\Plugin\Field\FieldWidget\PaymentReference
  5. 8.2 modules/payment_reference/src/Plugin/Field/FieldType/PaymentReference.php \Drupal\payment_reference\Plugin\Field\FieldType\PaymentReference

Provides a payment reference element.

Plugin annotation

@FormElement("payment_reference");

Hierarchy

Expanded class hierarchy of PaymentReference

1 file declares its use of PaymentReference
PaymentReferenceTest.php in modules/payment_reference/tests/src/Unit/Element/PaymentReferenceTest.php
3 #type uses of PaymentReference
PaymentReference::formElement in modules/payment_reference/src/Plugin/Field/FieldWidget/PaymentReference.php
Returns the form for a single field widget.
PaymentReferenceElement::buildForm in modules/payment_reference_test/src/PaymentReferenceElement.php
Form constructor.
PaymentReferenceTest::testFormElement in modules/payment_reference/tests/src/Unit/Plugin/Field/FieldWidget/PaymentReferenceTest.php
@covers ::formElement

File

modules/payment_reference/src/Element/PaymentReference.php, line 24

Namespace

Drupal\payment_reference\Element
View source
class PaymentReference extends PaymentReferenceBase {

  /**
   * The payment queue.
   *
   * @var \Drupal\payment\QueueInterface
   */
  protected $paymentQueue;

  /**
   * Creates a new instance.
   *
   * @param mixed[] $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 \Symfony\Component\HttpFoundation\RequestStack $request_stack
   * @param \Drupal\Core\Entity\EntityStorageInterface $payment_storage
   * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation
   * @param \Drupal\Core\Datetime\DateFormatter $date_formatter
   * @param \Drupal\Core\Utility\LinkGeneratorInterface $link_generator
   * @param \Drupal\Core\Render\RendererInterface $renderer
   * @param \Drupal\Core\Session\AccountInterface $current_user
   * @param \Drupal\plugin\Plugin\Plugin\PluginSelector\PluginSelectorManagerInterface $plugin_selector_manager
   * @param \Drupal\plugin\PluginType\PluginTypeInterface $payment_method_type
   * @param \Drupal\payment\QueueInterface $payment_queue
   */
  public function __construct($configuration, $plugin_id, $plugin_definition, RequestStack $request_stack, EntityStorageInterface $payment_storage, TranslationInterface $string_translation, DateFormatter $date_formatter, LinkGeneratorInterface $link_generator, RendererInterface $renderer, AccountInterface $current_user, PluginSelectorManagerInterface $plugin_selector_manager, PluginTypeInterface $payment_method_type, Random $random, QueueInterface $payment_queue) {
    parent::__construct($configuration, $plugin_id, $plugin_definition, $request_stack, $payment_storage, $string_translation, $date_formatter, $link_generator, $renderer, $current_user, $plugin_selector_manager, $payment_method_type, $random);
    $this->paymentQueue = $payment_queue;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {

    /** @var \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager */
    $entity_type_manager = $container
      ->get('entity_type.manager');

    /** @var \Drupal\plugin\PluginType\PluginTypeManagerInterface $plugin_type_manager */
    $plugin_type_manager = $container
      ->get('plugin.plugin_type_manager');
    return new static($configuration, $plugin_id, $plugin_definition, $container
      ->get('request_stack'), $entity_type_manager
      ->getStorage('payment'), $container
      ->get('string_translation'), $container
      ->get('date.formatter'), $container
      ->get('link_generator'), $container
      ->get('renderer'), $container
      ->get('current_user'), $container
      ->get('plugin.manager.plugin.plugin_selector'), $plugin_type_manager
      ->getPluginType('payment_method'), new Random(), $container
      ->get('payment_reference.queue'));
  }

  /**
   * {@inheritdoc}
   */
  protected function getPaymentQueue() {
    return $this->paymentQueue;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
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
FormElement::processAutocomplete public static function Adds autocomplete functionality to elements.
FormElement::processPattern public static function #process callback for #pattern form element property.
FormElement::validatePattern public static function #element_validate callback for #pattern form element property.
FormElementCallbackTrait::__callStatic public static function Instantiates this class as a plugin and calls a method on it.
MessengerTrait::$messenger protected property The messenger. 29
MessengerTrait::messenger public function Gets the messenger. 29
MessengerTrait::setMessenger public function Sets the messenger.
PaymentReference::$paymentQueue protected property The payment queue.
PaymentReference::create public static function Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface::create
PaymentReference::getPaymentQueue protected function Gets the payment queue. Overrides PaymentReferenceBase::getPaymentQueue
PaymentReference::__construct public function Creates a new instance. Overrides PaymentReferenceBase::__construct
PaymentReferenceBase::$currentUser protected property The current user.
PaymentReferenceBase::$dateFormatter protected property The date formatter.
PaymentReferenceBase::$linkGenerator protected property The link generator.
PaymentReferenceBase::$paymentMethodType protected property The payment method type.
PaymentReferenceBase::$paymentStorage protected property The payment storage.
PaymentReferenceBase::$pluginSelectorManager protected property The plugin selector manager.
PaymentReferenceBase::$random protected property The random generator.
PaymentReferenceBase::$renderer protected property The renderer.
PaymentReferenceBase::$requestStack protected property The request stack.
PaymentReferenceBase::ajaxPay public function Implements form AJAX callback.
PaymentReferenceBase::ajaxRefresh public function Implements form AJAX callback.
PaymentReferenceBase::buildCompletePaymentLink protected function Builds the "Complete payment" link.
PaymentReferenceBase::buildPaymentForm protected function Builds the payment form.
PaymentReferenceBase::buildPaymentView protected function Builds the payment view.
PaymentReferenceBase::buildRefreshButton protected function Builds the refresh button.
PaymentReferenceBase::disableChildren protected function Disables all child elements.
PaymentReferenceBase::elementValidate public function Implements form API's element_validate callback.
PaymentReferenceBase::getEntityFormDisplay protected function Gets the entity form display.
PaymentReferenceBase::getInfo public function Returns the element properties for this element. Overrides ElementInterface::getInfo
PaymentReferenceBase::getPayment protected function Gets the payment.
PaymentReferenceBase::getPluginSelector protected function Gets the plugin selector.
PaymentReferenceBase::KEY_VALUE_TTL constant The number of seconds a payment should remain stored.
PaymentReferenceBase::pay public function Implements form submit handler.
PaymentReferenceBase::process public function Implements form #process callback.
PaymentReferenceBase::processMaxWeight public static function Implements form #process callback.
PaymentReferenceBase::refresh public static function Implements form submit handler.
PaymentReferenceBase::valueCallback public static function Determines how user input is mapped to an element's #value property. Overrides FormElement::valueCallback
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.
RenderElement::preRenderAjaxForm public static function Adds Ajax information about an element to communicate with JavaScript.
RenderElement::preRenderGroup public static function Adds members of this group as actual elements for rendering.
RenderElement::processAjaxForm public static function Form element processing handler for the #ajax form property. 1
RenderElement::processGroup public static function Arranges elements into groups.
RenderElement::setAttributes public static function Sets a form element's class attribute. Overrides ElementInterface::setAttributes
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.