Returns Credit Card type for a store.

@param string $type
@return string
345210
public function getFromGateway($type) {
        $mapper = $this->config->getCcTypesMapper();
        $type   = strtolower($type);

        if( array_key_exists($type, $mapper) ) {
            return $mapper[$type];
        }

        return 'OT';
    }
1042661
def _credit_card_type(self, card_type=None):
        
        if card_type is None:
            card_type = self.random_element(self.credit_card_types.keys())
        elif isinstance(card_type, CreditCard):
            return card_type
        return self.credit_card_types[card_type]
1118392
public static function creditCard($input, $types = null) {
        $input = str_replace(array('-', ' '), '', $input);

        if (mb_strlen($input) < 13) {
            return false;
        }

        $cards = array(
            static::AMERICAN_EXPRESS  => '/^3[4|7]\\d{13}$/',
            static::BANKCARD          => '/^56(10\\d\\d|022[1-5])\\d{10}$/',
            static::DISCOVER          => '/^(?:6011|650\\d)\\d{12}$/',
            static::ENROUTE           => '/^2(?:014|149)\\d{11}$/',
            static::JCB               => '/^(3\\d{4}|2100|1800)\\d{11}$/',
            static::MAESTRO           => '/^(?:5020|6\\d{3})\\d{12}$/',
            static::MASTERCARD        => '/^5[1-5]\\d{14}$/',
            static::DINERS_CLUB       => '/^(?:3(0[0-5]|[68]\\d)\\d{11})|(?:5[1-5]\\d{14})$/',
            static::SOLO_DEBIT        => '/^(6334[5-9][0-9]|6767[0-9]{2})\\d{10}(\\d{2,3})?$/',
            static::SWITCH_DEBIT      => '/^(?:49(03(0[2-9]|3[5-9])|11(0[1-2]|7[4-9]|8[1-2])|36[0-9]{2})\\d{10}(\\d{2,3})?)|(?:564182\\d{10}(\\d{2,3})?)|(6(3(33[0-4][0-9])|759[0-9]{2})\\d{10}(\\d{2,3})?)$/',
            static::VISA              => '/^4\\d{12}(\\d{3})?$/',
            static::VISA_ELECTRON     => '/^(?:417500|4917\\d{2}|4913\\d{2})\\d{10}$/',
            static::VOYAGER           => '/^8699[0-9]{11}$/'
        );

        if ($types) {
            $validate = array();

            foreach ((array) $types as $card) {
                if (isset($cards[$card])) {
                    $validate[$card] = $cards[$card];
                } else {
                    throw new InvalidCreditCardException(sprintf('Credit card type %s does not exist', $card));
                }
            }
        } else {
            $validate = $cards;
        }

        foreach ($validate as $pattern) {
            if (preg_match($pattern, $input)) {
                return static::luhn($input);
            }
        }

        return false;
    }
1306114
public static function fetchType($type): string
    {
        if(\is_int($type)) {
            switch($type) {
                case self::TYPE_UNKNOWN:
                    return "unknown";
                case self::TYPE_INT:
                    return "integer";
                case self::TYPE_LONG:
                    return "long";
                case self::TYPE_SHORT:
                    return "short";
                case self::TYPE_BOOLEAN:
                    return "boolean";
                case self::TYPE_FLOAT:
                    return "float";
                case self::TYPE_STRING:
                    return "string";
                case self::TYPE_CHAR:
                    return "char";
                case self::TYPE_VARCHAR:
                    return "varchar";
                case self::TYPE_ARRAY:
                    return "array";
                case self::TYPE_OBJECT:
                    return "object";
                case self::TYPE_DATE:
                    return "date";
            }
        }
        return (string) $type;
    }
886923
private function getReferenceType($type)
    {
        switch ($type) {
            case 'absolute':
                return UrlGeneratorInterface::ABSOLUTE_PATH;
            case 'url':
                return UrlGeneratorInterface::ABSOLUTE_URL;
            case 'relative':
                return UrlGeneratorInterface::RELATIVE_PATH;
            case 'network':
                return UrlGeneratorInterface::NETWORK_PATH;
            default:
                return UrlGeneratorInterface::ABSOLUTE_PATH;
        }
    }
