protected virtual PxOrderSoapClient GetPxOrderSoapClient(PaymentMethod paymentMethod) { var binding = new BasicHttpBinding(BasicHttpSecurityMode.Transport) { CloseTimeout = TimeSpan.FromMinutes(1), OpenTimeout = TimeSpan.FromMinutes(1), ReceiveTimeout = TimeSpan.FromMinutes(10), SendTimeout = TimeSpan.FromMinutes(10), AllowCookies = false, BypassProxyOnLocal = false, HostNameComparisonMode = HostNameComparisonMode.StrongWildcard, MaxBufferSize = 65536, MaxBufferPoolSize = 524288, MaxReceivedMessageSize = 65536, MessageEncoding = WSMessageEncoding.Text, TextEncoding = Encoding.UTF8, TransferMode = TransferMode.Buffered, UseDefaultWebProxy = true }; Uri uri = paymentMethod.DynamicProperty <bool>().TestMode ? new Uri("https://test-external.payex.com/pxorder/pxorder.asmx", UriKind.Absolute) : new Uri("https://external.payex.com/pxorder/pxorder.asmx", UriKind.Absolute); var endpointAddress = new EndpointAddress(uri); Client = new PxOrderSoapClient(binding, endpointAddress); return(Client); }
private PxOrderSoapClient GetPxOrderClient() { Uri baseAddress; if (UseTestEnvironment) { baseAddress = new Uri("https://external.externaltest.payex.com/pxorder/pxorder.asmx"); } else { baseAddress = new Uri("https://external.payex.com/pxorder/pxorder.asmx"); } var payexOrder = new PxOrderSoapClient( new BasicHttpBinding(BasicHttpSecurityMode.Transport), new EndpointAddress(baseAddress) ); return(payexOrder); }