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); }