public virtual IActionResult TransactionList(BarionPaymentSearchModel searchModel)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageOrders))
            {
                return(AccessDeniedDataTablesJson());
            }

            //prepare model
            BarionPaymentListModel model = _barionModelFactory.PrepareBarionPaymentListModel(searchModel);

            return(Json(model));
        }
        /// <summary>
        /// Prepare barion payment search model
        /// </summary>
        /// <param name="searchModel">Product search model</param>
        /// <returns>Product search model</returns>
        public virtual BarionPaymentSearchModel PrepareBarionPaymentSearchModel(BarionPaymentSearchModel searchModel)
        {
            if (searchModel == null)
            {
                throw new ArgumentNullException(nameof(searchModel));
            }

            searchModel.SearchStoreId = _storeContext.CurrentStore.Id;

            ////prepare available stores
            PrepareStores(searchModel.AvailableStores);

            //prepare grid
            searchModel.SetGridPageSize();

            return(searchModel);
        }
        public BarionPaymentListModel PrepareBarionPaymentListModel(BarionPaymentSearchModel searchModel)
        {
            //get transaction
            var transactions = _transaction.SearchBarionTransaction(
                storeId: searchModel.SearchStoreId,
                transactionId: searchModel.SearchTransactionId,
                customOrderNumber: searchModel.CustomOrderNumber,
                pageIndex: searchModel.Page - 1, pageSize: searchModel.PageSize
                );

            //prepare list model
            var model = new Models.BarionPaymentListModel().PrepareToGrid(searchModel, transactions, () =>
            {
                return(transactions.Select(transaction =>
                {
                    //fill in model values from the entity
                    var transactionModel = transaction.ToModel <Models.BarionTransactionModel>();

                    return transactionModel;
                }));
            });

            return(model);
        }