private ActionResult Confirm(ConfirmOfflineDepositRequest depositConfirm, HttpPostedFileBase idFrontImage,
                                     HttpPostedFileBase idBackImage, HttpPostedFileBase receiptImage)
        {
            if (ModelState.IsValid == false)
            {
                return(this.Failed());
            }

            depositConfirm.CurrentUser      = CurrentUser.UserName;
            depositConfirm.IdFrontImageFile = idFrontImage.GetBytes();
            depositConfirm.IdBackImageFile  = idBackImage.GetBytes();
            depositConfirm.ReceiptImageFile = receiptImage.GetBytes();

            var response = GetAdminApiProxy(Request).ConfirmOfflineDeposit(depositConfirm);

            return(response.Success ?
                   this.Success(
                       new
            {
                Message = "app:payment.deposit.successfullyConfirmed",
                idFrontImage = response.IdFrontImageId,
                idBackImage = response.IdBackImageId,
                receiptImage = response.ReceiptImageId,
                response.PlayerId
            })
                : this.Failed(response.Errors));
        }
        public ConfirmOfflineDepositResponse Confirm(ConfirmOfflineDepositRequest request)
        {
            VerifyPermission(Permissions.Confirm, Modules.OfflineDepositConfirmation);

            var data = _paymentQueries.GetDepositByIdForViewRequest(request.Id);

            CheckBrand(data.BrandId);

            var model = Mapper.Map <OfflineDepositConfirm>(request);

            var deposit = _offlineDepositCommands.Confirm(model, request.CurrentUser, request.IdFrontImageFile, request.IdBackImageFile, request.ReceiptImageFile);

            return(new ConfirmOfflineDepositResponse
            {
                Success = true,
                PlayerId = deposit.PlayerId,
                IdFrontImageId = deposit.IdFrontImage,
                IdBackImageId = deposit.IdBackImage,
                ReceiptImageId = deposit.ReceiptImage,
            });
        }
示例#3
0
 public ConfirmOfflineDepositResponse ConfirmOfflineDeposit(ConfirmOfflineDepositRequest request)
 {
     return(WebClient.SecurePostAsJson <ConfirmOfflineDepositRequest, ConfirmOfflineDepositResponse>(Token, _url + AdminApiRoutes.ConfirmOfflineDeposit, request));
 }