Example #1
0
        /// <summary>
        /// Renders checkout information after sale is done, so gets
        /// everything from invoice. Basket is now empty once again.
        /// </summary>
        /// <param name="invoiceKey"></param>
        /// <returns></returns>
        private ActionResult RenderCompleteInvoiceSummary(Guid invoiceKey)
        {
            var invoice = Services.InvoiceService.GetByKey(invoiceKey);

                var model = new CheckoutViewModel();

                // init objects
                model.CustomerAddress = new AddressModel();
                model.Items = new LineItemCollection();

                var customeraddress = new AddressModel();

                model.CustomerName = invoice.BillToName ?? "";

                customeraddress.Email = invoice.BillToEmail ?? "";
                customeraddress.Address1 = invoice.BillToAddress1 ?? "";
                customeraddress.Locality = invoice.BillToLocality ?? "";
                customeraddress.CountryCode = invoice.BillToCountryCode ?? "";
                customeraddress.PostalCode = invoice.BillToPostalCode ?? "";
                customeraddress.Region = invoice.BillToRegion ?? "";

                model.CustomerAddress = customeraddress;

                //model.PaymentType = invoice.;

                model.Items = invoice.Items;
                model.TotalBasketPrice = invoice.Total;

                return PartialView("CheckoutSummary", model);
        }
Example #2
0
        public ActionResult SaveAddress(AddressModel model)
        {
            var address = model.ToAddress();

                // address saved to extended data on table merchAnonymousCustomer
                Basket.SalePreparation().SaveBillToAddress(address);
                Basket.SalePreparation().SaveShipToAddress(address);

                // go to payment page - only the cash payment is installed
                return RedirectToUmbracoPage(PaymentInfoId);
        }