Esempio n. 1
0
        /// <summary>
        /// Get Payment By Identifiers
        /// </summary>
        /// <param name="paymentId"></param>
        /// <returns></returns>
        Task <RetrievePaymentDetailOutput> IPaymentReadRepository.GetPaymenDetailById(PaymentId paymentId)
        {
            RetrievePaymentDetailOutput result = null;

            var p = AllPaymentQuery.FirstOrDefault(x => x.PaymentId == paymentId.ToGuid());

            if (p is null)
            {
                return(Task.FromResult(result));
            }

            result = new RetrievePaymentDetailOutput()
            {
                PaymentId = p.PaymentId,
                Card      = new CardDto()
                {
                    CardNumber     = p.Card.CardHint,
                    ExpirationDate = p.Card.ExpirationDate,
                    CVV            = p.Card.CVV
                },
                Amount           = p.Amount,
                Currency         = p.Currency.ToString(),
                BeneficiaryAlias = p.BeneficiaryAlias,
                Status           = p.Status.ToString(),
                PaymentDate      = p.CreateDate,
            };

            return(Task.FromResult(result));
        }
Esempio n. 2
0
 private PaymentEntity GetPaymentById(PaymentId paymentId)
 {
     return(AllPaymentQuery.FirstOrDefault(p => p.PaymentId == paymentId.ToGuid()));
 }