public void GetAmazonOrderDetails(Order rawOrder, ref AmazonOrder order, AddressData shippingAddress) { order.AmazonOrderId = !String.IsNullOrWhiteSpace(rawOrder.AmazonOrderId) ? rawOrder.AmazonOrderId : String.Empty; order.BuyerEmail = !String.IsNullOrWhiteSpace(rawOrder.BuyerEmail) ? rawOrder.BuyerEmail : String.Empty; order.BuyerName = !String.IsNullOrWhiteSpace(rawOrder.BuyerName) ? rawOrder.BuyerName : String.Empty; order.PurchaseDate = TimeZoneInfo.ConvertTime(rawOrder.PurchaseDate, TimeZoneInfo.Utc, CurrentRequestData.TimeZoneInfo); order.PaymentMethod = rawOrder.PaymentMethod.GetEnumByValue<AmazonPaymentMethod>(); order.SalesChannel = !String.IsNullOrWhiteSpace(rawOrder.SalesChannel) ? rawOrder.SalesChannel : String.Empty; order.OrderType = !String.IsNullOrWhiteSpace(rawOrder.OrderType) ? rawOrder.OrderType : String.Empty; order.OrderTotalAmount = (rawOrder.OrderTotal != null && rawOrder.OrderTotal.Amount != null) ? Decimal.Parse(rawOrder.OrderTotal.Amount, (new CultureInfo("en-GB", false))) : 0; order.OrderCurrency = (rawOrder.OrderTotal != null && rawOrder.OrderTotal.Amount != null) ? rawOrder.OrderTotal.CurrencyCode : String.Empty; order.MarketplaceId = !String.IsNullOrWhiteSpace(rawOrder.MarketplaceId) ? rawOrder.MarketplaceId : String.Empty; order.ShipServiceLevel = !String.IsNullOrWhiteSpace(rawOrder.ShipServiceLevel) ? rawOrder.ShipServiceLevel : String.Empty; order.ShipmentServiceLevelCategory = !String.IsNullOrWhiteSpace(rawOrder.ShipmentServiceLevelCategory) ? rawOrder.ShipmentServiceLevelCategory : String.Empty; SetShippingAddress(order, shippingAddress); order.NumberOfItemsUnshipped = rawOrder.NumberOfItemsUnshipped; order.NumberOfItemsShipped = rawOrder.NumberOfItemsShipped; order.FulfillmentChannel = rawOrder.FulfillmentChannel.GetEnumByValue<AmazonFulfillmentChannel>(); order.LastUpdatedDate = TimeZoneInfo.ConvertTime(rawOrder.LastUpdateDate, TimeZoneInfo.Utc, CurrentRequestData.TimeZoneInfo); }
public void SetShippingAddress(AmazonOrder amazonOrder, AddressData address) { amazonOrder.ShippingAddress = address; }