コード例 #1
0
        public static decimal GetFeesForBounty(IBillingProcessor processor, decimal Bounty)
        {
            decimal fees;
            decimal netBountyFloored;
            decimal bountyChange;

            fees = processor.GetProcessingFeesForAmount(Bounty);
            fees += Billing.ComputeVigForAmount(Bounty);

            decimal netBounty = Bounty - fees;

            if (netBounty <= 1)
            {
                fees = .50m;
            }
            else if (netBounty <= 2)
            {
                fees = 1.0m;
            }
            else
            {
                fees = Math.Ceiling(fees);
                //netBountyFloored = Math.Floor(netBounty);
                //bountyChange = netBounty - netBountyFloored;
                //fees += (1.0m - bountyChange); // get us down to the nearest whole dollar
            }

            return fees;
        }
コード例 #2
0
 public OrderProcessor(ILogger <OrderProcessor> logger, IBillingProcessor billingProcessor, ICustomerProcessor customerProcessor, INotifier notifier)
 {
     _logger            = logger;
     _billingProcessor  = billingProcessor;
     _customerProcessor = customerProcessor;
     _notifier          = notifier;
 }
コード例 #3
0
 public Commerce5(IBillingProcessor billingProcessor, ICustomerProcessor customer, INotificationProcessor notifier, ILoggingProcessor logger)
 {
     _BillingProcessor = billingProcessor;
     _Customer = customer;
     _Notifier = notifier;
     _Logger = logger;
 }
コード例 #4
0
ファイル: BillingService.svc.cs プロジェクト: fwka1605/next
 public BillingService(
     IAuthorizationProcessor authorizationProcessor,
     IBillingProcessor billingProcessor,
     IBillingSaveProcessor billingSaveProcessor,
     IBillingSaveForInputProcessor billingSaveForInputProcessor,
     IBillingJournalizingProcessor billingJournalizingProcessor,
     IBillingSearchProcessor billingSearchProcessor,
     IBillingMemoProcessor billingMemoProcessor,
     IBillingDueAtModifyProcessor billingDueAtModifyProcessor,
     IBillingDiscountProcessor billingDiscountProcessor,
     IBillingImporterProcessor billingImporterProcessor,
     IBillingScheduledPaymentProcessor billingScheduledPaymentProcessor,
     IBillingAccountTransferProcessor billingAccountTransferProcessor,
     ILogManager logManager)
 {
     this.authorizationProcessor           = authorizationProcessor;
     this.billingProcessor                 = billingProcessor;
     this.billingSaveProcessor             = billingSaveProcessor;
     this.billingSaveForInputProcessor     = billingSaveForInputProcessor;
     this.billingJournalizingProcessor     = billingJournalizingProcessor;
     this.billingSearchProcessor           = billingSearchProcessor;
     this.billingMemoProcessor             = billingMemoProcessor;
     this.billingDueAtModifyProcessor      = billingDueAtModifyProcessor;
     this.billingDiscountProcessor         = billingDiscountProcessor;
     this.billingImporterProcessor         = billingImporterProcessor;
     this.billingScheduledPaymentProcessor = billingScheduledPaymentProcessor;
     this.billingAccountTransferProcessor  = billingAccountTransferProcessor;
     logger = logManager.GetLogger(typeof(BillingService));
 }
コード例 #5
0
ファイル: Commerce.cs プロジェクト: tleviathan/DeepDiveIntoDI
 public Commerce(IBillingProcessor billingProcessor, ICustomer customer, INotifier notifier, ILogger logger)
 {
     _BillingProcessor = billingProcessor;
     _Customer = customer;
     _Notifier = notifier;
     _Logger = logger;
 }
コード例 #6
0
 public Commerce5(IBillingProcessor billingProcessor, ICustomerProcessor customer, INotificationProcessor notifier, ILoggingProcessor logger)
 {
     _billingProcessor = billingProcessor;
     _customer         = customer;
     _notifier         = notifier;
     _logger           = logger;
 }
コード例 #7
0
 public Commerce(IBillingProcessor billingProcessor, ICustomer customer, INotifier notifier, ILogger logger)
 {
     _billingProcessor = billingProcessor;
     _customer         = customer;
     _notifier         = notifier;
     _logger           = logger;
 }
コード例 #8
0
 public void InjectDependent(IBillingProcessor billingProcessor,
                             ICustomer customer, INotifier notifier, ILogger logger)
 {
     this._BillingProcessor = billingProcessor;
     this._Customer         = customer;
     this._Notifier         = notifier;
     this._Logger           = logger;
 }
