private void AddUserNameToken(UPSTimeInTransit.UPSSecurity upss)
 {
     var upssUsrNameToken = new UPSTimeInTransit.UPSSecurityUsernameToken();
     upssUsrNameToken.Username = UserName;
     upssUsrNameToken.Password = Pasword;
     upss.UsernameToken = upssUsrNameToken;
 }
 private void AddUpsServiceAccessToken(UPSTimeInTransit.UPSSecurity upss)
 {
     var upssSvcAccessToken = new UPSTimeInTransit.UPSSecurityServiceAccessToken();
     upssSvcAccessToken.AccessLicenseNumber = AccessLicenseNumber;
     upss.ServiceAccessToken = upssSvcAccessToken;
 }
 private void AddShipFromAddress(UPSTimeInTransit.TimeInTransitRequest request)
 {
     var shipFrom = new UPSTimeInTransit.RequestShipFromType();
     var shipFromAddress = new UPSTimeInTransit.RequestShipFromAddressType();
     if (!string.IsNullOrEmpty(ShipFromCity))
         shipFromAddress.City = ShipFromCity;
     if (!string.IsNullOrEmpty(ShipFromPostalCode))
         shipFromAddress.PostalCode = ShipFromPostalCode;
     if (!string.IsNullOrEmpty(ShipFromStateProvinceCode))
         shipFromAddress.StateProvinceCode = ShipFromStateProvinceCode;
     if (!string.IsNullOrEmpty(ShipFromCountryCode))
         shipFromAddress.CountryCode = ShipFromCountryCode;
     shipFrom.Address = shipFromAddress;
     request.ShipFrom = shipFrom;
 }
 private void AddShipToAddress(UPSTimeInTransit.TimeInTransitRequest request, bool isResidentialAddress)
 {
     var shipTo = new UPSTimeInTransit.RequestShipToType();
     var shipToAddress = new UPSTimeInTransit.RequestShipToAddressType();
     if (!string.IsNullOrEmpty(ShipToCity))
         shipToAddress.City = ShipToCity;
     if (!string.IsNullOrEmpty(ShipToPostalCode))
         shipToAddress.PostalCode = ShipToPostalCode;
     if (!string.IsNullOrEmpty(ShipToStateProvinceCode))
         shipToAddress.StateProvinceCode = ShipToStateProvinceCode;
     if (!string.IsNullOrEmpty(ShipToCountryCode))
         shipToAddress.CountryCode = ShipToCountryCode;
     if (isResidentialAddress)
         shipToAddress.ResidentialAddressIndicator = "true";
     shipTo.Address = shipToAddress;
     request.ShipTo = shipTo;
 }
 private void AddInvoiceTotalType(int qty, decimal unitPrice, string currencyCode, UPSTimeInTransit.TimeInTransitRequest request)
 {
     var invoiceType = new UPSTimeInTransit.InvoiceLineTotalType();
     invoiceType.CurrencyCode = currencyCode;
     int total = (int)(qty * unitPrice);
     if (total % 100 > 0)
         total = total + (100 - total % 100);
     invoiceType.MonetaryValue = total.ToString();
     request.InvoiceLineTotal = invoiceType;
 }