public virtual OldOrder CreateOrder <TShoppingCart>([NotNull] TShoppingCart shoppingCart) where TShoppingCart : ShoppingCart
        {
            Assert.ArgumentNotNull(shoppingCart, "shoppingCart");

            Assert.IsNotNull(this.transactionData, "TransactionData must be set.");
            Assert.IsNotNull(this.shopContext, "Unable to create the order. Shop context is not set.");

            this.InitializeInnerRepository();

            OldOrder order = Context.Entity.Resolve <OldOrder>();

            this.Map(shoppingCart, order);

            string transactionNumber = TypeUtil.TryParse(this.transactionData.GetPersistentValue(shoppingCart.OrderNumber, TransactionConstants.TransactionNumber), string.Empty);

            if (!string.IsNullOrEmpty(transactionNumber))
            {
                order.TransactionNumber = transactionNumber;
            }

            order.OrderDate = DateTime.Now;
            order.Status    = Context.Entity.Resolve <NewOrder>();
            order.ProcessStatus();

            string cardType = this.transactionData.GetPersistentValue(order.OrderNumber, TransactionConstants.CardType) as string;

            order.CustomerInfo.CustomProperties[TransactionConstants.CardType] = cardType;

            Ecommerce.OrderManagement.Orders.Order newOrder = this.Convert(order);

            ReservationTicket sourceTicket = this.transactionData.GetPersistentValue(order.OrderNumber, "ReservationTicket") as ReservationTicket;

            if (sourceTicket != null)
            {
                Ecommerce.OrderManagement.Orders.ReservationTicket destinationTicket = new Ecommerce.OrderManagement.Orders.ReservationTicket();
                this.Map(sourceTicket, destinationTicket);
                newOrder.ReservationTicket = destinationTicket;
            }

            newOrder.ShopContext = this.shopContext.InnerSite.Name;

            this.innerRepository.Create(newOrder);

            return(order);
        }
        /// <summary>
        /// Maps the specified source.
        /// </summary>
        /// <param name="source">The source.</param>
        /// <param name="destination">The destination.</param>
        protected virtual void Map([NotNull] DomainModel.Payments.ReservationTicket source, [NotNull] Ecommerce.OrderManagement.Orders.ReservationTicket destination)
        {
            Assert.ArgumentNotNull(source, "source");
            Assert.ArgumentNotNull(destination, "destination");

            destination.Amount            = source.Amount;
            destination.AuthorizationCode = source.AuthorizationCode;
            destination.InvoiceNumber     = source.InvoiceNumber;
            destination.TransactionNumber = source.TransactionNumber;
        }