コード例 #9
0
ファイル: ECommerce.cs プロジェクト: qinfengzhu/dI.Hook
 public ECommerce(IBillingProcessor billingProcessor,
                  ICustomer customer,
                  INotifier notifier)
 {
     _BillingProcessor = billingProcessor;
     _Customer         = customer;
     _Notifier         = notifier;
 }
コード例 #10
0
ファイル: OrderProcessor.cs プロジェクト: Balhir/DiTutorial
 public OrderProcessor(
     ICustomerProcessor customerProcessor,
     IBillingProcessor billingProcessor,
     INotifier notifier)
 {
     _customerProcessor = customerProcessor;
     _billingProcessor  = billingProcessor;
     _notifier          = notifier;
 }
コード例 #11
0
        public void ProcessOrder(OrderInfo orderInfo)
        {
            IBillingProcessor billingProcessor = _BillingProcessorFactory.GetBillingProcessor();

            billingProcessor.ProcessPayment(orderInfo.CustomerName, orderInfo.CreditCard, orderInfo.Price);
            _Logger.Log("Billing processed");
            _Customer.UpdateCustomerOrder(orderInfo.CustomerName, orderInfo.Product);
            _Logger.Log("Customer updated");
            _Notifier.SendReceipt(orderInfo);
            _Logger.Log("Receipt sent");
        }
コード例 #12
0
        /// <summary>constructor</summary>
        public BillingFileImportProcessor(
            ICompanyProcessor companyProcessor,
            IApplicationControlProcessor applicationControlProcessor,
            IImporterSettingProcessor importerSettingProcessor,
            IImporterSettingDetailProcessor importerSettingDetailProcessor,
            IGeneralSettingProcessor generalSettingProcessor,
            ICurrencyProcessor currencyProcessor,
            ICategoryProcessor categoryProcessor,
            ICustomerProcessor customerProcessor,
            IJuridicalPersonalityProcessor juridicalPersonalityProcessor,
            ITaxClassProcessor taxClassProcessor,
            IHolidayCalendarProcessor holidayCalendarProcessor,
            ICollationSettingProcessor collationSettingProcessor,
            IColumnNameSettingProcessor columnNameSettingProcessor,
            IDepartmentProcessor departmentProcessor,
            IAccountTitleProcessor accountTitleProcessor,
            IStaffProcessor staffProcessor,
            IInvoiceCommonSettingProcessor invoiceCommonSettingProcessor,
            IImportDataProcessor importDataProcessor,

            IBillingProcessor billingProcessor,
            IBillingImporterProcessor billingImporterProcessor,
            IBillingDivisionContractProcessor billingDivisionContractProcessor
            )
        {
            this.companyProcessor               = companyProcessor;
            this.applicationControlProcessor    = applicationControlProcessor;
            this.importerSettingProcessor       = importerSettingProcessor;
            this.importerSettingDetailProcessor = importerSettingDetailProcessor;
            this.generalSettingProcessor        = generalSettingProcessor;
            this.currencyProcessor              = currencyProcessor;
            this.categoryProcessor              = categoryProcessor;
            this.customerProcessor              = customerProcessor;
            this.juridicalPersonalityProcessor  = juridicalPersonalityProcessor;
            this.taxClassProcessor              = taxClassProcessor;
            this.holidayCalendarProcessor       = holidayCalendarProcessor;
            this.collationSettingProcessor      = collationSettingProcessor;
            this.columnNameSettingProcessor     = columnNameSettingProcessor;
            this.departmentProcessor            = departmentProcessor;
            this.accountTitleProcessor          = accountTitleProcessor;
            this.staffProcessor = staffProcessor;
            this.invoiceCommonSettingProcessor = invoiceCommonSettingProcessor;
            this.importDataProcessor           = importDataProcessor;

            this.billingProcessor                 = billingProcessor;
            this.billingImporterProcessor         = billingImporterProcessor;
            this.billingDivisionContractProcessor = billingDivisionContractProcessor;

            serializer = MessagePackSerializer.Get <BillingImport>(new SerializationContext {
                DefaultDateTimeConversionMethod = DateTimeConversionMethod.Native
            });
        }
