예제 #1
0
        public async Task Can_withhold_withdrawal_money()
        {
            var player = _playerQueries.GetPlayers().ToList().First();

            _paymentTestHelper.MakeDeposit(player.Id, 1000);
            await _gamesTestHelper.PlaceAndWinBet(1000, 1100, player.Id);

            var offlineWithdrawalRequest = new OfflineWithdrawRequest
            {
                Amount              = 1000,
                NotificationType    = NotificationType.None,
                BankAccountTime     = _paymentRepository.PlayerBankAccounts.First().Created.ToString(),
                BankTime            = _paymentRepository.Banks.First().Created.ToString(),
                PlayerBankAccountId = _paymentRepository
                                      .PlayerBankAccounts
                                      .Include(x => x.Player)
                                      .First(x => x.Player.Id == player.Id)
                                      .Id,
                Remarks     = "asd",
                RequestedBy = _actorInfoProvider.Actor.UserName
            };

            _withdrawalService.Request(offlineWithdrawalRequest);

            var playerBalance = await _walletQueries.GetPlayerBalance(player.Id);

            Assert.AreEqual(100, playerBalance.Free);
            Assert.AreEqual(1000, playerBalance.WithdrawalLock);
        }
예제 #2
0
        public void Cannot_execute_WithdrawalService_without_permissions()
        {
            // Arrange
            LogWithNewAdmin(Modules.OfflineDepositRequests, Permissions.View);

            // Act
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.GetWithdrawalsForVerification());
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.GetWithdrawalsForAcceptance());
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.GetWithdrawalsForApproval());
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.GetWithdrawalsCanceled());
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.GetWithdrawalsFailedAutoWagerCheck());
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.GetWithdrawalsOnHold());
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.Request(new OfflineWithdrawRequest()));
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.Verify(new Guid(), "Some remark"));
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.Unverify(new Guid(), "Some remark"));
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.Approve(new Guid(), "Some remark"));
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.Reject(new Guid(), "Some remark"));
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.PassWager(new Guid(), "Some remark"));
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.FailWager(new Guid(), "Some remark"));
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.PassInvestigation(new Guid(), "Some remark"));
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.FailInvestigation(new Guid(), "Some remark"));
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.Accept(new Guid(), "Some remark"));
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.Revert(new Guid(), "Some remark"));
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.Cancel(new Guid(), "Some remark"));
            Assert.Throws <InsufficientPermissionsException>(() => _withdrawalService.SaveExemption(new Exemption()));
        }
        private void AssertRiskProfileCheckStatus(OfflineWithdrawRequest offlineWithdrawalRequest,
                                                  Core.Brand.Interface.Data.Brand brand, FraudRiskLevelStatus expectedResult)
        {
            var response = _withdrawalService.Request(offlineWithdrawalRequest);

            var riskProfileCheckReportInfo = _withdrawalVerificationLogsQueues.RiskProfileCheckStatus(response.Id,
                                                                                                      brand.Name, brand.Licensee.Name, "Random Name");

            Assert.AreEqual(expectedResult.ToString(),
                            riskProfileCheckReportInfo.VerificationDialogHeaderValues.StatusSuccess);
        }
예제 #4
0
        public OfflineWithdrawalResponse OfflineWithdraw(WithdrawalRequest request)
        {
            ValidateAccountFrozenStatus();

            var offlineWithdrawalRequest = new OfflineWithdrawRequest
            {
                PlayerId            = PlayerId,
                Amount              = request.Amount,
                PlayerBankAccountId = _paymentQueries.GetPlayer(PlayerId).CurrentBankAccount.Id,
                RequestedBy         = Username,
                NotificationType    = request.NotificationType,
            };

            _withdrawalService.Request(offlineWithdrawalRequest);

            return(new OfflineWithdrawalResponse());
        }
예제 #5
0
 public OfflineWithdrawResponse MakeWithdraw(Guid playerId, string requestedby = "admin", decimal amount = 1)
 {
     return(_withdrawalService.Request(
                new OfflineWithdrawRequest
     {
         Amount = amount,
         NotificationType = NotificationType.None,
         BankAccountTime = _paymentRepository.PlayerBankAccounts.First().Created.ToString(),
         BankTime = _paymentRepository.Banks.First().Created.ToString(),
         PlayerBankAccountId = _paymentRepository
                               .PlayerBankAccounts
                               .Include(x => x.Player)
                               .First(x => x.Player.Id == playerId)
                               .Id,
         Remarks = "remraks",
         RequestedBy = requestedby
     }));
 }
