Esempio n. 1
0
        public PushpayController(IRequestManager requestManager) : base(requestManager)
        {
            PaymentProcessTypes processType = PaymentProcessTypes.OneTimeGiving;

            try
            {
                processType = (PaymentProcessTypes)requestManager.CurrentHttpContext.Session["PaymentProcessType"];
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }


            _pushpay = new PushpayConnection(
                CurrentDatabase.GetSetting("PushPayAccessToken", ""),
                CurrentDatabase.GetSetting("PushPayRefreshToken", ""),
                CurrentDatabase,
                Configuration.Current.PushpayAPIBaseUrl,
                Configuration.Current.PushpayClientID,
                Configuration.Current.PushpayClientSecret,
                Configuration.Current.OAuth2TokenEndpoint,
                Configuration.Current.TouchpointAuthServer,
                Configuration.Current.OAuth2AuthorizeEndpoint);
            _pushpayPayment = new PushpayPayment(_pushpay, CurrentDatabase, processType);
            _resolver       = new PushpayResolver(_pushpay, CurrentDatabase);

            _merchantHandle = _pushpayPayment._merchantHandle;
            _givingLink     = $"{Configuration.Current.PushpayGivingLinkBase}/{_merchantHandle}";
        }
Esempio n. 2
0
        public PushpayController(IRequestManager requestManager) : base(requestManager)
        {
            PaymentProcessTypes processType = PaymentProcessTypes.OneTimeGiving;

            try
            {
                processType = (PaymentProcessTypes)int.Parse(requestManager.SessionProvider.Get <string>("PaymentProcessType"));
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }


            _pushpay = new PushpayConnection(
                CurrentDatabase.GetSetting("PushPayAccessToken", ""),
                CurrentDatabase.GetSetting("PushPayRefreshToken", ""),
                CurrentDatabase,
                Configuration.Current.PushpayAPIBaseUrl,
                Configuration.Current.PushpayClientID,
                Configuration.Current.PushpayClientSecret,
                Configuration.Current.OAuth2TokenEndpoint,
                Configuration.Current.TouchpointAuthServer,
                Configuration.Current.OAuth2AuthorizeEndpoint);

            _pushpayPayment        = new PushpayPayment(_pushpay, CurrentDatabase, processType);
            _resolver              = new PushpayResolver(_pushpay, CurrentDatabase);
            _defaultMerchantHandle = _pushpayPayment._defaultMerchantHandle;
            _givingLink            = Configuration.Current.PushpayGivingLinkBase;
            _state = CurrentDatabase.Host;

            isTesting = MultipleGatewayUtils.Setting(CurrentDatabase, "GatewayTesting", (int)processType);
            if (isTesting)
            {
                _ru = "touchpointest";
            }
            else
            {
                _ru = Configuration.Current.PushpayRU;
            }
        }
Esempio n. 3
0
        public ActionResult OneTimeGift(int?id)
        {
            // check for one time gift campus route mapping.
            if (id.HasValue)
            {
                var setting = $"OneTimeGiftCampusRoute-{id}";
                var route   = CurrentDatabase.GetSetting(setting, string.Empty);
                if (!string.IsNullOrWhiteSpace(route))
                {
                    return(Redirect($"/{route}"));
                }
            }

            var oid = CmsData.API.APIContribution.OneTimeGiftOrgId(CurrentDatabase);

            if (oid > 0)
            {
                return(Redirect("/OnlineReg/" + oid));
            }

            return(new EmptyResult());
        }
Esempio n. 4
0
        private bool HideDeceasedFromFamily(bool isAdminFamily)
        {
            var hide = Convert.ToBoolean(CurrentDatabase.GetSetting("HideDeceasedFromFamily", "false"));

            return(Util.IsInRole("Admin") && !isAdminFamily ? false: hide);
        }