Exemple #1
0
 public POSCreditOrder(Cart cart, Customer customer, CreditCardPaymentDetails paymentDetails)
     : base(cart, customer)
 {
     this.paymentDetails     = paymentDetails;
     this.reservationService = new ReservationService();
     this.paymentProcessor   = new PaymentProcessor();
 }
Exemple #2
0
            /// <summary>
            /// Make reversal/void a payment.
            /// </summary>
            /// <param name="amount">The amount.</param>
            /// <param name="currency">The currency.</param>
            /// <param name="paymentProperties">The payment properties of the authorization response.</param>
            /// <param name="extensionTransactionProperties">Optional extension transaction properties.</param>
            /// <returns>A task that can await until the void has completed.</returns>
            public Task <PaymentInfo> VoidPaymentAsync(decimal amount, string currency, PaymentProperty[] paymentProperties, ExtensionTransaction extensionTransactionProperties)
            {
                if (amount < this.terminalSettings.MinimumAmountAllowed)
                {
                    throw new CardPaymentException(CardPaymentException.AmountLessThanMinimumLimit, "Amount does not meet minimum amount allowed.");
                }

                if (this.processor == null)
                {
                    this.processor = CardPaymentManager.GetPaymentProcessor(this.merchantProperties, this.paymentConnectorName);
                }

                if (this.terminalSettings.MaximumAmountAllowed > 0 && amount > this.terminalSettings.MaximumAmountAllowed)
                {
                    throw new CardPaymentException(CardPaymentException.AmountExceedsMaximumLimit, "Amount exceeds the maximum amount allowed.");
                }

                PaymentInfo paymentInfo = new PaymentInfo();

                // Handle multiple chain connectors by returning single instance used in capture.
                IPaymentProcessor currentProcessor = null;

                PaymentProperty[] currentMerchantProperties = null;
                CardPaymentManager.GetRequiredConnector(this.merchantProperties, paymentProperties, this.processor, out currentProcessor, out currentMerchantProperties);

                Request  request  = CardPaymentManager.GetCaptureRequest(currentMerchantProperties, paymentProperties, amount, currency, this.terminalSettings.Locale, this.isTestMode, this.terminalSettings.TerminalId, cardCache, extensionTransactionProperties);
                Response response = currentProcessor.Void(request);

                CardPaymentManager.MapVoidResponse(response, paymentInfo);

                return(Task.FromResult(paymentInfo));
            }
        public IPaymentProcessor CreateProcessor(RequestTypes requestTypes)
        {
            IPaymentProcessor paymentProcessor = null;

            switch (requestTypes)

            {
            case RequestTypes.Books:
            {
                paymentProcessor = new BookProcessor(_logger, _componentSupplier.GetComponents());
                break;
            }

            case RequestTypes.MemberShips:
            {
                paymentProcessor = new MemberShipProcessor(_logger, _componentSupplier.GetComponents());
                break;
            }

            case RequestTypes.UpgradeMemberShip:
            {
                paymentProcessor = new UpgradeMemberShipProcesor(_logger, _componentSupplier.GetComponents());
                break;
            }

            case RequestTypes.PhysicalProduct:
            {
                paymentProcessor = new PhysicalProductProcessor(_logger, _componentSupplier.GetComponents());
                break;
            }
            }


            return(paymentProcessor);
        }
 public OrderManager(IShippingProcessor shippingProcessor, IPaymentProcessor paymentProcessor,
                     IProductStockRepository productStockRepository)
 {
     this._shippingProcessor      = shippingProcessor;
     this._paymentProcessor       = paymentProcessor;
     this._productStockRepository = productStockRepository;
 }
 public PaymentController(IHostingEnvironment hostingEnvironment, IOptions <PaymentConfiguration> paymentConfiguration, IPaymentProcessor paymentProcessor, ILogger <PaymentController> logger)
 {
     m_HostingEnvironment   = hostingEnvironment;
     m_PaymentConfiguration = paymentConfiguration.Value;
     m_PaymentProcessor     = paymentProcessor;
     m_Logger = logger;
 }
 public ReleaseRemainingEventHandler(
     IPaymentProcessor paymentProcessor,
     IOrderGroupFactory orderGroupFactory)
 {
     _paymentProcessor  = paymentProcessor ?? throw new ArgumentNullException(nameof(paymentProcessor));
     _orderGroupFactory = orderGroupFactory ?? throw new ArgumentNullException(nameof(orderGroupFactory));
 }
 public void SetUp()
 {
     mocker = new AutoMoqer();
     levyPaymentProcessorMock       = mocker.GetMock <ILevyPaymentProcessor>(MockBehavior.Strict);
     coInvestedPaymentProcessorMock = mocker.GetMock <ICoInvestedPaymentProcessor>(MockBehavior.Strict);
     processor = mocker.Resolve <PaymentProcessor>();
 }
        public ConfigurationProviderFactory(ILogger logger)
        {
            var config = ConfigurationManager.GetSection("commerceApp") as CommerceAppConfigurationSection;

            if (config?.PaymentProcessor.Type != null &&
                config.CustomerNotifier.Type != null)
            {
                _paymentProcessor = Activator.CreateInstance(Type.GetType(config.PaymentProcessor.Type)) as IPaymentProcessor;
                _customerNotifier = Activator.CreateInstance(Type.GetType(config.CustomerNotifier.Type)) as ICustomerNotifier;
                if (_customerNotifier != null)
                {
                    _customerNotifier.FromAddress = config.CustomerNotifier.FromAddress;
                    _customerNotifier.SmtpServer  = config.CustomerNotifier.SmtpServer;
                }

                _events = new CommerceAppExtensionPoints();
                foreach (CommerceAppModuleElement element in config.Modules)
                {
                    ICommerceModule module = Activator.CreateInstance(Type.GetType(element.Type)) as ICommerceModule;
                    module.Initialize(_events);
                }
            }
            else
            {
                logger.Log("Incorrect configurations in App.config.");
            }
        }
 public ChargeCardService(IPaymentProcessor paymentProcessor, ICountryRepository countryRepository, IStateRepository stateRepository, ISettings settings)
 {
     _paymentProcessor  = paymentProcessor;
     _stateRepository   = stateRepository;
     _countryRepository = countryRepository;
     _settings          = settings;
 }
 public OrderControllerBase(
     IOrderRepository orderRepository
     , IOrderGroupFactory orderGroupFactory
     , IOrderGroupCalculator orderGroupCalculator
     , IContentLoader contentLoader
     , ILineItemCalculator lineItemCalculator
     , IPlacedPriceProcessor placedPriceProcessor
     , IInventoryProcessor inventoryProcessor
     , ILineItemValidator lineItemValidator
     , IPromotionEngine promotionEngine
     , ICurrentMarket currentMarket
     , IPaymentProcessor paymentProcessor)
 {
     _orderRepository      = orderRepository;
     _orderGroupFactory    = orderGroupFactory;
     _orderGroupCalculator = orderGroupCalculator;
     _contentLoader        = contentLoader;
     _promotionEngine      = promotionEngine;
     _lineItemCalculator   = lineItemCalculator;
     _inventoryProcessor   = inventoryProcessor;
     _lineItemValidator    = lineItemValidator;
     _placedPriceProcessor = placedPriceProcessor;
     _currentMarket        = currentMarket;
     _paymentProcessor     = paymentProcessor;
 }
