Exemplo n.º 1
0
        public SageGateway(CMSDataContext db, bool testing, PaymentProcessTypes ProcessType)
        {
            this.db = db;
            var gatewayTesting = MultipleGatewayUtils.GatewayTesting(db, ProcessType);

            if (testing || gatewayTesting)
            {
                _id           = "856423594649";
                _key          = "M5Q4C9P2T4N5";
                _originatorId = "1111111111";
            }
            else
            {
                _id  = MultipleGatewayUtils.Setting(db, "M_ID", "", (int)ProcessType);
                _key = MultipleGatewayUtils.Setting(db, "M_KEY", "", (int)ProcessType);

                if (string.IsNullOrWhiteSpace(_id))
                {
                    throw new Exception("M_ID setting not found, which is required for Sage.");
                }
                if (string.IsNullOrWhiteSpace(_key))
                {
                    throw new Exception("M_KEY setting not found, which is required for Sage.");
                }

                _originatorId = MultipleGatewayUtils.Setting(db, "SageOriginatorId", "", (int)ProcessType);
            }
        }
Exemplo n.º 2
0
        public AcceptivaGateway(CMSDataContext db, bool testing, PaymentProcessTypes ProcessType)
        {
            this.db          = db;
            this.ProcessType = ProcessType;

            if (testing || MultipleGatewayUtils.GatewayTesting(db, ProcessType))
            {
                _apiKey       = "CZDWp7dXCo4W3xTA7LtWAijidvPdj2wa";
                _merch_ach_id = "dKdDFtqC";
                _merch_cc_id  = "R6MLUevR";
                _isTesting    = true;
                //If this setting exists we settle transactions manually, so we can refund.
                //For live environment settlements are automatic 1 day later
                _automaticSettle = db.Setting("AutomaticSettle");
            }
            else
            {
                _apiKey       = MultipleGatewayUtils.Setting(db, "AcceptivaApiKey", "", (int)ProcessType);
                _merch_ach_id = MultipleGatewayUtils.Setting(db, "AcceptivaAchId", "", (int)ProcessType);
                _merch_cc_id  = MultipleGatewayUtils.Setting(db, "AcceptivaCCId", "", (int)ProcessType);

                if (string.IsNullOrWhiteSpace(_apiKey))
                {
                    throw new Exception("AcceptivaApiKey setting not found, which is required for Acceptiva.");
                }
                if (string.IsNullOrWhiteSpace(_merch_ach_id))
                {
                    throw new Exception("AcceptivaAcctId setting not found, which is required for Acceptiva.");
                }
                if (string.IsNullOrWhiteSpace(_merch_cc_id))
                {
                    throw new Exception("AcceptivaCCId setting not found, which is required for Acceptiva.");
                }
            }
        }
Exemplo n.º 3
0
        public AuthorizeNetGateway(CMSDataContext db, bool testing, PaymentProcessTypes ProcessType)
        {
            this.db = db;
            IsLive  = !(testing || MultipleGatewayUtils.GatewayTesting(db, ProcessType));
            if (!IsLive)
            {
                _login = "******";
                _key   = "9wE4j7M372ehz6Fy";
            }
            else
            {
                _login = MultipleGatewayUtils.Setting(db, "x_login", "", (int)ProcessType);
                _key   = MultipleGatewayUtils.Setting(db, "x_tran_key", "", (int)ProcessType);

                if (string.IsNullOrWhiteSpace(_login))
                {
                    throw new Exception("x_login setting not found, which is required for Authorize.net.");
                }

                if (string.IsNullOrWhiteSpace(_key))
                {
                    throw new Exception("x_tran_key setting not found, which is required for Authorize.net.");
                }
            }
        }
Exemplo n.º 4
0
        public BluePayGateway(CMSDataContext db, bool testing, PaymentProcessTypes ProcessType)
        {
            this.db = db;
            IsLive  = !(testing || MultipleGatewayUtils.GatewayTesting(db, ProcessType));

            _login = MultipleGatewayUtils.Setting(db, "bluepay_accountId", "", (int)ProcessType);
            _key   = MultipleGatewayUtils.Setting(db, "bluepay_secretKey", "", (int)ProcessType);

            if (string.IsNullOrWhiteSpace(_login))
            {
                throw new Exception("bluepay_accountId setting not found, which is required for BluePay.");
            }

            if (string.IsNullOrWhiteSpace(_key))
            {
                throw new Exception("bluepay_secretKey setting not found, which is required for BluePay.");
            }
        }
Exemplo n.º 5
0
        public TransNationalGateway(CMSDataContext db, bool testing, PaymentProcessTypes ProcessType)
        {
            this.db = db;

            if (testing || MultipleGatewayUtils.GatewayTesting(db, ProcessType))
            {
                _userName = "******";
                _password = "******";
            }
            else
            {
                _userName = MultipleGatewayUtils.Setting(db, "TNBUsername", "", (int)ProcessType);
                _password = MultipleGatewayUtils.Setting(db, "TNBPassword", "", (int)ProcessType);

                if (string.IsNullOrWhiteSpace(_userName))
                {
                    throw new Exception("TNBUsername setting not found, which is required for TransNational.");
                }
                if (string.IsNullOrWhiteSpace(_password))
                {
                    throw new Exception("TNBPassword setting not found, which is required for TransNational.");
                }
            }
        }
Exemplo n.º 6
0
 private bool CheckIfIsGatewayTesting(bool testing, PaymentProcessTypes processType)
 {
     return(testing || MultipleGatewayUtils.GatewayTesting(CurrentDatabase, ProcessType));
 }