public OfflineDepositCommands(
     IPaymentRepository repository,
     IPaymentQueries paymentQueries,
     IEventBus eventBus,
     IPaymentSettingsValidator validator,
     IActorInfoProvider actorInfoProvider,
     IPlayerIdentityValidator identityValidator,
     IDocumentService documentsService,
     IOfflineDepositQueries offlineDepositQueries,
     IServiceBus serviceBus,
     IBonusApiProxy bonusApiProxy,
     IMessageTemplateService messageTemplateService)
 {
     _repository             = repository;
     _paymentQueries         = paymentQueries;
     _eventBus               = eventBus;
     _validator              = validator;
     _actorInfoProvider      = actorInfoProvider;
     _identityValidator      = identityValidator;
     _documentsService       = documentsService;
     _offlineDepositQueries  = offlineDepositQueries;
     _serviceBus             = serviceBus;
     _bonusApiProxy          = bonusApiProxy;
     _messageTemplateService = messageTemplateService;
 }
Exemple #2
0
 public BanksController(
     IPaymentQueries paymentQueries,
     IAdminQueries adminQueries)
 {
     _paymentQueries = paymentQueries;
     _adminQueries   = adminQueries;
 }
Exemple #3
0
        public override void BeforeEach()
        {
            base.BeforeEach();

            Balance = new BonusBalance();
            var bonusApiMock = new Mock <IBonusApiProxy>();

            bonusApiMock.Setup(proxy => proxy.GetPlayerBalanceAsync(It.IsAny <Guid>(), It.IsAny <Guid?>())).ReturnsAsync(Balance);
            Container.RegisterInstance(bonusApiMock.Object);

            _withdrawalService             = Container.Resolve <IWithdrawalService>();
            _playerQueries                 = Container.Resolve <PlayerQueries>();
            _paymentRepository             = Container.Resolve <FakePaymentRepository>();
            _actorInfoProvider             = Container.Resolve <IActorInfoProvider>();
            _walletRepository              = Container.Resolve <IGameRepository>();
            _paymentTestHelper             = Container.Resolve <PaymentTestHelper>();
            _gamesTestHelper               = Container.Resolve <GamesTestHelper>();
            _wageringConfigurationCommands = Container.Resolve <IWagerConfigurationCommands>();
            _paymentQueries                = Container.Resolve <IPaymentQueries>();

            var securityTestHelper = Container.Resolve <SecurityTestHelper>();

            securityTestHelper.PopulatePermissions();
            securityTestHelper.CreateAndSignInSuperAdmin();

            Container.Resolve <PaymentWorker>().Start();
            var brandHelper = Container.Resolve <BrandTestHelper>();
            var brand       = brandHelper.CreateActiveBrandWithProducts();

            var player = Container.Resolve <PlayerTestHelper>().CreatePlayer();

            _paymentTestHelper.CreatePlayerBankAccount(player.Id, brand.Id, true);

            _player = _playerQueries.GetPlayers().ToList().First();
        }
