public void Pay(decimal amount, string customerId, string orderId, string paymentMethod) { switch (paymentMethod) { case "check": var checkTransaction = PaymentTransaction.With(paymentMethod, amount, orderId); _transactionRepo.Save(checkTransaction); break; case "card": _paymentProvider.AuthorisePayment(amount, orderId, paymentMethod, customerId); var cardTransaction = PaymentTransaction.With(paymentMethod, amount, orderId); _transactionRepo.Save(cardTransaction); break; case "direct-debit": _paymentProvider.AuthorisePayment(amount, orderId, paymentMethod, customerId); var directDebitTransaction = PaymentTransaction.With(paymentMethod, amount, orderId); _transactionRepo.Save(directDebitTransaction); break; } var orderConfirmationEmail = _emailGateway.NewEmailFor(orderId, customerId, paymentMethod); _emailGateway.Send(orderConfirmationEmail); }
public void save_deposit() { _repo.Save(new Deposit(100, "2012/03/12")); _transactions = _repo.Statement(); Assert.That(_transactions.Count(), Is.Not.Zero); }
public void Deposit(decimal amount, string date) { _transactionRepo.Save(new Deposit(amount, date)); }