示例#1
0
        public PaymentProcessor CreatePaymentProcessor()
        {
            IPaymentsDao         paymentsDao         = new PaymentsDao();
            ICreditCardProcessor creditCardProcessor = new CreditCardProcessor();
            IEftProcessor        eftProcessor        = new EftProcessor();

            CheckPaymentTypeHandler      checkHandler      = new CheckPaymentTypeHandler(paymentsDao);
            EftPaymentTypeHandler        eftPaymentHandler = new EftPaymentTypeHandler(eftProcessor, paymentsDao);
            CreditCardPaymentTypeHandler creditCardHandler = new CreditCardPaymentTypeHandler(creditCardProcessor, paymentsDao);

            PaymentProcessor paymentProcessor = new PaymentProcessor();

            paymentProcessor.AddPaymentHandler(creditCardHandler);
            paymentProcessor.AddPaymentHandler(eftPaymentHandler);
            paymentProcessor.AddPaymentHandler(checkHandler);


            return(paymentProcessor);
        }