Exemple #4
0
 public PaymentController(
     IPaymentQueries paymentQueries,
     PlayerBankAccountCommands playerBankAccountCommands,
     IBrandQueries brandQueries,
     IWithdrawalService withdrawalService,
     ITransferFundCommands transferFundCommands,
     IOfflineDepositCommands offlineDepositCommands,
     IOfflineDepositQueries offlineDepositQueries,
     IOnlineDepositCommands onlineDepositCommands,
     IOnlineDepositQueries onlineDepositQueries,
     IPaymentGatewaySettingsQueries paymentGatewaySettingsQueries,
     IPlayerQueries playerQueries,
     IBonusApiProxy bonusApiProxy,
     ReportQueries reportQueries)
 {
     _paymentQueries            = paymentQueries;
     _playerBankAccountCommands = playerBankAccountCommands;
     _brandQueries                  = brandQueries;
     _withdrawalService             = withdrawalService;
     _transferFundCommands          = transferFundCommands;
     _offlineDepositCommands        = offlineDepositCommands;
     _offlineDepositQueries         = offlineDepositQueries;
     _onlineDepositCommands         = onlineDepositCommands;
     _onlineDepositQueries          = onlineDepositQueries;
     _paymentGatewaySettingsQueries = paymentGatewaySettingsQueries;
     _playerQueries                 = playerQueries;
     _bonusApiProxy                 = bonusApiProxy;
     _reportQueries                 = reportQueries;
 }
        public EditPlayerBankAccountValidator(IPaymentRepository repository, IPaymentQueries queries)
        {
            RuleFor(x => x.Id)
            .Must(x => repository.PlayerBankAccounts.SingleOrDefault(y => y.Id == x) != null)
            .WithMessage("{\"text\": \"app:common.idDoesNotExist\"}");

            RuleFor(x => x.PlayerId)
            .Must(x => x != null && x.Value != Guid.Empty && queries.GetPlayer(x.Value) != null)
            .WithMessage("{\"text\": \"app:common.idDoesNotExist\"}");

            RuleFor(x => x.Bank)
            .Must(x => repository.Banks.SingleOrDefault(y => y.Id == x) != null)
            .WithMessage("{\"text\": \"app:common.idDoesNotExist\"}");

            RuleFor(x => x.Province)
            .Must(x => !string.IsNullOrWhiteSpace(x))
            .WithMessage("{\"text\": \"app:common.requiredField\"}");

            RuleFor(x => x.City)
            .Must(x => !string.IsNullOrWhiteSpace(x))
            .WithMessage("{\"text\": \"app:common.requiredField\"}");

            RuleFor(x => x.AccountName)
            .Must(x => !string.IsNullOrWhiteSpace(x))
            .WithMessage("{\"text\": \"app:common.requiredField\"}");

            RuleFor(x => x.AccountNumber)
            .Must(x => !string.IsNullOrWhiteSpace(x))
            .WithMessage("{\"text\": \"app:common.requiredField\"}");
        }
        public ChangePlayerPaymentLevelValidator(IPlayerRepository repository, IPaymentQueries paymentQueries)
        {
            CascadeMode = CascadeMode.StopOnFirstFailure;

            Custom(data =>
            {
                var player =
                    repository.Players.Include(x => x.Brand).FirstOrDefault(x => x.Id == data.PlayerId);

                if (player == null)
                {
                    return(new ValidationFailure("PlayerId", PaymentLevelErrors.PlayerNotFound.ToString()));
                }

                var newPaymentLevel = paymentQueries.GetPaymentLevel(data.PaymentLevelId);
                if (newPaymentLevel == null)
                {
                    return(new ValidationFailure("PaymentLevelId", PaymentLevelErrors.PaymentLevelNotFound.ToString()));
                }
                if (newPaymentLevel.Status == PaymentLevelStatus.Inactive)
                {
                    return(new ValidationFailure("PaymentLevelId", PaymentLevelErrors.PaymentLevelInactivate.ToString()));
                }
                if (newPaymentLevel.CurrencyCode != player.CurrencyCode || newPaymentLevel.BrandId != player.BrandId)
                {
                    return(new ValidationFailure("PaymentLevelId", PaymentLevelErrors.PaymentLevelAndPlayerNotMatch.ToString()));
                }

                return(null);
            });
        }
Exemple #7
0
 public WithdrawalService(
     IPaymentRepository repository,
     IPaymentQueries paymentQueries,
     IEventBus eventBus,
     BrandQueries brandQueries,
     IAVCValidationService avcValidationService,
     IRiskProfileCheckValidationService riskProfileCheckService,
     IActorInfoProvider actorInfoProvider,
     IUnityContainer container,
     IMessageTemplateService messageTemplateService,
     IGameWalletOperations walletCommands,
     IServiceBus serviceBus)
 {
     _repository              = repository;
     _paymentQueries          = paymentQueries;
     _eventBus                = eventBus;
     _brandQueries            = brandQueries;
     _avcValidationService    = avcValidationService;
     _riskProfileCheckService = riskProfileCheckService;
     _actorInfoProvider       = actorInfoProvider;
     _container               = container;
     _serviceBus              = serviceBus;
     _messageTemplateService  = messageTemplateService;
     _walletCommands          = walletCommands;
 }
 public PaymentGatewaySettingsController(
     IPaymentQueries paymentQueries,
     IAdminQueries adminQueries
     )
 {
     _paymentQueries = paymentQueries;
     _adminQueries   = adminQueries;
 }