Exemple #11
0
 public Handler(IMediator mediator, IDbContext dbContext, IMapper mapper, IPaymentProcessor paymentProcessor)
 {
     _mediator         = mediator;
     _dbContext        = dbContext;
     _mapper           = mapper;
     _paymentProcessor = paymentProcessor;
 }
 public OnlineOrder(Refactored.Cart cart, PaymentDetails paymentDetails) : base(cart)
 {
     _notificationService = new NotificationService();
     _paymentDeatils      = paymentDetails;
     _paymentProcessor    = new PaymentProcessor();
     _reservationService  = new ReservationService();
 }
Exemple #13
0
 public CafeShop(IOrderProcessor orderProcessor, IPaymentProcessor paymentProcessor)
 {
     coffeeSelection       = new List <Coffee>();
     customerList          = new List <Customer>();
     this.orderProcessor   = orderProcessor;
     this.paymentProcessor = paymentProcessor;
 }
        public CheckoutService(
            IAddressBookService addressBookService,
            IOrderGroupFactory orderGroupFactory,
            IOrderGroupCalculator orderGroupCalculator,
            IPaymentProcessor paymentProcessor,
            IOrderRepository orderRepository,
            IContentRepository contentRepository,
            LocalizationService localizationService,
            IMailService mailService,
            IPromotionEngine promotionEngine,
            ILoyaltyService loyaltyService)
        {
            _addressBookService   = addressBookService;
            _orderGroupFactory    = orderGroupFactory;
            _orderGroupCalculator = orderGroupCalculator;
            _paymentProcessor     = paymentProcessor;
            _orderRepository      = orderRepository;
            _contentRepository    = contentRepository;
            _customerContext      = CustomerContext.Current;
            _localizationService  = localizationService;
            _mailService          = mailService;
            _promotionEngine      = promotionEngine;
            _loyaltyService       = loyaltyService;

            AuthenticatedPurchaseValidation = new AuthenticatedPurchaseValidation(_localizationService);
            AnonymousPurchaseValidation     = new AnonymousPurchaseValidation(_localizationService);
            CheckoutAddressHandling         = new CheckoutAddressHandling(_addressBookService);
        }
 public CommerceManager(IStoreRepository storeRepository, IConfigurationFactory configurationFactory)
 {
     _StoreRepository  = storeRepository;
     _PaymentProcessor = configurationFactory.GetPaymentProcessor();
     _Mailer           = configurationFactory.GetMailer();
     _CommerceEvents   = configurationFactory.GetEvents();
 }
 public CheckoutControllerForTest(
     IContentRepository contentRepository,
     IMailService mailService,
     LocalizationService localizationService,
     ICurrencyService currencyService,
     ControllerExceptionHandler controllerExceptionHandler,
     CustomerContextFacade customerContextFacade,
     IOrderRepository orderRepository,
     CheckoutViewModelFactory checkoutViewModelFactory,
     IOrderGroupCalculator orderGroupCalculator,
     IPaymentProcessor paymentProcessor,
     IPromotionEngine promotionEngine,
     ICartService cartService,
     IAddressBookService addressBookService,
     OrderSummaryViewModelFactory orderSummaryViewModelFactory,
     IOrderFactory orderFactory
     )
     : base(contentRepository,
            mailService,
            localizationService,
            currencyService,
            controllerExceptionHandler,
            customerContextFacade,
            orderRepository,
            checkoutViewModelFactory,
            orderGroupCalculator,
            paymentProcessor,
            promotionEngine,
            cartService,
            addressBookService,
            orderSummaryViewModelFactory,
            orderFactory)
 {
 }
 public OrderManager(IProductStockRepository productStockRepository,
                     IPaymentProcessor paymentProcessor, IShippingProcessor shippingProcessor)
 {
     _productStockRepository = productStockRepository;
     _paymentProcessor       = paymentProcessor;
     _shippingProcessor      = shippingProcessor;
 }
