/// <summary>
        /// 
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="result">PagSeguro AuthorizationSearchResult</param>
        internal static void Read(XmlReader reader, AuthorizationSearchResult result)
        {
            if (reader.IsEmptyElement)
            {
                XMLParserUtils.SkipNode(reader);

                return;
            }
            reader.ReadStartElement(SerializerHelper.AuthorizationSearchResult);

            reader.MoveToContent();

            while (!reader.EOF)
            {

                if (XMLParserUtils.IsEndElement(reader, SerializerHelper.AuthorizationSearchResult))
                {
                    XMLParserUtils.SkipNode(reader);
                    break;
                }

                if (reader.NodeType == XmlNodeType.Element)
                {
                    switch (reader.Name)
                    {
                        case SerializerHelper.Date:
                            result.Date = reader.ReadElementContentAsDateTime();
                            break;
                        case SerializerHelper.Authorizations:
                            AuthorizationSummaryListSerializer.Read(reader, result.Authorizations);
                            break;
                        default:
                            XMLParserUtils.SkipElement(reader);
                            break;
                    }
                }
                else
                {
                    XMLParserUtils.SkipNode(reader);
                }
            }
        }
        /// <summary>
        /// Finds a authorization with a matching date interval
        /// </summary>
        /// <param name="credentials">PagSeguro credentials. Required.</param>
        /// <param name="initialDate"></param>
        /// <param name="finalDate">End of date range. Use DateTime.MaxValue to search without an upper boundary.</param>
        /// <param name="pageNumber">Page number, starting with 1. If passed as 0, it will call the web service to get the default page, also page number 1.</param>
        /// <param name="resultsPerPage">Results per page, optional.</param>
        /// <returns></returns>
        public static AuthorizationSearchResult SearchByDate(Credentials credentials, DateTime initialDate, DateTime finalDate, int? pageNumber = null, int? resultsPerPage = null)
        {
            PagSeguroTrace.Info(String.Format(CultureInfo.InvariantCulture, "AuthorizationSearchService.SearchByDate(initialDate={0} - finalDate={1}) - begin", initialDate, finalDate));

            try
            {
                using(HttpWebResponse response = HttpURLConnectionUtil.GetHttpGetConnection(BuildSearchUrlByDate(credentials, initialDate, finalDate, pageNumber, resultsPerPage)))
                {
                    using(XmlReader reader = XmlReader.Create(response.GetResponseStream()))
                    {
                        AuthorizationSearchResult authorization = new AuthorizationSearchResult();
                        AuthorizationSearchResultSerializer.Read(reader, authorization);
                        return authorization;
                    }
                }
            }
            catch (WebException exception)
            {
                throw exception;
            }
            catch (PagSeguroServiceException pse)
            {
                throw pse;
            }
        }