Beispiel #1
0
        public void Can_approve_online_deposit()
        {
            //Arrange
            var deposit = _paymentTestHelper.CreateOnlineDeposit(_testPlayer.Id, 300);

            _paymentTestHelper.VerifyOnlineDeposit(deposit.Id);

            var request = new ApproveOnlineDepositRequest
            {
                Id      = deposit.Id,
                Remarks = "remark"
            };

            //Act
            _depositCommands.Approve(request);

            //Assert
            var settings = _paymentRepositoryMock.OnlineDeposits.Single(x => x.Id == deposit.Id);

            settings.Status.Should().Be(OnlineDepositStatus.Approved);
            settings.Remarks.Should().Be(request.Remarks);
            settings.ApprovedBy.ShouldBeEquivalentTo(_actorInfoProvider.Actor.UserName);
            settings.Approved.Should().BeCloseTo(DateTimeOffset.Now, 5000);

            _paymentTestHelper.AssertBalance(_testPlayer.Id, total: 300, playable: 300, main: 300, free: 300);
        }
Beispiel #2
0
        public OnlineDeposit ApproveOnlineDeposit(Guid id, string remarks = "remarks")
        {
            _onlineDepositCommands.Approve(new ApproveOnlineDepositRequest
            {
                Id      = id,
                Remarks = remarks
            });
            var deposit = _paymentRepository.OnlineDeposits.SingleOrDefault(x => x.Id == id);

            return(deposit);
        }
Beispiel #3
0
        public ApproveOnlineDepositResponse Approve(ApproveOnlineDepositRequest request)
        {
            VerifyPermission(Permissions.Approve, Modules.DepositApproval);

            var data = _onlineDepositQueries.GetOnlineDepositById(request.Id);

            CheckBrand(data.BrandId);

            var model = Mapper.Map <Core.Payment.Interface.Data.ApproveOnlineDepositRequest>(request);

            _onlineDepositCommands.Approve(model);

            return(new ApproveOnlineDepositResponse
            {
                Success = true
            });
        }