示例#1
0
        /// <summary>
        ///     Sends a directory request to the URL specified in Configuration.AcquirerUrl_DirectoryReq
        /// </summary>
        /// <returns>
        ///     A DirectoryResponse object which contains the response from the server (a list of Issuers), or error information when an error occurs
        /// </returns>
        public DirectoryResponse GetDirectory()
        {
            try
            {
                _logger.Log("sending new directory request");

                _logger.Log("building idx message");
                var directoryreq = new IDxMessageBuilder(_configuration).GetDirectoryRequest();

                _logger.Log("signing message");
                var xml = Sign(directoryreq);

                var content = PerformRequest(xml, _configuration.AcquirerDirectoryUrl);

                return(DirectoryResponse.Parse(content));
            }
            catch (Exception e)
            {
                _logger.Log(e.ToString());
                return(new DirectoryResponse(e));
            }
        }
        /// <summary>
        ///     Sends a directory request to the URL specified in Configuration.AcquirerUrl_DirectoryReq
        /// </summary>
        /// <returns>
        ///     A DirectoryResponse object which contains the response from the server (a list of Issuers), or error information when an error occurs
        /// </returns>
        public async Task <DirectoryResponse> GetDirectoryAsync()
        {
            try
            {
                _logger.Log("sending new directory request");

                _logger.Log("building idx message");
                var directoryRequest = _iDxMessageBuilder.GetDirectoryRequest();

                _logger.Log("signing message");
                var xml = Sign(directoryRequest);

                var content = await PerformRequestAsync(xml, _configuration.AcquirerDirectoryUrl);

                return(DirectoryResponse.Parse(content));
            }
            catch (Exception e)
            {
                _logger.Log(e.ToString());
                return(new DirectoryResponse(e));
            }
        }