Example #1
0
        public ActionResult <string> Get(int id)
        {
            var payment = _paymentsRepository.GetPaymentById(id);

            if (payment == null)
            {
                return(NoContent());
            }
            return(Ok(payment));
        }
Example #2
0
        public async Task <PaymentResponse> GetPaymentById(string id)
        {
            if (string.IsNullOrEmpty(id))
            {
                return(null);
            }

            try
            {
                var payment = await _paymentsRepo.GetPaymentById(id);

                return(_mapper.Map <PaymentResponse>(payment));
            }
            catch (Exception e)
            {
                return(null);
            }
        }