Exemple #18
0
        public CheckoutService(
            IAddressBookService addressBookService,
            IOrderGroupFactory orderGroupFactory,
            IOrderGroupCalculator orderGroupCalculator,
            IPaymentProcessor paymentProcessor,
            IOrderRepository orderRepository,
            IContentRepository contentRepository,
            CustomerContextFacade customerContext,
            LocalizationService localizationService,
            IMailService mailService,
            ICartService cartService)
        {
            _addressBookService   = addressBookService;
            _orderGroupFactory    = orderGroupFactory;
            _orderGroupCalculator = orderGroupCalculator;
            _paymentProcessor     = paymentProcessor;
            _orderRepository      = orderRepository;
            _contentRepository    = contentRepository;
            _customerContext      = customerContext;
            _localizationService  = localizationService;
            _mailService          = mailService;
            _cartService          = cartService;

            AuthenticatedPurchaseValidation = new AuthenticatedPurchaseValidation(_localizationService);
            AnonymousPurchaseValidation     = new AnonymousPurchaseValidation(_localizationService);
            CheckoutAddressHandling         = new CheckoutAddressHandling(_addressBookService);
        }
 public CheckoutController(IContentRepository contentRepository,
                           IMailService mailService,
                           LocalizationService localizationService,
                           ICurrencyService currencyService,
                           ControllerExceptionHandler controllerExceptionHandler,
                           CustomerContextFacade customerContextFacade,
                           IOrderRepository orderRepository,
                           CheckoutViewModelFactory checkoutViewModelFactory,
                           IOrderGroupCalculator orderGroupCalculator,
                           IPaymentProcessor paymentProcessor,
                           IPromotionEngine promotionEngine,
                           ICartService cartService,
                           IAddressBookService addressBookService,
                           OrderSummaryViewModelFactory orderSummaryViewModelFactory,
                           IOrderFactory orderFactory)
 {
     _contentRepository            = contentRepository;
     _mailService                  = mailService;
     _localizationService          = localizationService;
     _currencyService              = currencyService;
     _controllerExceptionHandler   = controllerExceptionHandler;
     _customerContext              = customerContextFacade;
     _orderRepository              = orderRepository;
     _checkoutViewModelFactory     = checkoutViewModelFactory;
     _orderGroupCalculator         = orderGroupCalculator;
     _paymentProcessor             = paymentProcessor;
     _promotionEngine              = promotionEngine;
     _cartService                  = cartService;
     _addressBookService           = addressBookService;
     _orderSummaryViewModelFactory = orderSummaryViewModelFactory;
     _orderFactory                 = orderFactory;
 }
 public PoSCreditOrder(Cart cart, PaymentDetails paymentDetails)
     : base(cart)
 {
     _paymentDetails   = paymentDetails;
     _paymentProcessor = new PaymentProcessor();
     _paymentTypeList  = new LinkedList <string>();
 }