コード例 #13
0
        public void ProcessOrder(OrderInfo orderInfo)
        {
            IBillingProcessor      billingProcessor      = _ProcessorLocator.GetProcessor <IBillingProcessor>();
            ICustomerProcessor     customerProcessor     = _ProcessorLocator.GetProcessor <ICustomerProcessor>();
            INotificationProcessor notificationProcessor = _ProcessorLocator.GetProcessor <INotificationProcessor>();
            ILoggingProcessor      loggingProcessor      = _ProcessorLocator.GetProcessor <ILoggingProcessor>();

            billingProcessor.ProcessPayment(orderInfo.CustomerName, orderInfo.CreditCard, orderInfo.Price);
            loggingProcessor.Log("Billing processed");
            customerProcessor.UpdateCustomerOrder(orderInfo.CustomerName, orderInfo.Product);
            loggingProcessor.Log("Customer updated");
            notificationProcessor.SendReceipt(orderInfo);
            loggingProcessor.Log("Receipt sent");
        }
コード例 #14
0
 public BillingInvoiceProcessor(
     IBillingInvoiceQueryProcessor billingInvoiceQueryProcessor,
     IBillingInputProcessor billingInputProcessor,
     IBillingProcessor billingProcessor,
     IInvoiceNumberSettingProcessor invoiceNumberSettingProcessor,
     IInvoiceNumberHistoryProcessor invoiceNumberHistoryProcessor,
     IInvoiceCommonSettingProcessor invoiceCommonSettingProcessor,
     ITransactionScopeBuilder transactionScopeBuilder
     )
 {
     this.billingInvoiceQueryProcessor  = billingInvoiceQueryProcessor;
     this.billingInputProcessor         = billingInputProcessor;
     this.billingProcessor              = billingProcessor;
     this.invoiceNumberSettingProcessor = invoiceNumberSettingProcessor;
     this.invoiceNumberHistoryProcessor = invoiceNumberHistoryProcessor;
     this.invoiceCommonSettingProcessor = invoiceCommonSettingProcessor;
     this.transactionScopeBuilder       = transactionScopeBuilder;
 }
コード例 #15
0
ファイル: MFBillingProcessor.cs プロジェクト: fwka1605/next
 public MFBillingProcessor(IBillingProcessor billingProcessor,
                           ICustomerProcessor customerProcessor,
                           IStaffProcessor staffProcessor,
                           IBillingSaveProcessor billingSaveProcessor,
                           IMFBillingQueryProcessor mfBillingQueryProcessor,
                           IAddMFBillingQueryProcessor addMFBillingQueryProcessor,
                           IByCompanyGetEntitiesQueryProcessor <MFBilling> mfBillingByCompanyGetEntitiesQueryProcessor,
                           ITransactionScopeBuilder transactionScopeBuilder
                           )
 {
     this.billingProcessor           = billingProcessor;
     this.customerProcessor          = customerProcessor;
     this.staffProcessor             = staffProcessor;
     this.billingSaveProcessor       = billingSaveProcessor;
     this.mfBillingQueryProcessor    = mfBillingQueryProcessor;
     this.addMFBillingQueryProcessor = addMFBillingQueryProcessor;
     this.mfBillingByCompanyGetEntitiesQueryProcessor = mfBillingByCompanyGetEntitiesQueryProcessor;
     this.transactionScopeBuilder = transactionScopeBuilder;
 }
コード例 #16
0
ファイル: BillingController.cs プロジェクト: fwka1605/next
        /// <summary>constructor</summary>
        public BillingController(
            IBillingProcessor billingProcessor,
            IBillingSaveProcessor billingSaveProcessor,
            IBillingSaveForInputProcessor billingSaveForInputProcessor,
            IBillingJournalizingProcessor billingJournalizingProcessor,
            IBillingSearchProcessor billingSearchProcessor,
            IBillingMemoProcessor billingMemoProcessor,
            IBillingDueAtModifyProcessor billingDueAtModifyProcessor,
            IBillingDivisionContractProcessor billingDivisionContractProcessor,
            IBillingDiscountProcessor billingDiscountProcessor,
            IBillingScheduledPaymentProcessor billingScheduledPaymentProcessor,
            IBillingAccountTransferProcessor billingAccountTransferProcessor,
            IImporterSettingDetailProcessor importerSettingDetailProcessor,
            ICustomerProcessor customerProcessor,

            IBillingFileImportProcessor billingFileImportProcessor,
            IPaymentScheduleFileImportProcessor paymentScheduleFileImportProcessor,

            IBillingAccountTransferFileImportProcessor billingAccountTransferFileImportProcessor
            )
        {
            this.billingProcessor                 = billingProcessor;
            this.billingSaveProcessor             = billingSaveProcessor;
            this.billingSaveForInputProcessor     = billingSaveForInputProcessor;
            this.billingJournalizingProcessor     = billingJournalizingProcessor;
            this.billingSearchProcessor           = billingSearchProcessor;
            this.billingMemoProcessor             = billingMemoProcessor;
            this.billingDueAtModifyProcessor      = billingDueAtModifyProcessor;
            this.billingDivisionContractProcessor = billingDivisionContractProcessor;
            this.billingDiscountProcessor         = billingDiscountProcessor;
            this.billingScheduledPaymentProcessor = billingScheduledPaymentProcessor;
            this.billingAccountTransferProcessor  = billingAccountTransferProcessor;
            this.importerSettingDetailProcessor   = importerSettingDetailProcessor;
            this.customerProcessor                = customerProcessor;


            this.billingFileImportProcessor         = billingFileImportProcessor;
            this.paymentScheduleFileImportProcessor = paymentScheduleFileImportProcessor;

            this.billingAccountTransferFileImportProcessor = billingAccountTransferFileImportProcessor;
        }
