private async Task <Comment> AddPaymentCommentAsync(
            CommentDiscussion discussion,
            PaymentType paymentType,
            ClaimPaymentRequest request)
        {
            Comment comment = CommentHelper.CreateCommentForDiscussion(
                discussion,
                CurrentUserId,
                Now,
                request.CommentText ?? "",
                true,
                null);

            comment.Finance = new FinanceOperation
            {
                OperationType = FinanceOperationType.Online,
                PaymentTypeId = paymentType.PaymentTypeId,
                MoneyAmount   = request.Money,
                OperationDate = request.OperationDate,
                ProjectId     = request.ProjectId,
                ClaimId       = request.ClaimId,
                Created       = Now,
                Changed       = Now,
                State         = FinanceOperationState.Proposed,
            };
            UnitOfWork.GetDbSet <Comment>().Add(comment);
            await UnitOfWork.SaveChangesAsync();

            return(comment);
        }
        /// <inheritdoc />
        public async Task <ClaimPaymentContext> InitiateClaimPaymentAsync(ClaimPaymentRequest request)
        {
            // Loading claim
            var claim = await GetClaimAsync(request.ProjectId, request.ClaimId);

            // Checking access rights
            if (claim.PlayerUserId != CurrentUserId)
            {
                throw new NoAccessToProjectException(claim.Project, CurrentUserId);
            }

            PaymentType onlinePaymentType =
                claim.Project.ActivePaymentTypes.SingleOrDefault(
                    pt => pt.TypeKind == PaymentTypeKind.Online);

            if (onlinePaymentType == null)
            {
                throw new OnlinePaymentsNotAvailable(claim.Project);
            }

            if (request.Money <= 0)
            {
                throw new PaymentException(claim.Project, $"Money amount must be positive integer");
            }

            User user = await GetCurrentUser();

            var message = new PaymentMessage
            {
                Amount          = request.Money,
                Details         = $"Билет (организационный взнос) участника на «{claim.Project.ProjectName}»",
                CustomerAccount = CurrentUserId.ToString(),
                CustomerEmail   = user.Email,
                CustomerPhone   = user.Extra?.PhoneNumber,
                CustomerComment = request.CommentText,
                PaymentMethod   = PscbPaymentMethod.BankCards,
                SuccessUrl      = _uriService.Get(new PaymentSuccessUrl(request.ProjectId, request.ClaimId)),
                FailUrl         = _uriService.Get(new PaymentFailUrl(request.ProjectId, request.ClaimId)),
                Data            = new PaymentMessageData
                {
                    Receipt = new Receipt
                    {
                        CompanyEmail = User.OnlinePaymentVirtualUser,
                        TaxSystem    = TaxSystemType.SimplifiedIncomeOutcome,
                        Items        = new List <ReceiptItem>
                        {
                            new ReceiptItem
                            {
                                ObjectType  = PaymentObjectType.Service,
                                PaymentType = ItemPaymentType.FullPayment,
                                Price       = request.Money,
                                Quantity    = 1,
                                TotalPrice  = request.Money,
                                VatType     = VatSystemType.None,
                                Name        = claim.Project.ProjectName,
                            }
                        }
                    }
                }
            };

            // Creating request to bank
            PaymentRequestDescriptor result = await GetApi(request.ProjectId, request.ClaimId)
                                              .BuildPaymentRequestAsync(
                message,
                async() => (await AddPaymentCommentAsync(claim.CommentDiscussion, onlinePaymentType, request))
                .CommentId
                .ToString()
                .PadLeft(10, '0')
                );

            return(new ClaimPaymentContext
            {
                Accepted = true,
                RequestDescriptor = result
            });
        }