Exemple #21
0
 public ECheckService(ICountryRepository countryRepository, IStateRepository stateRepository, ISettings settings)
 {
     _authorizeNetPaymentGateway = new AuthorizeNetECheckPaymentGateway();
     _countryRepository          = countryRepository;
     _stateRepository            = stateRepository;
     _settings = settings;
 }
 public RequiredLevyAmountFundingSourceService(
     IPaymentProcessor processor,
     IMapper mapper,
     IDataCache <CalculatedRequiredLevyAmount> requiredPaymentsCache,
     ILevyFundingSourceRepository levyFundingSourceRepository,
     ILevyBalanceService levyBalanceService,
     IPaymentLogger paymentLogger,
     IDataCache <bool> monthEndCache,
     IDataCache <LevyAccountModel> levyAccountCache,
     IDataCache <List <EmployerProviderPriorityModel> > employerProviderPriorities,
     IDataCache <List <string> > refundSortKeysCache,
     IDataCache <List <TransferPaymentSortKeyModel> > transferPaymentSortKeysCache,
     IDataCache <List <RequiredPaymentSortKeyModel> > requiredPaymentSortKeysCache,
     IGenerateSortedPaymentKeys generateSortedPaymentKeys)
 {
     this.processor                    = processor ?? throw new ArgumentNullException(nameof(processor));
     this.mapper                       = mapper ?? throw new ArgumentNullException(nameof(mapper));
     this.requiredPaymentsCache        = requiredPaymentsCache ?? throw new ArgumentNullException(nameof(requiredPaymentsCache));
     this.levyFundingSourceRepository  = levyFundingSourceRepository ?? throw new ArgumentNullException(nameof(levyFundingSourceRepository));
     this.levyBalanceService           = levyBalanceService ?? throw new ArgumentNullException(nameof(levyBalanceService));
     this.paymentLogger                = paymentLogger ?? throw new ArgumentNullException(nameof(paymentLogger));
     this.monthEndCache                = monthEndCache ?? throw new ArgumentNullException(nameof(monthEndCache));
     this.levyAccountCache             = levyAccountCache ?? throw new ArgumentNullException(nameof(levyAccountCache));
     this.employerProviderPriorities   = employerProviderPriorities ?? throw new ArgumentNullException(nameof(employerProviderPriorities));
     this.refundSortKeysCache          = refundSortKeysCache ?? throw new ArgumentNullException(nameof(refundSortKeysCache));
     this.transferPaymentSortKeysCache = transferPaymentSortKeysCache ?? throw new ArgumentNullException(nameof(transferPaymentSortKeysCache));
     this.requiredPaymentSortKeysCache = requiredPaymentSortKeysCache ?? throw new ArgumentNullException(nameof(requiredPaymentSortKeysCache));
     this.generateSortedPaymentKeys    = generateSortedPaymentKeys ?? throw new ArgumentNullException(nameof(generateSortedPaymentKeys));
 }
 public OrderCancelledEventHandler(
     IPaymentProcessor paymentProcessor,
     IOrderGroupFactory orderGroupFactory)
 {
     _paymentProcessor  = paymentProcessor ?? throw new ArgumentNullException(nameof(paymentProcessor));
     _orderGroupFactory = orderGroupFactory ?? throw new ArgumentNullException(nameof(orderGroupFactory));
 }
