public async Task MakeTransfer(ExternalTransferHelper transfer) { HttpClient client = new HttpClient(); var requestMessage = new HttpRequestMessage { Method = HttpMethod.Post, Content = new StringContent(JsonConvert.SerializeObject(transfer), Encoding.UTF8, "application/json"), RequestUri = new Uri(_configuration["SettlementUnitAddress"]) }; await client.SendAsync(requestMessage); }
public async Task PrepareTransfer(ExternalOperationModel operationModel) { var senderhelper = await _context.BankAccounts.Include(e => e.User).Where(e => e.Id == operationModel.TargetInternalAccountId).FirstOrDefaultAsync(); ExternalTransferHelper transferHelper = new ExternalTransferHelper() { Title = operationModel.Title, Date = operationModel.OperationDate, Value = operationModel.Value, SenderName = senderhelper.User.Name + " " + senderhelper.User.Secondname, RecipientName = operationModel.FullName, RecipientAccountNumber = operationModel.RecipientAccountNumber, SenderAccountNumber = senderhelper.AccountNumber }; await MakeTransfer(transferHelper); }