コード例 #17
0
 public BillingImporterProcessor(
     IBillingImporterCodeToIdSolveProcessor billingImporterCodeToIdSolveProcessor,
     IBillingProcessor billingProcessor,
     IBillingSaveProcessor billingSaveProcessor,
     IImporterSettingDetailQueryProcessor importerSettingDetailQueryProcessor,
     ICategoryByCodeQueryProcessor categoryByCodeQueryProcessor,
     IIdenticalEntityGetByIdsQueryProcessor <Category> categoryIdenticalEntityGetByIdsQueryProcessor,
     ICustomerQueryProcessor customerQueryProcessor,
     IAddCustomerQueryProcessor addCustomerQueryProcessor,
     IUpdateCustomerQueryProcessor updateCustomerQueryProcessor,
     IBillingSearchForImportQueryProcessor billingSearchForImportQueryProcessor,
     IUpdateBillingQueryProcessor updatebillingQueryProcessor,
     IBillingDivisionContractQueryProcessor billingDivisionContractQueryProcessor,
     IUpdateBillingDivisionContractQueryProcessor updateBillingDivisionContractQueryProcessor,
     IByCompanyGetEntityQueryProcessor <BillingDivisionSetting> billingDivisionSettingQueryProcessor,
     IAddBillingDivisionContractQueryProcessor addBillingDivisionContractQueryProcessor,
     ICustomerDiscountQueryProcessor customerDiscountQueryProcessor,
     IAddBillingDiscountQueryProcessor addBillingDiscountQueryProcessor,
     ITransactionScopeBuilder transactionScopeBuilder
     )
 {
     this.billingImporterCodeToIdSolveProcessor = billingImporterCodeToIdSolveProcessor;
     this.billingProcessor     = billingProcessor;
     this.billingSaveProcessor = billingSaveProcessor;
     this.importerSettingDetailQueryProcessor           = importerSettingDetailQueryProcessor;
     this.categoryByCodeQueryProcessor                  = categoryByCodeQueryProcessor;
     this.categoryIdenticalEntityGetByIdsQueryProcessor = categoryIdenticalEntityGetByIdsQueryProcessor;
     this.customerQueryProcessor                      = customerQueryProcessor;
     this.addCustomerQueryProcessor                   = addCustomerQueryProcessor;
     this.updateCustomerQueryProcessor                = updateCustomerQueryProcessor;
     this.billingSearchForImportQueryProcessor        = billingSearchForImportQueryProcessor;
     this.updatebillingQueryProcessor                 = updatebillingQueryProcessor;
     this.billingDivisionContractQueryProcessor       = billingDivisionContractQueryProcessor;
     this.updateBillingDivisionContractQueryProcessor = updateBillingDivisionContractQueryProcessor;
     this.billingDivisionSettingQueryProcessor        = billingDivisionSettingQueryProcessor;
     this.addBillingDivisionContractQueryProcessor    = addBillingDivisionContractQueryProcessor;
     this.customerDiscountQueryProcessor              = customerDiscountQueryProcessor;
     this.addBillingDiscountQueryProcessor            = addBillingDiscountQueryProcessor;
     this.transactionScopeBuilder                     = transactionScopeBuilder;
 }
