public async Task <TransactionResult> CreateTransactionAsync(BankTransaction transaction) { var result = await _instrumentor.ApplyAsync( () => _instrumentedBankRepository.CreateTransactionAsync(transaction), nameof(InstrumentedBankRepository)); return(result); }
public async Task <TransactionResult> CreateTransaction(BankTransaction bankTransaction) { var transactionResult = await _bankRepository.CreateTransactionAsync(bankTransaction); _logger.Write(LogLevel.Information, $"{EventCodes.BankTransactionCreated} - TransactionId: {transactionResult.TransactionId}, TransactionStatus: {transactionResult.TransactionStatus}"); var payment = GetPaymentRecordFromBankTransaction(transactionResult, bankTransaction); await _paymentsRepository.AddPaymentAsync(payment); return(transactionResult); }