public ActionResult Index(int?id, bool?testing, string email, bool?login, string registertag, bool?showfamily, int?goerid, int?gsid, string source)
        {
            Response.NoCache();
            try
            {
                var m = new OnlineRegModel(Request, id, testing, email, login, source);
                if (m.org != null && m.org.IsMissionTrip == true)
                {
                    m.PrepareMissionTrip(gsid, goerid);
                }

                SetHeaders(m);
                var pid = m.CheckRegisterLink(registertag);
                if (m.MissionTripSelfSupportPaylink.HasValue() && m.GoerId > 0)
                {
                    return(Redirect(m.MissionTripSelfSupportPaylink));
                }
                return(RouteRegistration(m, pid, showfamily));
            }
            catch (Exception ex)
            {
                if (ex is BadRegistrationException)
                {
                    return(Message(ex.Message));
                }
                throw;
            }
        }
Beispiel #2
0
        public ActionResult OnePageGiving(int id, bool?testing, string source)
        {
            Response.NoCache();
            try
            {
                var m = new OnlineRegModel(Request, id, testing, null, null, source);

                var pid = Util.UserPeopleId;
                if (pid.HasValue)
                {
                    PrePopulate(m, pid.Value);
                }

                SetHeaders(m);
                m.CheckRegisterLink(null);

                var pf = PaymentForm.CreatePaymentForm(m);
                pf.AmtToPay = null;
                pf.Type     = pf.NoCreditCardsAllowed ? "B" : "C";

#if DEBUG
                if (!pid.HasValue)
                {
                    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

                var p = m.List[0];
                if (pf.ShowCampusOnePageGiving)
                {
                    pf.Campuses = p.Campuses().ToList();
                }

                var designatedFund = p.DesignatedDonationFund().FirstOrDefault();
                pf.Description = designatedFund != null ? designatedFund.Text : m.DescriptionForPayment;

                SetInstructions(m);

                return(View("OnePageGiving/Index", new OnePageGivingModel()
                {
                    OnlineRegPersonModel = m.List[0], PaymentForm = pf
                }));
            }
            catch (Exception ex)
            {
                if (ex is BadRegistrationException)
                {
                    return(Message(ex.Message));
                }
                throw;
            }
        }
Beispiel #3
0
        public ActionResult Index(int?id, bool?testing, string email, bool?login, string registertag, bool?showfamily, int?goerid, int?gsid, string source)
        {
            Response.NoCache();
            try
            {
                var m = new OnlineRegModel(Request, CurrentDatabase, id, testing, email, login, source);

                if (m.ManageGiving())
                {
                    Session["Campus"]       = Request.QueryString["campus"];
                    Session["DefaultFunds"] = Request.QueryString["funds"];
                    m.Campus       = Session["Campus"]?.ToString();
                    m.DefaultFunds = Session["DefaultFunds"]?.ToString();
                }

                if (m.org != null && m.org.IsMissionTrip == true)
                {
                    if (gsid != null || goerid != null)
                    {
                        m.PrepareMissionTrip(gsid, goerid);
                    }
                }

                SetHeaders(m);
                var pid = m.CheckRegisterLink(registertag);
                if (m.NotActive())
                {
                    return(View("OnePageGiving/NotActive", m));
                }
                if (m.MissionTripSelfSupportPaylink.HasValue() && m.GoerId > 0)
                {
                    return(Redirect(m.MissionTripSelfSupportPaylink));
                }

                return(RouteRegistration(m, pid, showfamily));
            }
            catch (Exception ex)
            {
                if (ex is BadRegistrationException)
                {
                    return(Message(ex.Message));
                }

                throw;
            }
        }
Beispiel #4
0
        public ActionResult OnePageGiving(int id, bool?testing, string source)
        {
            Response.NoCache();
            try
            {
                var m = new OnlineRegModel(Request, CurrentDatabase, id, testing, null, null, source);

                var pid = Util.UserPeopleId;
                if (pid.HasValue)
                {
                    PrePopulate(m, pid.Value);
                }

                SetHeaders(m);
                m.CheckRegisterLink(null);

                if (m.NotActive())
                {
                    return(View("OnePageGiving/NotActive", m));
                }

                if ((m.org.IsMissionTrip.IsNotNull() && m.org.IsMissionTrip == true) ? true : false)
                {
                    m.ProcessType = PaymentProcessTypes.OneTimeGiving;
                }
                else
                {
                    m.ProcessType = (m.org.RegistrationTypeId.IsNull() || m.org.RegistrationTypeId == RegistrationTypeCode.OnlineGiving)
                        ? PaymentProcessTypes.OneTimeGiving
                        : PaymentProcessTypes.OnlineRegistration;
                }

                int?GatewayId = MultipleGatewayUtils.GatewayId(CurrentDatabase, m.ProcessType);

                if (GatewayId == (int)GatewayTypes.Pushpay && m.OnlineGiving())
                {
                    ViewBag.Header = "One Page Giving";
                    if (string.IsNullOrEmpty(MultipleGatewayUtils.Setting(CurrentDatabase, "PushpayMerchant", "", (int)m.ProcessType)))
                    {
                        return(View("OnePageGiving/NotConfigured"));
                    }

                    return(Redirect($"/Pushpay/OnePage"));
                }

                var pf = PaymentForm.CreatePaymentForm(m);
                pf.AmtToPay = null;

                if (string.IsNullOrWhiteSpace(pf.Type))
                {
                    pf.Type = pf.NoCreditCardsAllowed ? "B" : "C";
                }

#if DEBUG
                if (!pid.HasValue)
                {
                    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

                var p = m.List[0];
                if (pf.ShowCampusOnePageGiving)
                {
                    pf.Campuses = p.Campuses().ToList();
                }

                var designatedFund = p.DesignatedDonationFund().FirstOrDefault();
                pf.Description = designatedFund != null ? designatedFund.Text : m.DescriptionForPayment;

                SetInstructions(m);

                return(View("OnePageGiving/Index", new OnePageGivingModel()
                {
                    OnlineRegPersonModel = m.List[0], PaymentForm = pf
                }));
            }
            catch (Exception ex)
            {
                if (ex is BadRegistrationException)
                {
                    return(Message(ex.Message));
                }
                throw;
            }
        }
        public ActionResult Index(int?id, bool?testing, string email, bool?login, string registertag, bool?showfamily, int?goerid, int?gsid, string source, int?pledgeFund)
        {
            Response.NoCache();

            var m             = new OnlineRegModel(Request, CurrentDatabase, id, testing, email, login, source);
            var isMissionTrip = (m.org?.IsMissionTrip).GetValueOrDefault();

            if (isMissionTrip)
            {
                m.ProcessType = PaymentProcessTypes.OnlineRegistration;
            }
            else
            {
                AssignPaymentProcessType(ref m);
            }

            if (pledgeFund != null)
            {
                m.pledgeFundId = pledgeFund.Value;
            }

            SetHeaders(m);

            int?GatewayId       = MultipleGatewayUtils.GatewayId(CurrentDatabase, m.ProcessType);
            var gatewayRequired = (m.PayAmount() > 0 || m.ProcessType == PaymentProcessTypes.OneTimeGiving || m.ProcessType == PaymentProcessTypes.RecurringGiving);

            if (GatewayId.IsNull() && gatewayRequired)
            {
                return(View("OnePageGiving/NotConfigured"));
            }

            if ((int)GatewayTypes.Pushpay == GatewayId && string.IsNullOrEmpty(MultipleGatewayUtils.Setting(CurrentDatabase, "PushpayMerchant", "", (int)m.ProcessType)))
            {
                ViewBag.Header       = m.Header;
                ViewBag.Instructions = m.Instructions;
                return(View("OnePageGiving/NotConfigured"));
            }

            if (m.ManageGiving())
            {
                Session[$"Campus-{m.Orgid}"] =
                    m.Campus            = Request.QueryString["campus"];
                Session["DefaultFunds"] = Request.QueryString["funds"];
                m.DefaultFunds          = Session["DefaultFunds"]?.ToString();
            }

            if (isMissionTrip)
            {
                if (gsid != null || goerid != null)
                {
                    m.PrepareMissionTrip(gsid, goerid);
                }
            }

            var pid = m.CheckRegisterLink(registertag);

            if (m.NotActive())
            {
                return(View("OnePageGiving/NotActive", m));
            }
            if (m.MissionTripSelfSupportPaylink.HasValue() && m.GoerId > 0)
            {
                return(Redirect(m.MissionTripSelfSupportPaylink));
            }

            return(RouteRegistration(m, pid, showfamily));
        }