/// <summary>
        /// Creates an OrderDetailViewModel, containing all the informations about the order, the shipments and lineitems.
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public virtual OrderDetailViewModel CreateViewModel(CreateOrderDetailViewModelParam param)
        {
            if (param == null)
            {
                throw new ArgumentNullException("param");
            }
            if (param.CultureInfo == null)
            {
                throw new ArgumentException("param.CultureInfo");
            }
            if (param.Order == null)
            {
                throw new ArgumentException("param.Order");
            }
            if (param.OrderStatuses == null)
            {
                throw new ArgumentException("param.OrderStatuses");
            }
            if (param.ShipmentStatuses == null)
            {
                throw new ArgumentException("param.ShipmentStatuses");
            }
            if (param.OrderChanges == null)
            {
                throw new ArgumentException("param.OrderChanges");
            }
            if (param.ProductImageInfo == null)
            {
                throw new ArgumentException("param.ProductImageInfo");
            }
            if (param.ProductImageInfo.ImageUrls == null)
            {
                throw new ArgumentException("param.ImageUrls");
            }
            if (string.IsNullOrWhiteSpace(param.BaseUrl))
            {
                throw new ArgumentException("param.BaseUrl");
            }
            if (string.IsNullOrWhiteSpace(param.CountryCode))
            {
                throw new ArgumentException("param.CountryCode");
            }

            var viewModel = new OrderDetailViewModel();
            var shipments = GetActiveShipments(param.Order);

#pragma warning disable 618
            viewModel.OrderInfos         = GetOrderInfosViewModel(param);
            viewModel.History            = GetOrderChangesViewModel(param.OrderChanges, param.CultureInfo, _orderStatus);
            viewModel.BillingAddress     = GetBillingAddressViewModel(param);
            viewModel.ShippingAddress    = GetShippingAddressViewModel(param);
            viewModel.Shipments          = GetShipmentViewModels(param);
            viewModel.ShippingMethod     = GetShippingMethodViewModel(param);
            viewModel.Payments           = GetPaymentViewModels(param);
            viewModel.OrderSummary       = CartViewModelFactory.GetOrderSummaryViewModel(param.Order.Cart, param.CultureInfo);
            viewModel.OrderSummary.Taxes = TaxViewModelFactory.CreateTaxViewModels(shipments.SelectMany(s => s.Taxes).ToList(), param.CultureInfo).ToList();
            MapAdditionalFees(viewModel, param);
#pragma warning restore 618

            // Reverse the items order in the Cart so the last added item will be the first in the list
            if (viewModel.Shipments != null && viewModel.Shipments.Any())
            {
                viewModel.Shipments.ForEach(x => x.LineItems.Reverse());
            }

            return(viewModel);
        }