public TaxJarNexusAddress(NexusAddress address) { id = address.Id; country = address.Country; zip = address.ZipCode; state = address.State; city = address.City; street = address.Street; }
public OrderToPost(Location fulfillmentLocation, Location shipToOverride, Order inboundOrder) { from_zip = fulfillmentLocation.Zip; from_country = fulfillmentLocation.Country; from_state = fulfillmentLocation.State; from_city = fulfillmentLocation.City; from_street = fulfillmentLocation.Street; nexus_addresses = new List <NexusAddress>(); if (shipToOverride != null) { to_country = shipToOverride.Country; to_state = shipToOverride.State; to_city = shipToOverride.City; to_street = shipToOverride.Street; to_zip = shipToOverride.Zip; var nxa = new NexusAddress(shipToOverride, "STO"); nexus_addresses.Add(nxa); } else { // Default to Customer's address for ShipTo location to_country = inboundOrder.Customer.Location.Country; to_state = inboundOrder.Customer.Location.State; to_city = inboundOrder.Customer.Location.City; to_street = inboundOrder.Customer.Location.Street; to_zip = inboundOrder.Customer.Location.Zip; var nxa = new NexusAddress(inboundOrder.Customer.Location, "MAIN"); nexus_addresses.Add(nxa); } shipping = inboundOrder.ShippingCost; line_items = new List <lineitem>(); foreach (var line in inboundOrder.ProductLineItems) { lineitem l = new lineitem { id = line.Id, product_tax_code = line.Product_Tax_Code, quantity = line.Quantity, unit_price = line.Unit_Price, discount = 0 }; //l.product_tax_code = "20010"; line_items.Add(l); } }