예제 #6
0
        private OfflineWithdrawResponse MakeWithdrawalRequest(Guid playerId, IQueryable <Core.Common.Data.Player.Player> playersAffectedByAvc)
        {
            var offlineWithdrawalRequest = new OfflineWithdrawRequest
            {
                Amount              = 1,
                NotificationType    = NotificationType.None,
                BankAccountTime     = _paymentRepository.PlayerBankAccounts.First().Created.ToString(),
                BankTime            = _paymentRepository.Banks.First().Created.ToString(),
                PlayerBankAccountId = _paymentRepository
                                      .PlayerBankAccounts.
                                      Include(x => x.Player).
                                      First(x => x.Player.Id == playerId)
                                      .Id,
                Remarks     = "rogi",
                RequestedBy = playersAffectedByAvc.FirstOrDefault().Username
            };

            return(_withdrawalService.Request(offlineWithdrawalRequest));
        }
        public string Create(OfflineWithdrawRequest withdrawRequest)
        {
            if (ModelState.IsValid == false)
            {
                return(SerializeJson(new { Result = "failed", Data = (string)null }));
            }

            withdrawRequest.RequestedBy = System.Threading.Thread.CurrentPrincipal.Identity.Name;

            OfflineWithdrawResponse response;

            try
            {
                response = _service.Request(withdrawRequest);
            }
            catch (Exception ex)
            {
                return(SerializeJson(new { Result = "failed", Error = ex.Message }));
            }

            return(SerializeJson(new { Result = "success", Data = "app:payment.withdraw.requestCreated", Id = response.Id }));
        }
        private async Task CreateOWR()
        {
            var player = _player;

            _paymentTestHelper.MakeDeposit(player.Id, 1000);
            await _gamesTestHelper.PlaceAndWinBet(1000, 10000, player.Id);

            var offlineWithdrawalRequest = new OfflineWithdrawRequest
            {
                Amount              = 1,
                NotificationType    = NotificationType.None,
                BankAccountTime     = _paymentRepository.PlayerBankAccounts.First().Created.ToString(),
                BankTime            = _paymentRepository.Banks.First().Created.ToString(),
                PlayerBankAccountId = _paymentRepository
                                      .PlayerBankAccounts
                                      .Include(x => x.Player)
                                      .First(x => x.Player.Id == player.Id)
                                      .Id,
                Remarks     = "asd",
                RequestedBy = _actorInfoProvider.Actor.UserName
            };

            _withdrawalService.Request(offlineWithdrawalRequest);
        }
        public async Task Can_not_create_ow_with_age_greater_then_setted_up()
        {
            var brand = _brandQueries.GetBrands().First();

            CreateAvcConfiguration(
                new AVCConfigurationDTO
            {
                Brand              = brand.Id,
                VipLevels          = new[] { brand.DefaultVipLevelId.Value },
                Currency           = brand.DefaultCurrency,
                HasFraudRiskLevel  = false,
                HasAccountAge      = true,
                AccountAge         = 4,
                AccountAgeOperator = ComparisonEnum.LessOrEqual,
                Status             = AutoVerificationCheckStatus.Active
            }
                );

            _paymentTestHelper.MakeDeposit(player.Id, 1000);
            await _gamesTestHelper.PlaceAndWinBet(1000, 10000, player.Id);

            Balance.Main = 10000;

            var offlineWithdrawalRequest = new OfflineWithdrawRequest
            {
                Amount              = 1,
                NotificationType    = NotificationType.None,
                BankAccountTime     = _paymentRepository.PlayerBankAccounts.First().Created.ToString(),
                BankTime            = _paymentRepository.Banks.First().Created.ToString(),
                PlayerBankAccountId = _paymentRepository
                                      .PlayerBankAccounts
                                      .Include(x => x.Player)
                                      .First(x => x.Player.Id == player.Id)
                                      .Id,
                Remarks     = "asd",
                RequestedBy = _actorInfoProvider.Actor.UserName
            };

            _withdrawalService.Request(offlineWithdrawalRequest);

            var accountAgeFailed = _fraudRepository.WithdrawalVerificationLogs.Any(
                o => o.VerificationStep == VerificationStep.AccountAge &&
                !o.IsSuccess);

            Assert.IsTrue(accountAgeFailed);
        }
예제 #10
0
        public async Task Can_create_OW_request()
        {
            _paymentTestHelper.MakeDeposit(_player.Id, 1000);
            await _gamesTestHelper.PlaceAndWinBet(1000, 10000, _player.Id);

            Balance.Main = 10000;

            var offlineWithdrawalRequest = new OfflineWithdrawRequest
            {
                Amount              = 1,
                NotificationType    = NotificationType.None,
                BankAccountTime     = _paymentRepository.PlayerBankAccounts.First().Created.ToString(),
                BankTime            = _paymentRepository.Banks.First().Created.ToString(),
                PlayerBankAccountId = _paymentRepository
                                      .PlayerBankAccounts
                                      .Include(x => x.Player)
                                      .First(x => x.Player.Id == _player.Id)
                                      .Id,
                Remarks     = "asd",
                RequestedBy = _actorInfoProvider.Actor.UserName
            };

            var response = _withdrawalService.Request(offlineWithdrawalRequest);

            var requests = _paymentRepository.OfflineWithdraws.ToList();

            Assert.IsNotEmpty(requests);

            var withdrawLockBalance = _paymentQueries.GetWithdrawalLockBalance(_player.Id);

            withdrawLockBalance.Should().Be(1);

            _paymentTestHelper.AssertBalance(_player.Id
                                             , total: 10000, playable: 9999, main: 9999, free: 9999, withdrawalLock: 1);
        }