public static function isValid($action, $throw = false)
    {
        if (in_array($action, static::getActions(), true)) {
            return true;
        }

        if ($throw) {
            throw new InvalidArgumentException("Unknown gateway action '$action'.");
        }

        return false;
    }
public static function isValid($action, $throw = false)
    {
        if (in_array($action, static::getActions(), true)) {
            return true;
        }

        if ($throw) {
            throw new InvalidArgumentException("Unknown gateway action '$action'.");
        }

        return false;
    }
Returns whether the given action is valid.

@param string $action
@param bool   $throw

@return bool