You are here

class CommercePaymentMethodType in Commerce Core 8.2

Defines the payment method type plugin annotation object.

Plugin namespace: Plugin\Commerce\PaymentMethodType.

Hierarchy

Expanded class hierarchy of CommercePaymentMethodType

See also

Plugin API

2 classes are annotated with CommercePaymentMethodType
CreditCard in modules/payment/src/Plugin/Commerce/PaymentMethodType/CreditCard.php
Provides the credit card payment method type.
PayPal in modules/payment/src/Plugin/Commerce/PaymentMethodType/PayPal.php
Provides the PayPal payment method type.

File

modules/payment/src/Annotation/CommercePaymentMethodType.php, line 16

Namespace

Drupal\commerce_payment\Annotation
View source
class CommercePaymentMethodType extends Plugin {

  /**
   * The plugin ID.
   *
   * @var string
   */
  public $id;

  /**
   * The payment method type label.
   *
   * @var \Drupal\Core\Annotation\Translation
   *
   * @ingroup plugin_translatable
   */
  public $label;

  /**
   * The payment method type create label.
   *
   * Defaults to the main label.
   *
   * @var \Drupal\Core\Annotation\Translation
   *
   * @ingroup plugin_translatable
   */
  public $create_label;

  /**
   * Constructs a new CommercePaymentMethodType object.
   *
   * @param array $values
   *   The annotation values.
   */
  public function __construct(array $values) {
    if (empty($values['create_label'])) {
      $values['create_label'] = $values['label'];
    }
    parent::__construct($values);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CommercePaymentMethodType::$create_label public property The payment method type create label.
CommercePaymentMethodType::$id public property The plugin ID.
CommercePaymentMethodType::$label public property The payment method type label.
CommercePaymentMethodType::__construct public function Constructs a new CommercePaymentMethodType object. Overrides Plugin::__construct
Plugin::$definition protected property The plugin definition read from the class annotation. 1
Plugin::get public function Gets the value of an annotation. Overrides AnnotationInterface::get 5
Plugin::getClass public function Gets the class of the annotated class. Overrides AnnotationInterface::getClass
Plugin::getId public function Gets the unique ID for this annotated class. Overrides AnnotationInterface::getId
Plugin::getProvider public function Gets the name of the provider of the annotated class. Overrides AnnotationInterface::getProvider
Plugin::parse protected function Parses an annotation into its definition.
Plugin::setClass public function Sets the class of the annotated class. Overrides AnnotationInterface::setClass
Plugin::setProvider public function Sets the name of the provider of the annotated class. Overrides AnnotationInterface::setProvider