private Card GetOrCreateCard(ProcessPaymentRequest request, DateTime expiryDate) { var card = _cardDao.GetCardBasedOnNumberAndCVV(request.CardNumber, request.CardCvv); if (card == null) { card = new Card { Number = request.CardNumber, CVV = request.CardCvv, ExpiryDate = expiryDate }; _cardDao.InsertCardInfo(card); card = _cardDao.GetCardBasedOnNumberAndCVV(request.CardNumber, request.CardCvv); Logger.Info($"New card details added, CardId :{card.ID}"); return(card); } return(card); }
public Card GetCardBasedOnNumberAndCVV(string cardNumber, string cardCvv) { return(_cardDao.GetCardBasedOnNumberAndCVV(cardNumber, cardCvv)); }