public function PayPal::buildFieldDefinitions in Commerce Core 8.2
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
- modules/
payment/ src/ Plugin/ Commerce/ PaymentMethodType/ PayPal.php, line 31
Class
- PayPal
- Provides the PayPal payment method type.
Namespace
Drupal\commerce_payment\Plugin\Commerce\PaymentMethodTypeCode
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;
}