public ActionResult ReleaseList(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.GetWithdrawalsAccepted());

            return(new JsonResult
            {
                Data = data,
                MaxJsonLength = int.MaxValue,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Beispiel #2
0
        public async Task Can_accept_withdrawal_request()
        {
            var player = _player;

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

            Balance.Main = 10000;

            var response = _paymentTestHelper.MakeWithdraw(player.Id, _actorInfoProvider.Actor.UserName);

            //assert balance after request
            _paymentTestHelper.AssertBalance(_player.Id
                                             , total: 10000, playable: 9999, main: 9999, free: 9999, withdrawalLock: 1);

            var acceptRemarks = TestDataGenerator.GetRandomString(10);

            _withdrawalService.Accept(response.Id, acceptRemarks);
            var ow = _withdrawalService.GetWithdrawalsAccepted();

            Assert.IsNotEmpty(ow);
            Assert.AreEqual(1, ow.Count());

            //assert balance after Accept
            _paymentTestHelper.AssertBalance(_player.Id
                                             , total: 10000, playable: 9999, main: 9999, free: 9999, withdrawalLock: 1);

            var withdraw = _paymentRepository.OfflineWithdraws.FirstOrDefault(x => x.Id == response.Id);

            withdraw.Status.Should().Be(WithdrawalStatus.Accepted);
            withdraw.AcceptedTime.Should().BeCloseTo(DateTimeOffset.Now, 60000);
            withdraw.AcceptedBy.Should().Be(_actorInfoProvider.Actor.UserName);
            withdraw.Remarks.Should().Be(acceptRemarks);
        }