public string Finalize()
        {
            if (order.ShippingStatus == ShippingStatus.ReadyForShippment)
            {
                throw new InvalidOperationException();
            }

            var shippingProvider = purchaseProviderFactory.CreateShippingProvider(order);

            var invoice = purchaseProviderFactory.CreateInvoice(order);

            // Send invoice

            invoice.GenerateInvoice();

            var summary = purchaseProviderFactory.CreateSummary(order);

            summary.Send();

            // Send summary

            order.ShippingStatus = ShippingStatus.ReadyForShippment;

            return(shippingProvider.GenerateShippingLabelFor(order));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates shipping label for a specific order
        /// </summary>
        /// <returns></returns>
        public string FinalizeOrder()
        {
            ShippingProviderBase shippingProvider = purchaseProviderFactory.CreateShippingProvider(order);

            purchaseProviderFactory.CreateInvoice(order);
            var summary = purchaseProviderFactory.CreateSummary(order);

            summary.Send();

            order.ShippingStatus = ShippingStatus.ReadyForShipment;
            return(shippingProvider.GenerateShippingLabel(order));
        }
        public string Finalize()
        {
            var shippingProvider = purchaseProviderFactory.CreateShippingProvider(order);

            var invoice = purchaseProviderFactory.CreateInvoice(order);

            // send invoice...

            var summary = purchaseProviderFactory.CreateSummary(order);

            summary.Send();

            order.ShippingStatus = ShippingStatus.ReadyForShippment;

            return(shippingProvider.GenerateShippingLabelFor(order));
        }