示例#1
0
        public async Task <TransactionResult> CreateTransactionAsync(BankTransaction transaction)
        {
            var result = await _instrumentor.ApplyAsync(
                () => _instrumentedBankRepository.CreateTransactionAsync(transaction),
                nameof(InstrumentedBankRepository));

            return(result);
        }
示例#2
0
        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);
        }