public async Task <IActionResult> GetByAddressAsync([Required, RowKey] string walletAddress) { IPaymentRequest paymentRequest = await _paymentRequestService.FindAsync(walletAddress); if (paymentRequest == null) { return(NotFound(ErrorResponse.Create("Couldn't find payment request by wallet address"))); } var model = Mapper.Map <PaymentRequestModel>(paymentRequest); return(Ok(model)); }
public async Task <IActionResult> GetPaymentRequest(Guid id) { try { var paymentRequest = await _paymentRequestService.FindAsync(id); if (paymentRequest == null) { return(NotFound(new { Message = "Payment request not found" })); } _log.LogInformation("Payment requested", paymentRequest.Id); return(Ok(paymentRequest)); } catch (Exception e) { _log.LogError("Error during payment requesting", e); throw; } }