Ejemplo n.º 1
0
        public async Task <IActionResult> GetPaymentDetails([FromBody] GetPaymentDetailsRequest paymentDetailsRequest)
        {
            _logger.LogInformation($"GetPaymentDetails requested");

            var res = await _paymentRepo.GetPaymentEntry(paymentDetailsRequest.PaymentIdentifier);

            if (res.Success)
            {
                if (res.PaymentEntry == null)
                {
                    return(NotFound());
                }
                else
                {
                    return(Ok(res.PaymentEntry.ConvertToPaymentDetails()));
                }
            }
            else
            {
                throw new Exception("Unable to fetch data.");
            }
        }