You are here

mollie_payment.module in Mollie Payment 8.2

Same filename and directory in other branches
  1. 7.2 mollie_payment.module
  2. 7 mollie_payment.module

Provides Mollie integration for the Payment platform.

File

mollie_payment.module
View source
<?php

/**
 * @file
 * Provides Mollie integration for the Payment platform.
 *
 */
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Field\BaseFieldDefinition;

/**
 * Implements hook_entity_base_field_info().
 *
 * We need an additional field for each payment to store the Mollie payment id.
 */
function mollie_payment_entity_base_field_info(EntityTypeInterface $entity_type) {
  if ($entity_type
    ->id() == 'payment') {
    $fields = [];
    $fields['mollie_payment_id'] = BaseFieldDefinition::create('string')
      ->setLabel(t('Mollie payment id'))
      ->setDescription(t('The payment id in Mollie.'))
      ->setReadOnly(TRUE);
    return $fields;
  }
}