コード例 #18
0
ファイル: BillingSaveProcessor.cs プロジェクト: fwka1605/next
 public BillingSaveProcessor(
     IBillingProcessor billingProcessor,
     IBillingQueryProcessor billingQueryProcessor,
     IAddBillingQueryProcessor addBillingQueryProcessor,
     IUpdateBillingQueryProcessor updatebillingQueryProcessor,
     ITransactionalGetByIdsQueryProcessor <Billing> billingGetByIdsQueryProcessor,
     IAddBillingInputQueryProcessor addBillingInputQueryProcessor,
     IBillingMemoProcessor billingMemoProcessor,
     ICustomerDiscountQueryProcessor customerDiscountQueryProcessor,
     IDeleteBillingDiscountQueryProcessor deleteBillingDiscountQueryProcessor,
     IAddBillingDiscountQueryProcessor addBillingDiscountQueryProcessor,
     IByCompanyGetEntityQueryProcessor <BillingDivisionSetting> billingDivisionSettingQueryProcessor,
     IBillingDivisionContractQueryProcessor billingDivisionContractQueryProcessor,
     IAddBillingDivisionContractQueryProcessor addBillingDivisionContractQueryProcessor,
     IUpdateBillingDivisionContractQueryProcessor updateBillingDivisionContractQueryProcessor,
     IDeleteBillingDivisionContractQueryProcessor deleteBillingDivisionContractQueryProcessor,
     IByCompanyGetEntityQueryProcessor <ApplicationControl> applicationControlQueryProcessor,
     ITransactionScopeBuilder transactionScopeBuilder
     )
 {
     this.billingProcessor                            = billingProcessor;
     this.billingQueryProcessor                       = billingQueryProcessor;
     this.addBillingQueryProcessor                    = addBillingQueryProcessor;
     this.updatebillingQueryProcessor                 = updatebillingQueryProcessor;
     this.billingGetByIdsQueryProcessor               = billingGetByIdsQueryProcessor;
     this.addBillingInputQueryProcessor               = addBillingInputQueryProcessor;
     this.billingMemoProcessor                        = billingMemoProcessor;
     this.customerDiscountQueryProcessor              = customerDiscountQueryProcessor;
     this.deleteBillingDiscountQueryProcessor         = deleteBillingDiscountQueryProcessor;
     this.addBillingDiscountQueryProcessor            = addBillingDiscountQueryProcessor;
     this.billingDivisionSettingQueryProcessor        = billingDivisionSettingQueryProcessor;
     this.billingDivisionContractQueryProcessor       = billingDivisionContractQueryProcessor;
     this.addBillingDivisionContractQueryProcessor    = addBillingDivisionContractQueryProcessor;
     this.updateBillingDivisionContractQueryProcessor = updateBillingDivisionContractQueryProcessor;
     this.deleteBillingDivisionContractQueryProcessor = deleteBillingDivisionContractQueryProcessor;
     this.applicationControlQueryProcessor            = applicationControlQueryProcessor;
     this.transactionScopeBuilder                     = transactionScopeBuilder;
 }
コード例 #19
0
        public void ProcessOrder(OrderInfo orderInfo)
        {
            IBillingProcessor      billingProcessor      = _processorLocator.GetProcessor <IBillingProcessor>();
            ICustomerProcessor     customerProcessor     = _processorLocator.GetProcessor <ICustomerProcessor>();
            INotificationProcessor notificationProcessor = _processorLocator.GetProcessor <INotificationProcessor>();
            ILoggingProcessor      loggingProcessor      = _processorLocator.GetProcessor <ILoggingProcessor>();

            billingProcessor.ProcessPayment(orderInfo.CustomerName, orderInfo.CreditCard, orderInfo.Price);
            loggingProcessor.Log("Billing processed");
            customerProcessor.UpdateCustomerOrder(orderInfo.CustomerName, orderInfo.Product);
            loggingProcessor.Log("Customer updated");
            notificationProcessor.SendReceipt(orderInfo);
            loggingProcessor.Log("Receipt sent");


            // Named Instance
            _plugin.DoSomething();

            // Regular Usage
            //foreach (IPostOrderPlugin plugin in _Plugins)
            //{
            //    plugin.DoSomething();
            //}
        }
コード例 #20
0
 public Commerce(IBillingProcessor billingProcessor, ICustomerProcessor customerProcessor, INotifier notifier)
 {
     this.billingProcessor  = billingProcessor;
     this.customerProcessor = customerProcessor;
     this.notifier          = notifier;
 }
コード例 #21
0
 public BillingProxy(PaymentMethod paymentMethod)
 {
     _paymentMethod = paymentMethod;
     _processor     = new BillingProcessor();
 }