Example #1
0
        static void Main(string[] args)
        {
            PaymentProcessingService paymentProcessingService = null;

            // Physical Product
            paymentProcessingService = GetPaymentProcessingServiceForPhysicalProduct();
            paymentProcessingService.ProcessPayment();

            // Book Product
            paymentProcessingService = GetPaymentProcessingServiceForBook();
            paymentProcessingService.ProcessPayment();

            // Membership Activation
            paymentProcessingService = GetPaymentProcessingServiceForMembershipActivation();
            paymentProcessingService.ProcessPayment();

            // Membership Upgradation
            paymentProcessingService = GetPaymentProcessingServiceForMembershipUpgradation();
            paymentProcessingService.ProcessPayment();

            // Video Product
            paymentProcessingService = GetPaymentProcessingServiceForVideo();
            paymentProcessingService.ProcessPayment();

            Console.ReadKey();
        }
Example #2
0
        public void PaymentProcessIntegrationTest()
        {
            PaymentDetailsDto paymentDetailsDto = new PaymentDetailsDto();

            paymentDetailsDto.ProductType = ProductEnum.PhysicalProduct;
            paymentDetailsDto.ProductDto  = new ProductDto
            {
                Price     = 1200,
                ProductId = 1
            };

            paymentDetailsDto.AgentDto = new AgentDto
            {
                AgentId   = 200,
                AgentName = "John Miller"
            };

            PaymentProcessingService paymentProcessingService = new PaymentProcessingService(paymentDetailsDto);

            paymentProcessingService.ProcessPayment();
        }