Exemplo n.º 1
0
        public WebAuthenticationDetail CreateFedexAuthentication(string key, string password)
        {
            WebAuthenticationDetail webAuth = new WebAuthenticationDetail();

            webAuth.UserCredential = new WebAuthenticationCredential()
            {
                Key      = key,
                Password = password
            };

            return(webAuth);
        }
Exemplo n.º 2
0
        private static WebAuthenticationDetail SetWebAuthenticationDetail(string accountKey, string accountPassword)
        {
            WebAuthenticationDetail wad = new WebAuthenticationDetail();

            wad.UserCredential          = new WebAuthenticationCredential();
            wad.UserCredential.Key      = accountKey;
            wad.UserCredential.Password = accountPassword;

            //wad.ParentCredential = new WebAuthenticationCredential();
            //wad.ParentCredential.Key = accountKey;
            //wad.ParentCredential.Password = accountPassword;

            return(wad);
        }
Exemplo n.º 3
0
        private static WebAuthenticationDetail SetWebAuthenticationDetail()
        {
            WebAuthenticationDetail wad = new WebAuthenticationDetail();

            wad.UserCredential   = new WebAuthenticationCredential();
            wad.ParentCredential = new WebAuthenticationCredential();
            //wad.UserCredential.Key = ConfigurationUtil.GetAppSetting("key");
            //wad.UserCredential.Password = ConfigurationUtil.GetAppSetting("password");
            //wad.ParentCredential = new WebAuthenticationCredential();
            //wad.ParentCredential.Key = ConfigurationUtil.GetAppSetting("parentkey");
            //wad.ParentCredential.Password = ConfigurationUtil.GetAppSetting("parentpassword");

            return(wad);
        }
Exemplo n.º 4
0
        private WebAuthenticationDetail SetWebAuthenticationDetail()
        {
            WebAuthenticationDetail wad = new WebAuthenticationDetail();

            wad.UserCredential            = new WebAuthenticationCredential();
            wad.UserCredential.Key        = _credentials.FedexUserKey.Trim();        //"IoXBEjJlfQOOLlrx"; // Replace "XXX" with the Key
            wad.UserCredential.Password   = _credentials.FedexUserPassword.Trim();   //"uwcmw4WV7TpoeZ0hOvK1jy9fF"; // Replace "XXX" with the Password
            wad.ParentCredential          = new WebAuthenticationCredential();
            wad.ParentCredential.Key      = _credentials.FedexParentKey.Trim();      //"IoXBEjJlfQOOLlrx"; // Replace "XXX" with the Key
            wad.ParentCredential.Password = _credentials.FedexParentPassword.Trim(); //"uwcmw4WV7TpoeZ0hOvK1jy9fF"; // Replace "XXX"
            if (usePropertyFile())                                                   //Set values from a file for testing purposes
            {
                wad.UserCredential.Key        = getProperty("key");
                wad.UserCredential.Password   = getProperty("password");
                wad.ParentCredential.Key      = getProperty("parentkey");
                wad.ParentCredential.Password = getProperty("parentpassword");
            }
            return(wad);
        }
Exemplo n.º 5
0
        private static WebAuthenticationDetail SetWebAuthenticationDetail()
        {
            WebAuthenticationDetail wad = new WebAuthenticationDetail();

            wad.UserCredential            = new WebAuthenticationCredential();
            wad.UserCredential.Key        = "XXX"; // Replace "XXX" with the Key
            wad.UserCredential.Password   = "******"; // Replace "XXX" with the Password
            wad.ParentCredential          = new WebAuthenticationCredential();
            wad.ParentCredential.Key      = "XXX"; // Replace "XXX" with the Key
            wad.ParentCredential.Password = "******"; // Replace "XXX"

            //if (usePropertyFile()) //Set values from a file for testing purposes
            //{
            //    wad.UserCredential.Key = getProperty("key");
            //    wad.UserCredential.Password = getProperty("password");
            //    wad.ParentCredential.Key = getProperty("parentkey");
            //    wad.ParentCredential.Password = getProperty("parentpassword");
            //}
            return(wad);
        }
Exemplo n.º 6
0
        private static WebAuthenticationDetail SetWebAuthenticationDetail()
        {
            WebAuthenticationDetail wad = new WebAuthenticationDetail();

            wad.UserCredential          = new WebAuthenticationCredential();
            wad.ParentCredential        = new WebAuthenticationCredential();
            wad.UserCredential.Key      = "x1pHFuEKcnjBFiKZ";          //Q6HmWN7Bsmb3Is9u*/"; // Replace "XXX" with the Key
            wad.UserCredential.Password = "******"; // Replace "XXX" with the Password
            wad.ParentCredential        = new WebAuthenticationCredential();

            wad.ParentCredential.Key      = "x1pHFuEKcnjBFiKZ";          //Q6HmWN7Bsmb3Is9u*/"; // Replace "XXX" with the Key
            wad.ParentCredential.Password = "******"; // Replace "XXX" with the Password

            if (usePropertyFile())                                       //Set values from a file for testing purposes
            {
                wad.UserCredential.Key        = getProperty("key");
                wad.UserCredential.Password   = getProperty("password");
                wad.ParentCredential.Key      = getProperty("parentkey");
                wad.ParentCredential.Password = getProperty("parentpassword");
            }
            return(wad);
        }
 public void SetWebAuthenticationDetail(WebAuthenticationDetail webAuthenticationDetail)
 {
     _request.WebAuthenticationDetail = webAuthenticationDetail;
 }
        private void initialize()
        {
            svc = new ShipService();
            svc.Url = Settings.Endpoint;

            shipper = new Party();
            shipper.Contact = new Contact();
            shipper.Contact.CompanyName = Settings.CompanyName;
            shipper.Contact.PhoneNumber = Settings.Telephone;
            shipper.Contact.EMailAddress = Settings.Email;
            shipper.Address = new Address();
            var l1 = Settings.AddressLine1;
            var l2 = Settings.AddressLine2;
            if (string.IsNullOrEmpty(l2)) {
                shipper.Address.StreetLines = new string[1] { l1 };
            } else {
                shipper.Address.StreetLines = new string[2] { l1, l2 };
            }
            shipper.Address.City = Settings.City;
            shipper.Address.StateOrProvinceCode = Settings.State;
            shipper.Address.PostalCode = Settings.PostalCode;
            shipper.Address.CountryCode = Settings.CountryCode;
            shipper.AccountNumber = Settings.AccountNumber;

            auth = new WebAuthenticationDetail();
            auth.UserCredential = new WebAuthenticationCredential();
            auth.UserCredential.Key = Settings.APIKey;
            auth.UserCredential.Password = Settings.Password;

            clientDetail = new ClientDetail();
            clientDetail.AccountNumber = Settings.AccountNumber;
            clientDetail.MeterNumber = Settings.MeterNumber;
        }