You are here

public static function CreditCard::getTypeLabels in Commerce Core 8.2

Gets the labels of all available credit card types.

Return value

array The labels, keyed by ID.

File

modules/payment/src/CreditCard.php, line 110

Class

CreditCard
Provides logic for listing card types and validating card details.

Namespace

Drupal\commerce_payment

Code

public static function getTypeLabels() : array {
  $types = self::getTypes();
  $type_labels = array_map(function ($type) {
    return $type
      ->getLabel();
  }, $types);
  return $type_labels;
}