public ActionResult AcceptList(SearchPackage searchPackage)
        {
            var data = SearchOfflineWithdraws(
                searchPackage,
                obj => new[]
            {
                obj.Id.ToString(),
                obj.PlayerBankAccount.Player.Id.ToString(),
                obj.PlayerBankAccount.Player.Username,
                obj.PlayerBankAccount.Player.FullName,
                obj.TransactionNumber,
                obj.PaymentMethod.ToString(),
                obj.PlayerBankAccount.Player.CurrencyCode,
                obj.Amount.ToString(CultureInfo.InvariantCulture),
                obj.Status.ToString()
            },
                _service.GetWithdrawalsVerified());

            return(new JsonResult
            {
                Data = data,
                MaxJsonLength = int.MaxValue,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
예제 #2
0
        public void Withdrawal_goes_from_VQ_to_AQ_after_verification()
        {
            //Create a withdrawal to go to the "Verification Queue"
            var withdrawal = new OfflineWithdraw();

            SetWithdrawalProperties(withdrawal, WithdrawalStatus.AutoVerificationFailed);

            //Move withdrawal to the "Acceptance Queue"
            _withdrawalService.Verify(_observedWithdrawalId, "Verify withdrawal request.");

            //Assert that the withdrawal request was moved to the "Acceptance queue"
            var withdrawalsInTheAcceptanceQueue = _withdrawalService.GetWithdrawalsVerified();

            Assert.IsTrue(withdrawalsInTheAcceptanceQueue.Any(wd => wd.Id == _observedWithdrawalId));
        }
예제 #3
0
        public void Withdrawal_goes_directly_to_acceptance_queue_after_exemption_applied()
        {
            var brandId    = _brandQueries.GetBrands().First().Id;
            var licenseeId = _brandQueries.GetBrands().First().Licensee.Id;
            var currency   = _brandQueries.GetBrands().First().DefaultCurrency;
            var vipLevelId = (Guid)_brandQueries.GetBrands().First().DefaultVipLevelId;
            var playerId   = new Guid();

            var playersAffectedByAvc = _playerQueries.GetPlayers()
                                       .Where(player => player.BrandId == brandId &&
                                              player.Brand.LicenseeId == licenseeId &&
                                              player.CurrencyCode == currency &&
                                              player.VipLevelId == vipLevelId);

            if (playersAffectedByAvc.Any())
            {
                playerId = playersAffectedByAvc.FirstOrDefault().Id;
            }

            //Create a new avc that has a withdrawal exemption
            CreateAvcConfiguration(new AVCConfigurationDTO
            {
                Licensee  = licenseeId,
                Brand     = brandId,
                Currency  = currency,
                VipLevels = new[] { vipLevelId },

                HasWithdrawalExemption = true,

                HasWithdrawalCount           = true,
                TotalWithdrawalCountAmount   = 85,
                TotalWithdrawalCountOperator = ComparisonEnum.Greater,

                Status = AutoVerificationCheckStatus.Active
            });

            _paymentTestHelper.MakeDeposit(playerId, 1000);
            Balance.Main = 1000;

            //Setup an exemption for a particular player that will make a withdrawal request later in the test case.
            var playerExemption = new Exemption
            {
                Exempt      = true,
                ExemptFrom  = DateTime.UtcNow.AddDays(-2).ToString(CultureInfo.InvariantCulture),
                ExemptTo    = DateTime.UtcNow.AddDays(2).ToString(CultureInfo.InvariantCulture),
                ExemptLimit = 1,

                PlayerId = playerId
            };

            _withdrawalService.SaveExemption(playerExemption);

            //Create the offline withdrawal request
            MakeWithdrawalRequest(playerId, playersAffectedByAvc);

            var numberOfVerifiedWithdrawals = _withdrawalService
                                              .GetWithdrawalsVerified().Count(wd => wd.PlayerBankAccount.Player.Id == playerId);

            Assert.AreEqual(1, numberOfVerifiedWithdrawals);

            //Since we are allowed to only one exemption, this means that on the next withdrawal
            //we must have our withdrawal request in the verification queue but not in the acceptance queue
            MakeWithdrawalRequest(playerId, playersAffectedByAvc);
            Assert.AreEqual(1, numberOfVerifiedWithdrawals);
        }