Exemplo n.º 1
0
        public ActionResult OnePageGiving(int id, bool? testing, string source)
        {
            Response.NoCache();
            try
            {
                var m = new OnlineRegModel(Request, id, testing, null, null, source);
                if (!m.ShouldPullSpecificFund())
                    throw new Exception("Must be a single fund OnlineGiving organization");
                SetHeaders(m);
                var pf = PaymentForm.CreatePaymentForm(m);
                pf.AmtToPay = null;
                pf.Type = pf.NoCreditCardsAllowed ? "B" : "C";
                pf.First = null;
                pf.Last = null;
                pf.Email = null;
                var p = m.List[0];
                if(pf.ShowCampusOnePageGiving)
                    pf.Campuses = p.Campuses().ToList();
                var funds = p.Funds();
                pf.Description = funds[0].Text;

            #if DEBUG
                pf.First = "Otis";
                pf.Last = "Sukamotis";
                pf.Email = "*****@*****.**";
                pf.Address = "135 Riveredge Cv";
                pf.Zip = "";
                pf.CreditCard = "3111111111111111";
                pf.Expires = "1018";
                pf.CVV = "123";
                pf.AmtToPay = 23M;
            #endif
                SetInstructions(m);

                return View("OnePageGiving/Index", pf);
            }
            catch (Exception ex)
            {
                if (ex is BadRegistrationException)
                    return Message(ex.Message);
                throw;
            }
        }