Braintree\CreditCardGateway::_validateId PHP Method

_validateId() private method

verifies that a valid credit card identifier is being used
private _validateId ( string $identifier = null, $identifierType = "token" )
$identifier string
    private function _validateId($identifier = null, $identifierType = "token")
    {
        if (empty($identifier)) {
            throw new InvalidArgumentException('expected credit card id to be set');
        }
        if (!preg_match('/^[0-9A-Za-z_-]+$/', $identifier)) {
            throw new InvalidArgumentException($identifier . ' is an invalid credit card ' . $identifierType . '.');
        }
    }