Esempio n. 1
0
        public OnlineDeposit RejectOnlineDeposit(Guid id, string remarks = "remarks")
        {
            _onlineDepositCommands.Reject(new RejectOnlineDepositRequest
            {
                Id      = id,
                Remarks = remarks
            });
            var deposit = _paymentRepository.OnlineDeposits.SingleOrDefault(x => x.Id == id);

            return(deposit);
        }
Esempio n. 2
0
        public void Can_reject_online_deposit()
        {
            //Arrange
            var deposit = _paymentTestHelper.CreateOnlineDeposit(_testPlayer.Id, 300);

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

            //Act
            _depositCommands.Reject(request);

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

            settings.Status.Should().Be(OnlineDepositStatus.Rejected);
            settings.Remarks.Should().Be(request.Remarks);
            settings.RejectedBy.ShouldBeEquivalentTo(_actorInfoProvider.Actor.UserName);
            settings.Rejected.Should().BeCloseTo(DateTimeOffset.Now, 5000);
        }
Esempio n. 3
0
        public RejectOnlineDepositResponse Reject(RejectOnlineDepositRequest request)
        {
            if (false ==
                (_authQueries.VerifyPermission(UserId, Permissions.Reject, Modules.DepositVerification) ||
                 _authQueries.VerifyPermission(UserId, Permissions.Reject, Modules.DepositApproval)))
            {
                throw new HttpException(403, "Access forbidden");
            }

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

            CheckBrand(data.BrandId);

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

            _onlineDepositCommands.Reject(model);

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