public IDataResult <Payment> GetByCustomerId(int customerId)
        {
            var findeks = _paymentDal.Get(f => f.CustomerId == customerId);

            if (findeks == null)
            {
                return(new ErrorDataResult <Payment>(Messages.NotFound));
            }

            return(new SuccessDataResult <Payment>(findeks));
        }
Exemplo n.º 2
0
        public IResult CheckPayment(CreditCard creditCard)
        {
            var result = _paymentDal.Get(c => c.CardNumber == creditCard.CardNumber);

            if (result != null)
            {
                result.CardBalance = result.CardBalance - creditCard.CardBalance;
                if (result.CardBalance < 0)
                {
                    return(new ErrorResult("Yeterli bakiye bulunmamaktadır."));
                }
                _paymentDal.CheckPayment(result);
                return(new SuccessResult());
            }
            return(new ErrorResult("Kart bulunamadı"));
        }
Exemplo n.º 3
0
 public IDataResult <Payment> GetById(int paymentId)
 {
     if (DateTime.Now.Hour == 6)
     {
         return(new ErrorDataResult <Payment>(Messages.MaintenanceTime));
     }
     return(new SuccessDataResult <Payment>(_paymentDal.Get(b => b.PaymentId == paymentId)));
 }
Exemplo n.º 4
0
        public IDataResult <CreditCard> GetById(int creditCardId)
        {
            var result = _paymentDal.Get(p => p.Id == creditCardId);

            if (result != null)
            {
                return(new SuccessDataResult <CreditCard>(result));
            }
            return(new ErrorDataResult <CreditCard>(result, PaymentMessages.FailedCardById));
        }
Exemplo n.º 5
0
        public IResult VerifyCard(CreditCard creditCard)
        {
            var result = _paymentDal.Get(c => c.NameOnTheCard == creditCard.NameOnTheCard && c.CardNumber == creditCard.CardNumber && c.CardCvv == creditCard.CardCvv);

            if (result == null)
            {
                return(new ErrorResult());
            }
            return(new SuccessResult());
        }
 public IDataResult <Payment> GetById(int id)
 {
     return(new SuccessDataResult <Payment>(_paymentDal.Get(p => p.PaymentId == id)));
 }
Exemplo n.º 7
0
 public IDataResult <Payment> Get(Payment payment)
 {
     return(new SuccessDataResult <Payment>(_paymentDal.Get(p => p.Id == payment.Id)));
 }
Exemplo n.º 8
0
 public IDataResult <Payment> Get(int paymentid)
 {
     return(new SuccessDataResult <Payment>(_paymentDal.Get(p => p.PaymentId == paymentid), Messages.PaymentIdListed));
 }
Exemplo n.º 9
0
 public Payment GetbyId(int id)
 {
     return(_paymentDal.Get(x => x.PaymentID == id));
 }
Exemplo n.º 10
0
 public IDataResult <Payment> Get(Payment entity)
 {
     return(new SuccessDataResult <Payment>(_paymentDal.Get(x => x.ID == entity.ID)));
 }
Exemplo n.º 11
0
 public IDataResult <Payment> GetById(int paymentId)
 {
     return(new SuccessDataResult <Payment>(_paymentDal.Get(b => b.Id == paymentId)));
 }
Exemplo n.º 12
0
 public IDataResult <Payment> GetById(int paymentId)
 {
     return(new SuccessDataResult <Payment>(_paymentDal.Get(p => p.PaymentId == paymentId), "Ödeme Id'ye göre ödemeler listelendi"));
 }
Exemplo n.º 13
0
 public IDataResult <Payment> GetById(int id)
 {
     return(new SuccessDataResult <Payment>(_fakeCardDal.Get(c => c.Id == id)));
 }
Exemplo n.º 14
0
 public IDataResult <Payment> GetByCustomerId(int customerId)
 {
     return(new SuccessDataResult <Payment>(_paymentDal.Get(p => p.CustomerId == customerId)));
 }
Exemplo n.º 15
0
 public IDataResult <Payment> GetByCardNumber(string cardNumber)
 {
     return(new SuccessDataResult <Payment>(_paymentDal.Get(p => p.CardNumber == cardNumber)));
 }