Example #1
0
        public bool ValIdatePayment(DataAccess.Quote entity, DataAccess.PayFastNotify payFast)
        {
            bool success = true;

            var totalAmount   = entity.QuoteDetails.Sum(a => a.SubscriptionTypeRuleAudit.AmountRand * a.Quantity);
            var payFastAmount = entity.PayFastNotifies.Sum(a => a.Amount_gross);

            if (payFastAmount != totalAmount)
            {
                success = false;
            }
            return(success);
        }
Example #2
0
        public async Task <SaveResult> UpdateStatus(
            DataAccess.PayFastNotify entity)
        {
            SaveResult saveResult  = new SaveResult();
            var        localentity = await _context.PayFastNotify.IgnoreQueryFilters().FirstOrDefaultAsync(a => a.Id == entity.Id);

            if (localentity == null)
            {
                throw new ArgumentNullException("PayFastUpdate");
            }
            localentity.Isprocessed = entity.Isprocessed;

            _context.PayFastNotify.Update(entity);
            await _context.SaveChangesAsync();

            saveResult.IsSuccess = true;

            return(saveResult);
        }