Example #1
0
        public void Can_paynotify_online_deposit()
        {
            var request = new OnlineDepositPayNotifyRequest
            {
                OrderIdOfMerchant = "XP-0-20151202154756",
                OrderIdOfRouter   = "ROID20151202154803",
                OrderIdOfGateway  = "GOID20151202154803",
                Language          = "zh-CN",
                PayMethod         = "XPAY",
                Signature         = "EB1DA0FA24C29F809885B5AC7A1233F4"
            };
            var response = _depositCommands.PayNotify(request);

            response.Should().Be("SUCCESS", "Response should be 'SUCCESS'");

            _processingOnlineDeposit.OrderIdOfGateway.Should().Be(request.OrderIdOfGateway, "OrderIdOfGateway");
            _processingOnlineDeposit.OrderIdOfRouter.Should().Be(request.OrderIdOfRouter, "OrderIdOfRouter");
            _processingOnlineDeposit.Status.Should().Be(OnlineDepositStatus.Approved, "Status");
            _processingOnlineDeposit.ApprovedBy.Should().Be("TestPlayer", "ApprovedBy");
            _processingOnlineDeposit.Approved.Should().HaveValue("Approved");

            _paymentTestHelper.AssertBalance(_testPlayer.Id, total: 5000, playable: 5000, main: 5000, free: 5000);
        }
Example #2
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);
        }