186839
public static function getTransactionTypeByName($transType) {
    switch ($transType) {
      //credit card apis
      case 'creditCardTransaction':
        return new GiroCheckout_SDK_CreditCardTransaction();
      case 'creditCardCapture':
        return new GiroCheckout_SDK_CreditCardCapture();
      case 'creditCardRefund':
        return new GiroCheckout_SDK_CreditCardRefund();
      case 'creditCardGetPKN':
        return new GiroCheckout_SDK_CreditCardGetPKN();
      case 'creditCardRecurringTransaction':
        return new GiroCheckout_SDK_CreditCardRecurringTransaction();
      case 'creditCardVoid':
        return new GiroCheckout_SDK_CreditCardVoid();

      //direct debit apis
      case 'directDebitTransaction':
        return new GiroCheckout_SDK_DirectDebitTransaction();
      case 'directDebitGetPKN':
        return new GiroCheckout_SDK_DirectDebitGetPKN();
      case 'directDebitTransactionWithPaymentPage':
        return new GiroCheckout_SDK_DirectDebitTransactionWithPaymentPage();
      case 'directDebitCapture':
        return new GiroCheckout_SDK_DirectDebitCapture();
      case 'directDebitRefund':
        return new GiroCheckout_SDK_DirectDebitRefund();
      case 'directDebitVoid':
        return new GiroCheckout_SDK_DirectDebitVoid();

      //giropay apis
      case 'giropayBankstatus':
        return new GiroCheckout_SDK_GiropayBankstatus();
      case 'giropayIDCheck':
        return new GiroCheckout_SDK_GiropayIDCheck();
      case 'giropayTransaction':
        return new GiroCheckout_SDK_GiropayTransaction();
      case 'giropayIssuerList':
        return new GiroCheckout_SDK_GiropayIssuerList();

      //iDEAL apis
      case 'idealIssuerList':
        return new GiroCheckout_SDK_IdealIssuerList();
      case 'idealPayment':
        return new GiroCheckout_SDK_IdealPayment();
      case 'idealRefund':
        return new GiroCheckout_SDK_IdealPaymentRefund();

      //PayPal apis
      case 'paypalTransaction':
        return new GiroCheckout_SDK_PaypalTransaction();

      //eps apis
      case 'epsBankstatus':
        return new GiroCheckout_SDK_EpsBankstatus();
      case 'epsTransaction':
        return new GiroCheckout_SDK_EpsTransaction();
      case 'epsIssuerList':
        return new GiroCheckout_SDK_EpsIssuerList();

      //tools apis
      case 'getTransactionTool':
        return new GiroCheckout_SDK_Tools_GetTransaction();

      //GiroCode apis
      case 'giroCodeCreatePayment':
        return new GiroCheckout_SDK_GiroCodeCreatePayment();
      case 'giroCodeCreateEpc':
        return new GiroCheckout_SDK_GiroCodeCreateEpc();
      case 'giroCodeGetEpc':
        return new GiroCheckout_SDK_GiroCodeGetEpc();

      //Paydirekt apis
      case 'paydirektTransaction':
        return new GiroCheckout_SDK_PaydirektTransaction();
      case 'paydirektCapture':
        return new GiroCheckout_SDK_PaydirektCapture();
      case 'paydirektRefund':
        return new GiroCheckout_SDK_PaydirektRefund();
      case 'paydirektVoid':
        return new GiroCheckout_SDK_PaydirektVoid();

      //Sofort apis
      case 'sofortuwTransaction':
        return new GiroCheckout_SDK_SofortUwTransaction();

      //BlueCode apis
      case 'blueCodeTransaction':
        return new GiroCheckout_SDK_BlueCodeTransaction();

      //Payment page apis
      case 'paypageTransaction':
        return new GiroCheckout_SDK_PaypageTransaction();
      case 'paypageProjects':
        return new GiroCheckout_SDK_PaypageProjects();

      //Maestro apis
      case 'maestroTransaction':
        return new GiroCheckout_SDK_MaestroTransaction();
      case 'maestroCapture':
        return new GiroCheckout_SDK_MaestroCapture();
      case 'maestroRefund':
        return new GiroCheckout_SDK_MaestroRefund();
    }

    return null;
  }
