public async Task <PerformMoneyTransferResponseDto> PerformPayment(PerformPaymentRequestDto dto) { try { var paymentId = Guid.NewGuid().ToString(); var command = new RequestPaymentCommand( paymentId, dto.creditCardId, dto.orderId, dto.Amount ); await _messageSession.Send(command).ConfigureAwait(false); return(new PerformMoneyTransferResponseDto { Response = "OK" }); } catch (Exception ex) { return(new PerformMoneyTransferResponseDto { Response = "ERROR: " + ex.Message + " -- " + ex.StackTrace }); } }
public async Task <IActionResult> PerformPayment([FromBody] PerformPaymentRequestDto dto) { PerformMoneyTransferResponseDto response = await _transactionApplicationService.PerformPayment(dto); return(Ok(response)); }