You are here

function commerce_payment_update_8200 in Commerce Core 8.2

Add the payment_gateway_mode field to payments and payment methods.

File

modules/payment/commerce_payment.install, line 25
Install, update and uninstall functions for the commerce_payment module.

Code

function commerce_payment_update_8200() {
  $entity_definition_update = \Drupal::entityDefinitionUpdateManager();
  $storage_definition = BaseFieldDefinition::create('string')
    ->setLabel(t('Payment gateway mode'))
    ->setDescription(t('The payment gateway mode.'))
    ->setRequired(TRUE);
  $entity_definition_update
    ->installFieldStorageDefinition('payment_gateway_mode', 'commerce_payment', 'commerce_payment', $storage_definition);
  $entity_definition_update
    ->installFieldStorageDefinition('payment_gateway_mode', 'commerce_payment_method', 'commerce_payment', $storage_definition);
}