Exemple #9
0
 public PaymentGatewaySettingsCommands(IPaymentRepository repository, IActorInfoProvider actorInfoProvider, IEventBus eventBus
                                       , IPaymentQueries paymentQueries)
 {
     _repository        = repository;
     _eventBus          = eventBus;
     _actorInfoProvider = actorInfoProvider;
     _paymentQueries    = paymentQueries;
 }
 public PaymentSettingsQueries(IPaymentQueries paymentQueries, IPlayerQueries playerQueries, IPaymentSettingsCommands settingsCommands,
                               IPaymentGatewaySettingsQueries paymentGatewaySettingsQueries)
 {
     _paymentQueries   = paymentQueries;
     _playerQueries    = playerQueries;
     _settingsCommands = settingsCommands;
     _paymentGatewaySettingsQueries = paymentGatewaySettingsQueries;
 }
 public WalletQueries(IPaymentQueries paymentQueries,
                      IBrandOperations brandOperations,
                      IBonusApiProxy bonusApiProxy
                      )
 {
     _paymentQueries  = paymentQueries;
     _brandOperations = brandOperations;
     _bonusApiProxy   = bonusApiProxy;
 }
Exemple #12
0
 public PaymentLevelController(
     IPaymentQueries paymentQueries,
     IAuthQueries authQueries,
     IAdminQueries adminQueries)
     : base(authQueries, adminQueries)
 {
     _paymentQueries = paymentQueries;
     _adminQueries   = adminQueries;
 }
Exemple #13
0
 public CurrencyExchangeController(
     IPaymentQueries paymentQueries,
     ICurrencyExchangeCommands currencyExchangeCommands,
     IAdminQueries adminQueries)
 {
     _paymentQueries           = paymentQueries;
     _currencyExchangeCommands = currencyExchangeCommands;
     _adminQueries             = adminQueries;
 }
Exemple #14
0
        public OfflineDepositConfirmValidator(
            IPaymentRepository repository,
            IPlayerRepository playerRepository,
            IPaymentQueries paymentQueries)
        {
            _repository       = repository;
            _playerRepository = playerRepository;
            _paymentQueries   = paymentQueries;

            RuleFor(x => x.PlayerAccountName)
            .NotEmpty()
            .WithMessage("FieldIsRequired");

            RuleFor(x => x.Amount).GreaterThan(0).WithMessage("AmountGreaterZero");

            RuleFor(x => x)
            .Cascade(CascadeMode.StopOnFirstFailure)
            .Must(x =>
            {
                var deposit = _repository.OfflineDeposits.Single(o => o.Id == x.Id);

                var player =
                    _playerRepository.Players.Include(y => y.IdentityVerifications)
                    .Single(y => y.Id == deposit.PlayerId);

                return(IsAccountNameValid(x.PlayerAccountName, player) ||
                       (!string.IsNullOrEmpty(x.IdFrontImage) && !string.IsNullOrEmpty(x.IdBackImage)) ||
                       !string.IsNullOrEmpty(x.ReceiptImage));
            })
            .WithMessage("FrontAndBackCopyRequired")
            .WithName("IdFront")
            .Must(x =>
            {
                var deposit = _repository.OfflineDeposits.Single(o => o.Id == x.Id);

                var player =
                    _playerRepository.Players.Include(y => y.IdentityVerifications)
                    .Single(y => y.Id == deposit.PlayerId);

                return(player.IdentityVerifications
                       .Any(
                           o => o.ExpirationDate >= DateTime.Now && o.VerificationStatus == VerificationStatus.Verified) ||
                       (!string.IsNullOrEmpty(x.IdFrontImage) && !string.IsNullOrEmpty(x.IdBackImage)) ||
                       !string.IsNullOrEmpty(x.ReceiptImage));
            })
            .WithMessage("NotActiveIdentificationDocs")
            .WithName("IdFront")
            .Must(x =>
            {
                var bankAccount       = _paymentQueries.GetBankAccountForOfflineDeposit(x.Id);
                var isReceiptRequired = IsReceiptRequiredByPaymentLevelCriterium(x, bankAccount);

                return(!isReceiptRequired || !string.IsNullOrEmpty(x.ReceiptImage));
            })
            .WithMessage("ReceiptRequired")
            .WithName("DepositReceipt");
        }
 public OfflineDepositController(
     IPaymentQueries paymentQueries,
     IOfflineDepositCommands offlineDepositCommands,
     IAuthQueries authQueries,
     IAdminQueries adminQueries)
     : base(authQueries, adminQueries)
 {
     _paymentQueries         = paymentQueries;
     _offlineDepositCommands = offlineDepositCommands;
 }
 public CurrencyExchangeCommands(
     IActorInfoProvider actorInfoProvider,
     IPaymentRepository paymentRepository,
     IPaymentQueries queries
     )
 {
     _queries           = queries;
     _actorInfoProvider = actorInfoProvider;
     _paymentRepository = paymentRepository;
 }
 public TransferSettingsController(
     IPaymentQueries paymentQueries,
     ITransferSettingsCommands settingsCommands,
     BrandQueries brandQueries,
     IAdminQueries adminQueries)
 {
     _paymentQueries   = paymentQueries;
     _settingsCommands = settingsCommands;
     _brandQueries     = brandQueries;
     _adminQueries     = adminQueries;
 }
