Exemple #1
0
        public void Withdraw(string requestId, decimal amount)
        {
            if (amount <= 0)
            {
                throw new ArgumentException($"The amount to withdraw must be greater than 0.");
            }

            var transaction = new AccountTransaction(
                requestId,
                AccountTransactionType.DEPOSIT,
                AccountTransactionStatus.PENDING,
                amount
                );

            transactions.Add(transaction);
        }
Exemple #2
0
        public AccountTransaction CreatePendingDepositTransaction(string requestId, decimal amount)
        {
            if (amount <= 0)
            {
                throw new ArgumentException($"The amount to deposit must be greater than 0.");
            }

            var transaction = new AccountTransaction(
                requestId,
                AccountTransactionType.DEPOSIT,
                AccountTransactionStatus.PENDING,
                amount
                );

            transactions.Add(transaction);
            return(transaction);
        }