484502
protected function getCustomType($type)
    {
        $root = $this;
        while ($cur = $root->getParent()) {
            $root = $cur;
        }
        $customTypes = $root->getSchema()->getCustomTypes();
        $type = ltrim($type, '&');

        if (isset($customTypes[$type])) {
            return $customTypes[$type];
        }

        throw new Exception("Unable to resolve '$type' to a custom type-definition.");
    }
826207
protected function resolveType($type)
    {
        $types = $this->billTypes;

        // Type is a normal key
        if (isset($types[$type])) {
            return $type;
        }

        // Type is a title of type instead of its key
        if (in_array($type, $types, true)) {
            return array_search($type, $types, true);
        }

        // Assuming only second part is passed. Match from the end
        $foundKey = null;
        foreach ($types as $key => $title) {
            list(, $name) = explode(',', $key);
            if ($name === $type) {
                if ($foundKey !== null) {
                    throw new InvalidValueException('Payment type "' . $type . '" is ambiguous');
                }

                $foundKey = $key;
            }
        }

        if ($foundKey) {
            return $foundKey;
        }

        throw new InvalidValueException('Payment type "' . $type . '" is not recognized');
    }
361206
public function getColorForType($type)
    {
        // if we don't have a type return default color
        if (!isset($this->colors[$type])) {
            return Colours::DEFAULT_;
        }

        return $this->colors[$type];
    }
413949
protected function getType($type)
    {
        if (isset($this->typeAlias[$type])) {
            return $this->typeAlias[$type];
        }

        return $type;
    }
475693
protected function shopTypeToSourceType($shopType)
    {
        switch ($shopType) {
            case 'shop_order':
                return Source::Order;
            case 'shop_order_refund':
                return Source::CreditNote;
            default:
                $this->log->error('InvoiceManager::shopTypeToSourceType(%s): unknown', $shopType);
                return '';
        }
    }
1062778
public function getXSDType($type)
    {
        if ($this->isXDSType($type)) {
            return self::$XSDTypes[strtolower($type)];
        } elseif ($type) {
            if (strpos($type, '[]')) {
                if ($this->isXDSType(str_replace('[]', '', $type))) {
                    return self::$XSDTypes['array'];
                }
            }

            return $this->addComplexType($type);
        } else {
            return null;
        }
    }
629994
public function isOfType($type)
    {
        $types = static::parseTypes($type);

        // Add the unsure type when applicable.
        if (array_intersect([PhoneNumberType::FIXED_LINE, PhoneNumberType::MOBILE], $types)) {
            $types[] = PhoneNumberType::FIXED_LINE_OR_MOBILE;
        }

        return in_array($this->getType(true), $types, true);
    }
1192257
public static function isValidTransactionType($type)
    {
        $transactionTypes = \Genesis\Utils\Common::getClassConstants(__CLASS__);

        return in_array(strtolower($type), $transactionTypes);
    }
1199335
public function getCardType()
    {
        $number = str_replace(
            [' ', '-'],
            '',
            $this->number
        );

        foreach (static::$cardTypes as $type => $regex) {
            if (1 === preg_match($regex, $this->number)) {
                return $type;
            }
        }

        return 'Unknown';
    }
252232
public function findSiteByType($type) {
        $type = (int) $type;
        return \Functional\first($this->_getSiteList(), function (CM_Site_Abstract $site) use ($type) {
            return $site->getType() === $type;
        });
    }
209363
public function getCookieName($type)
    {
        $defaultCookieNames = $this->getConfigArrayOption(
            'default_cookie_names',
            [
                'segment' => EcomDev_Varnish_Model_Customer_Observer::COOKIE_SEGMENT
            ]
        );

        $cookieNames = $this->getConfigArrayOption(
            'cookie_names',
            []
        );


        $cookieNames = $defaultCookieNames + $cookieNames;

        if (isset($cookieNames[$type])) {
            return $cookieNames[$type];
        }

        return $type;
    }