Exemple #18
0
 public BanksController(
     IPaymentQueries paymentQueries,
     IBankCommands bankCommands,
     IBankQueries bankQueries,
     IAuthQueries authQueries,
     IAdminQueries adminQueries)
     : base(authQueries, adminQueries)
 {
     _paymentQueries = paymentQueries;
     _bankCommands   = bankCommands;
     _bankQueries    = bankQueries;
 }
Exemple #19
0
 public CurrencyController(
     ICurrencyCommands currencyCommands,
     IPaymentQueries paymentQueries,
     IPaymentCommands paymentCommands,
     IAuthQueries authQueries,
     IAdminQueries adminQueries)
     : base(authQueries, adminQueries)
 {
     _currencyCommands = currencyCommands;
     _paymentQueries   = paymentQueries;
     _paymentCommands  = paymentCommands;
 }
Exemple #20
0
 public TransferFundValidationService(
     IPaymentQueries paymentQueries,
     IPaymentRepository paymentRepository,
     IWalletQueries walletQueries,
     BrandQueries brandQueries
     )
 {
     _paymentQueries    = paymentQueries;
     _paymentRepository = paymentRepository;
     _walletQueries     = walletQueries;
     _brandQueries      = brandQueries;
 }
        public OfflineDepositController(
            PlayerQueries playerQueries,
            IPaymentQueries paymentQueries,
            IAdminQueries adminQueries,
            IBonusApiProxy bonusApiProxy)
        {
            _playerQueries  = playerQueries;
            _paymentQueries = paymentQueries;

            _adminQueries  = adminQueries;
            _bonusApiProxy = bonusApiProxy;
        }
 public CurrencyCommands(
     IActorInfoProvider actorInfoProvider,
     IEventBus eventBus,
     IPaymentRepository paymentRepository,
     IPaymentQueries queries
     )
 {
     _queries           = queries;
     _actorInfoProvider = actorInfoProvider;
     _eventBus          = eventBus;
     _paymentRepository = paymentRepository;
 }
 public PaymentLevelController(
     BrandQueries brandQueries,
     IPaymentQueries paymentQueries,
     IPaymentLevelQueries paymentLevelQueries,
     IPaymentLevelCommands paymentLevelCommands,
     IAdminQueries adminQueries)
 {
     _brandQueries         = brandQueries;
     _paymentQueries       = paymentQueries;
     _paymentLevelQueries  = paymentLevelQueries;
     _paymentLevelCommands = paymentLevelCommands;
     _adminQueries         = adminQueries;
 }
 public OfflineWithdrawController(
     IWithdrawalService service,
     IPaymentQueries paymentQueries,
     IAdminQueries adminQueries,
     IWithdrawalVerificationLogsQueues withdrawalVerificationLogsQueues,
     IActorInfoProvider actorInfoProvider)
 {
     _service        = service;
     _paymentQueries = paymentQueries;
     _adminQueries   = adminQueries;
     _withdrawalVerificationLogsQueues = withdrawalVerificationLogsQueues;
     _actorInfoProvider = actorInfoProvider;
 }
 public PaymentLevelQueries(
     IPaymentRepository repository,
     IPaymentQueries paymentQueries,
     IBrandRepository brandRepository,
     PlayerQueries playerQueries,
     BrandQueries brandQueries)
 {
     _repository      = repository;
     _paymentQueries  = paymentQueries;
     _brandRepository = brandRepository;
     _playerQueries   = playerQueries;
     _brandQueries    = brandQueries;
 }
