You are here

public function PayPalCredit::buildFieldDefinitions in Commerce Braintree 8

Builds the field definitions for entities of this bundle.

Important: Field names must be unique across all bundles. It is recommended to prefix them with the bundle name (plugin ID).

Return value

\Drupal\entity\BundleFieldDefinition[] An array of bundle field definitions, keyed by field name.

Overrides PaymentMethodTypeBase::buildFieldDefinitions

File

src/Plugin/Commerce/PaymentMethodType/PayPalCredit.php, line 36

Class

PayPalCredit
Provides the PayPal Credit payment method type.

Namespace

Drupal\commerce_braintree\Plugin\Commerce\PaymentMethodType

Code

public function buildFieldDefinitions() {
  $fields = parent::buildFieldDefinitions();
  $fields['paypal_mail'] = BundleFieldDefinition::create('email')
    ->setLabel(t('PayPal Email'))
    ->setDescription(t('The email address associated with the PayPal account.'))
    ->setRequired(TRUE);
  return $fields;
}