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); } }
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."); } } }
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."); } } }
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."); } }
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."); } } }
private bool CheckIfIsGatewayTesting(bool testing, PaymentProcessTypes processType) { return(testing || MultipleGatewayUtils.GatewayTesting(CurrentDatabase, ProcessType)); }