diff --git a/_1C.Gateway.Managers/LeasingTrialManager.cs b/_1C.Gateway.Managers/LeasingTrialManager.cs index f4e576f..3ac1203 100644 --- a/_1C.Gateway.Managers/LeasingTrialManager.cs +++ b/_1C.Gateway.Managers/LeasingTrialManager.cs @@ -1,4 +1,5 @@ using LeasingTrial; +using System; using System.ServiceModel; namespace _1C.Gateway.Managers @@ -9,6 +10,12 @@ namespace _1C.Gateway.Managers public LeasingTrialManager() { + var url = Environment.GetEnvironmentVariable("1C_URL_LEASING_TRIAL"); + var username = Environment.GetEnvironmentVariable("1C_USERNAME"); + var password = Environment.GetEnvironmentVariable("1C_PASSWORD"); + + + var address = new EndpointAddress(url); var binding = new BasicHttpBinding { MaxReceivedMessageSize = int.MaxValue, @@ -18,12 +25,9 @@ namespace _1C.Gateway.Managers Transport = {ClientCredentialType = HttpClientCredentialType.Basic} } }; - - var address = new EndpointAddress("http://1c-dev.evoleasing.ru/1c_leasing_trial/ws/wsmd_exch.1cws"); - _mdExchPortTypeClient = new md_exchPortTypeClient(binding, address); - _mdExchPortTypeClient.ClientCredentials.UserName.UserName = "ws"; - _mdExchPortTypeClient.ClientCredentials.UserName.Password = "123"; + _mdExchPortTypeClient.ClientCredentials.UserName.UserName = username; + _mdExchPortTypeClient.ClientCredentials.UserName.Password = password; } public TransTaxResponse TransTax(TransTaxRequest transTaxRequest)