Exemple #24
0
        public void CheckPaymentGatewayisConfiguredornot()
        {
            DependencyRegistrar.RegisterDependencies();


            IPaymentProcessor paymentProcessor = IoC.Resolve <IPaymentProcessor>();

            paymentProcessor.ChargeCreditCard(new CreditCardProcessorProcessingInfo
            {
                CreditCardNo      = "4007000000027",
                SecurityCode      = "211",
                ExpiryMonth       = 12,
                ExpiryYear        = 2012,
                CardType          = "Visa",
                Price             = "12",
                FirstName         = "Bidhan",
                LastName          = "Bidhan",
                BillingAddress    = "My Address",
                BillingCity       = "Austin",
                BillingState      = "Texas",
                BillingPostalCode = "78705",
                BillingCountry    = "US",
                Email             = "mail.email.com",
                IpAddress         = "198.172.10.10",
                Currency          = "USD",
                OrderId           = "123456789"
            });
        }
Exemple #25
0
            /// <summary>
            /// Make authorization payment.
            /// </summary>
            /// <param name="amount">The amount.</param>
            /// <param name="currency">The currency.</param>
            /// <param name="voiceAuthorization">The voice approval code (optional).</param>
            /// <param name="isManualEntry">If manual credit card entry is required.</param>
            /// <param name="extensionTransactionProperties">Optional extension transaction properties.</param>
            /// <returns>A task that can await until the authorization has completed.</returns>
            public async Task <PaymentInfo> AuthorizePaymentAsync(decimal amount, string currency, string voiceAuthorization, bool isManualEntry, ExtensionTransaction extensionTransactionProperties)
            {
                if (amount < this.terminalSettings.MinimumAmountAllowed)
                {
                    throw new CardPaymentException(CardPaymentException.AmountLessThanMinimumLimit, "Amount does not meet minimum amount allowed.");
                }

                if (this.terminalSettings.MaximumAmountAllowed > 0 && amount > this.terminalSettings.MaximumAmountAllowed)
                {
                    throw new CardPaymentException(CardPaymentException.AmountExceedsMaximumLimit, "Amount exceeds the maximum amount allowed.");
                }

                if (this.processor == null)
                {
                    this.processor = CardPaymentManager.GetPaymentProcessor(this.merchantProperties, this.paymentConnectorName);
                }

                PaymentInfo paymentInfo = new PaymentInfo();

                // Get tender
                TenderInfo maskedTenderInfo = await this.GetTenderAsync(true);

                if (maskedTenderInfo == null)
                {
                    return(paymentInfo);
                }

                paymentInfo.CardNumberMasked = maskedTenderInfo.CardNumber;
                paymentInfo.CashbackAmount   = maskedTenderInfo.CashBackAmount;
                paymentInfo.CardType         = (Microsoft.Dynamics.Commerce.HardwareStation.CardPayment.CardType)maskedTenderInfo.CardTypeId;

                if (paymentInfo.CashbackAmount > this.terminalSettings.DebitCashbackLimit)
                {
                    throw new CardPaymentException(CardPaymentException.CashbackAmountExceedsLimit, "Cashback amount exceeds the maximum amount allowed.");
                }

                // Authorize
                Response response = CardPaymentManager.ChainedAuthorizationCall(this.processor, this.merchantProperties, this.tenderInfo, amount, currency, this.terminalSettings.Locale, this.isTestMode, this.terminalSettings.TerminalId, extensionTransactionProperties);

                Guid cardStorageKey = Guid.NewGuid();

                CardPaymentManager.MapAuthorizeResponse(response, paymentInfo, cardStorageKey, this.terminalSettings.TerminalId);

                if (paymentInfo.IsApproved)
                {
                    // Backup credit card number
                    TemporaryCardMemoryStorage <string> cardStorage = new TemporaryCardMemoryStorage <string>(DateTime.UtcNow, this.tenderInfo.CardNumber);
                    cardStorage.StorageInfo = paymentInfo.PaymentSdkData;
                    cardCache.Add(cardStorageKey, cardStorage);

                    // need signature?
                    if (this.terminalSettings.SignatureCaptureMinimumAmount < paymentInfo.ApprovedAmount)
                    {
                        paymentInfo.SignatureData = await this.RequestTenderApprovalAsync(paymentInfo.ApprovedAmount);
                    }
                }

                return(paymentInfo);
            }
