Ejemplo n.º 1
0
        public BillingEventHandler(
            IBillingEventService billingEventService,
            IBalanceService balanceService,
            IBillingChargeService billingChargeService,
            IBillingEventLogService billingEventLogService,
            ICompanyService companyService,
            IEmailNotificationService notificationService)
        {
            _billingEventService = billingEventService;
            _balanceService = balanceService;
            _billingChargeService = billingChargeService;
            _billingEventLogService = billingEventLogService;
            _companyService = companyService;
            _notificationService = notificationService;

            _eventHandlers = new Dictionary<EventType, Func<DomainEvent, Task>>
            {
                { EventType.ChargeFailed, ChargeFailedAsync },
                { EventType.ChargeRefunded, ChargeRefundedAsync },
                { EventType.ChargeSucceeded, ChargeSucceededAsync },
            };
        }
Ejemplo n.º 2
0
        public BillingEventHandler(
            IBillingEventService billingEventService,
            IBalanceService balanceService,
            IBillingChargeService billingChargeService,
            IBillingEventLogService billingEventLogService,
            ICompanyService companyService,
            IEmailNotificationService notificationService)
        {
            _billingEventService    = billingEventService;
            _balanceService         = balanceService;
            _billingChargeService   = billingChargeService;
            _billingEventLogService = billingEventLogService;
            _companyService         = companyService;
            _notificationService    = notificationService;

            _eventHandlers = new Dictionary <EventType, Func <DomainEvent, Task> >
            {
                { EventType.ChargeFailed, ChargeFailedAsync },
                { EventType.ChargeRefunded, ChargeRefundedAsync },
                { EventType.ChargeSucceeded, ChargeSucceededAsync },
            };
        }