Example #1
0
        public override void Review(CrankingEngineAccount account, Transaction lastTransaction)
        {
            int amountOfDeclines = 0;
            var transactions     = account.GetTransactions(_reviewtime, _fieldsToMatch, lastTransaction);

            foreach (var t in transactions)
            {
                if (t.declined)
                {
                    amountOfDeclines++;
                }
            }
            if (amountOfDeclines > _amountOfDeclines)
            {
                Rule rl = new Rule();
                rl.AddParameter("sourceId", new ParameterValue(lastTransaction.sourceId));
                RuleEngineAccountManager.AddRule(account._midTidId, rl);
            }
        }
        /// <summary>
        /// Loads account that has not been hit yet
        /// </summary>
        /// <param name="midTidId"></param>
        /// <returns></returns>
        public static CrankingEngineAccount LoadAccount(int midTidId)
        {
            var acc = new CrankingEngineAccount(midTidId);

            acc._retentionTime = FraudDetectionDefaults.retentionTime;
            acc.Init();

            //add common filters
            var en = FilterHelper.GetReviewFilters();

            while (en.MoveNext())
            {
                var filter = en.Current.Value();
                acc.AddReviewFilter(filter);
                filter.Init(acc);
            }
            acc.Normalize();
            _accounts[midTidId] = acc;
            return(acc);
        }
Example #3
0
 public abstract bool Review(CrankingEngineAccount account, Transaction tr);
Example #4
0
 public virtual void Init(CrankingEngineAccount account)
 {
 }
Example #5
0
 public abstract void Review(CrankingEngineAccount account, Transaction lastTransaction);