Exemple #26
0
 public OnlineOrder(Cart cart, PaymentDetails paymentDetails)
     : base(cart)
 {
     this.paymentDetails      = paymentDetails;
     this.paymentProcessor    = new PaymentProcessor();
     this.reservationService  = new ReservationService();
     this.notificationService = new NotificationService();
 }
        // GET api/counter
        public async Task <long> Get()
        {
            IPaymentProcessor counter = ServiceProxy.Create <IPaymentProcessor>(new Uri("fabric:/BankingAssociation.Payment/PaymentProcessor"), new ServicePartitionKey(0));

            long count = await counter.Get();

            return(count);
        }
 public OrderController(IVideoRepository videos, IOrderRepository orders,
                         IUserRepository users, IPaymentProcessor processor)
 {
     _videosRepository = videos;
     _usersRepository = users;
     _ordersRepository = orders;
     _paymentProcessor = processor;
 }
Exemple #29
0
 public void Order(Cart cart, PaymentDetails paymentDetails, INotifyCustomer notifyCustomer, IReserveInventory reserveInventory, IPaymentProcessor paymentProcessor)
 {
     _cart             = cart;
     _paymentDetails   = paymentDetails;
     _notifyCustomer   = notifyCustomer;
     _reserveInventory = reserveInventory;
     _paymentProcessor = paymentProcessor;
 }
 public PaymentCommandHandler(IPaymentProcessor paymentProcessor,
                              PaymentCommandValidator paymentCommandValidator,
                              IPaymentCommandRepository paymentCommandRepository)
 {
     _paymentProcessor         = paymentProcessor;
     _paymentCommandValidator  = paymentCommandValidator;
     _paymentCommandRepository = paymentCommandRepository;
 }
 public OnlineOrder(Cart cart, PaymentDetails paymentDetails)
     : base(cart)
 {
     _paymentDetails = paymentDetails;
     _paymentProcessor = new PaymentProcessor();
     _reservationService = new ReservationService();
     _notificationService = new NotificationService();
 }
Exemple #32
0
 public PaymentsController(UserManager <User> userManager, IPaymentProcessor paymentProcessor,
                           IPaymentsService paymentsService, IPaymentDetailsDtoFactory detailsDtoFactory)
 {
     _userManager       = userManager;
     _paymentProcessor  = paymentProcessor;
     _paymentsService   = paymentsService;
     _detailsDtoFactory = detailsDtoFactory;
 }
Exemple #33
0
 public MainWindow()
 {
     InitializeComponent();
     productRepo = new JsonProductRepository();
     notification = new NotificationService();
     paymentProcessor = new MikesProcessor();
     orderRepo = new OrderItemRepository();
     ActiveCart = new Cart(orderRepo);
     ListProductsInCatalog(productRepo);
 }
        public PaymentManager(IPoolConfig poolConfig,  IBlockProcessor blockProcessor, IBlockAccounter blockAccounter, IPaymentProcessor paymentProcessor)
        {
            _poolConfig = poolConfig;
            _labors = new List<IPaymentLabor>
            {
                blockProcessor,
                blockAccounter, 
                paymentProcessor
            };

            _logger = Log.ForContext<PaymentManager>().ForContext("Component", poolConfig.Coin.Name);

            if (!_poolConfig.Payments.Enabled) // make sure payments are enabled.
                return;

            // setup the timer to run payment laberos 
            _timer = new Timer(Run, null, _poolConfig.Payments.Interval * 1000, Timeout.Infinite);
        }
 public PayController()
 {
     var payWayString = System.Configuration.ConfigurationManager.AppSettings["PayWay"];
     PayWayEnum payEnum = (PayWayEnum)Enum.Parse(typeof(PayWayEnum), payWayString);
     _paymentProcessor = PayProcessorFactory.CreatePayProcessor(PayWayEnum.Alipay);
 }
