public HttpRequestEncoder(IXmlPipeline xmlPipeline,
            HttpRequestEncodingType encodingType = HttpRequestEncodingType.PostWithXml)
        {
            Ensure.ArgumentNotNull(xmlPipeline, "xmlPipeline");

            _xmlPipeline = xmlPipeline;
            EncodingType = encodingType;
        }
 public PlatronClient(Credentials credentials, TimeSpan timeout, HttpRequestEncodingType httpRequestEncodingType = HttpRequestEncodingType.Get)
     : this(new Connection(PlatronUrl, credentials, timeout, httpRequestEncodingType))
 {
 }
        public async Task InitPayment_SpecifiedRequestEncodingAndReturnType_Succeeds(
            HttpRequestEncodingType encodingType, InitPaymentResponseType responseType)
        {
            var connection = new Connection(PlatronClient.PlatronUrl, SettingsStorage.Credentials, encodingType);
            var client = new PlatronClient(connection);
            // To find out what really happens enable proxy (thru fiddler)
            // and use custom connection over http to watch plain requests
            //.EnableProxy(new WebProxy("http://localhost:8888", false));

            var initPayment = new InitPaymentRequest(1.Rur(), "Money first");
            initPayment.InTestMode();
            initPayment.OrderId = Guid.NewGuid().ToString("N");

            switch (responseType)
            {
                case InitPaymentResponseType.RedirectLink:
                    var response = await client.InitPaymentAsync(initPayment);
                    Assert.NotNull(response);
                    break;
                case InitPaymentResponseType.HtmlForm:
                    var html = await client.InitPaymentAsHtmlAsync(initPayment);
                    Assert.NotNull(html);
                    break;
                default:
                    throw new ArgumentOutOfRangeException(nameof(responseType), responseType, null);
            }
        }