Exemple #26
0
 public PlayerBankAccountCommands(
     IPaymentRepository repository,
     IPaymentQueries queries,
     IActorInfoProvider actorInfoProvider,
     IEventBus eventBus,
     IMessageTemplateService messageService)
 {
     _repository        = repository;
     _queries           = queries;
     _actorInfoProvider = actorInfoProvider;
     _eventBus          = eventBus;
     _messageService    = messageService;
 }
 public PaymentSettingsController(IPaymentQueries paymentQueries,
                                  IPaymentSettingsCommands settingsCommands,
                                  IPaymentSettingsQueries paymentSettingsQueries,
                                  IPlayerQueries playerQueries, IAdminQueries adminQueries,
                                  BrandQueries brandQueries
                                  )
 {
     _paymentQueries         = paymentQueries;
     _settingsCommands       = settingsCommands;
     _paymentSettingsQueries = paymentSettingsQueries;
     _playerQueries          = playerQueries;
     _adminQueries           = adminQueries;
     _brandQueries           = brandQueries;
 }
Exemple #28
0
 public MassMessageController(
     IMassMessageQueries massMessageQueries,
     IMassMessageCommands massMessageCommands,
     BrandQueries brandQueries,
     IPaymentQueries paymentQueries,
     IAuthQueries authQueries,
     IAdminQueries adminQueries)
     : base(authQueries, adminQueries)
 {
     _massMessageQueries  = massMessageQueries;
     _massMessageCommands = massMessageCommands;
     _brandQueries        = brandQueries;
     _paymentQueries      = paymentQueries;
     _adminQueries        = adminQueries;
 }
 public ReportController(
     IAuthQueries authQueries,
     ReportQueries queries,
     BrandQueries brandQueries,
     GameQueries gameQueries,
     IPaymentQueries paymentQueries,
     IEventBus eventBus)
 {
     _authQueries    = authQueries;
     _queries        = queries;
     _brandQueries   = brandQueries;
     _gameQueries    = gameQueries;
     _paymentQueries = paymentQueries;
     _eventBus       = eventBus;
 }
Exemple #30
0
        public PaymentGatewaySettingsController(
            IPaymentQueries paymentQueries,
            IPaymentGatewaySettingsQueries paymentGatewaySettingsQueries,
            IPaymentGatewaySettingsCommands paymentGatewaySettingsCommands,
            IAuthQueries authQueries,
            IAdminQueries adminQueries)
            : base(authQueries, adminQueries)
        {
            _paymentQueries = paymentQueries;
            _adminQueries   = adminQueries;
            _paymentGatewaySettingsQueries  = paymentGatewaySettingsQueries;
            _paymentGatewaySettingsCommands = paymentGatewaySettingsCommands;

            Mapper
            .CreateMap
            <Core.Payment.Interface.Data.PaymentGatewaySettings, PaymentGatewaySettingsViewDataResponse>();
        }