Exemple #36
0
        private void InitManagers()
        {
            // init the algorithm
            _hashAlgorithm = _objectFactory.GetHashAlgorithm(Config.Coin.Algorithm);

            _storage = _objectFactory.GetStorage(Storages.Redis, Config);

            _paymentProcessor = _objectFactory.GetPaymentProcessor(Config.Coin.Name, _daemonClient, _storage, Config.Wallet);
            _paymentProcessor.Initialize(Config.Payments);

            _minerManager = _objectFactory.GetMiningManager(Config.Coin.Name, _daemonClient);

            _jobTracker = _objectFactory.GetJobTracker();

            _shareManager = _objectFactory.GetShareManager(Config.Coin.Name, _daemonClient, _jobTracker, _storage);

            _vardiffManager = _objectFactory.GetVardiffManager(Config.Coin.Name, _shareManager, Config.Stratum.Vardiff);

            _banningManager = _objectFactory.GetBanManager(Config.Coin.Name, _shareManager, Config.Banning);

            _jobManager = _objectFactory.GetJobManager(Config.Coin.Name, _daemonClient, _jobTracker, _shareManager, _minerManager,
                _hashAlgorithm, Config.Wallet, Config.Rewards);

            _jobManager.Initialize(InstanceId);

            var latestBlocks = _objectFactory.GetLatestBlocks(_storage);
            var blockStats = _objectFactory.GetBlockStats(latestBlocks, _storage);
            Statistics = _objectFactory.GetPerPoolStats(Config, _daemonClient, _minerManager, _hashAlgorithm, blockStats, _storage);
        }
        public IPaymentManager GetPaymentManager(IPoolConfig poolConfig, IBlockProcessor blockProcessor, IBlockAccounter blockAccounter, IPaymentProcessor paymentProcessor)
        {
            var @params = new NamedParameterOverloads
            {
                {"poolConfig", poolConfig},
                {"blockProcessor", blockProcessor},
                {"blockAccounter", blockAccounter},
                {"paymentProcessor", paymentProcessor}
            };

            return _applicationContext.Container.Resolve<IPaymentManager>(@params);
        }
Exemple #38
0
 public Order(INotificationService notificationService, Cart cart, IPaymentProcessor payment)
 {
     _notificationServce = notificationService;
     _paymentProcessor = payment;
     _cart = cart;
 }
 public PaymentProcessorFactory(IPaymentProcessor[] processors)
 {
     this.processors = processors;
 }
 public PoSCreditOrder(Cart cart, PaymentDetails paymentDetails)
     : base(cart)
 {
     this.paymentDetails = paymentDetails;
     this.paymentProcessor = new PaymentProcessor();
 }
 public Register(IPaymentProcessor paymentProcessor)
 {
     this.paymentProcessor = paymentProcessor;
 }
 public VendingMachine(IPaymentProcessor paymentProcessor)
 {
     this.paymentProcessor = paymentProcessor;
 }
 public CheckoutControllerForTest(
     IContentRepository contentRepository,
     IMailService mailService,
     LocalizationService localizationService,
     ICurrencyService currencyService,
     ControllerExceptionHandler controllerExceptionHandler,
     CustomerContextFacade customerContextFacade,
     IOrderRepository orderRepository,
     CheckoutViewModelFactory checkoutViewModelFactory,
     IOrderGroupCalculator orderGroupCalculator,
     IPaymentProcessor paymentProcessor,
     IPromotionEngine promotionEngine,
     ICartService cartService,
     IAddressBookService addressBookService,
     OrderSummaryViewModelFactory orderSummaryViewModelFactory,
     IOrderFactory orderFactory
     )
     : base(contentRepository,
           mailService,
           localizationService,
           currencyService,
           controllerExceptionHandler,
           customerContextFacade,
           orderRepository,
           checkoutViewModelFactory,
           orderGroupCalculator,
           paymentProcessor,
           promotionEngine,
           cartService,
           addressBookService,
           orderSummaryViewModelFactory,
           orderFactory)
 {
 }