コード例 #1
0
        public CardTransaction WithdrawFromATM(decimal amount, string atmIdentifier)
        {
            var transaction     = BankAccount.CreatePayment(amount, atmIdentifier, "", "ATM Withdrawal");
            var cardTransaction = CardTransaction.Create(transaction, CardTransactionType.ATM);

            cardTransactions.Add(cardTransaction);
            return(cardTransaction);
        }
コード例 #2
0
        public CardTransaction MakePOSPayment(decimal amount, string destinationName, string destinationAccount)
        {
            var transaction     = BankAccount.CreatePayment(amount, destinationName, destinationAccount, "POS Payment");
            var cardTransaction = CardTransaction.Create(transaction, CardTransactionType.POS);

            cardTransactions.Add(cardTransaction);
            return(cardTransaction);
        }
コード例 #3
0
        public CardTransaction OnlinePayment(decimal amount, string destinationName, string destinationAccount, string cvv)
        {
            if (!CVV.Equals(cvv))
            {
                throw new CVVMismatchException(CVV, cvv);
            }

            var transaction     = BankAccount.CreatePayment(amount, destinationName, destinationAccount, "Online Payment");
            var cardTransaction = CardTransaction.Create(transaction, CardTransactionType.Online);

            cardTransactions.Add(cardTransaction);
            return(cardTransaction);
        }
コード例 #4
0
 public void Add(CardTransaction cardTransaction)
 {
     cardTransactions.Add(cardTransaction);
 }