Exemple #1
0
        public DataResponse GetVonageExternalLogin(PosCredentials tokenRequest)
        {
            var token = _meteleService.GetVonageTicketForCredentials(tokenRequest.MerchantId, tokenRequest.MerchantPassword);

            var url = string.Format("http://vonage.pinserve.com/account/externallogin?token={0}", token);

            return new DataResponse
            {
                Data = url,
                Status = !string.IsNullOrEmpty(token) ? 200 : 201,
                ErrorMessage = !string.IsNullOrEmpty(token) ? string.Empty :
                "Could not retrieve Token for Vonage."
            };
        }
Exemple #2
0
        private void AddNewDefaultSettings(PosCredentials posRequest)
        {
            var merchant = _blackstonePosService.FindMerchant(posRequest.MerchantId);

            var tax = merchant.IsFullCarga ? 0 : 7;
            var paxTerminalAsPrinter = !merchant.IsFullCarga;

            var newSetting = new Setting
            {
                MerchantId = posRequest.MerchantId,
                ConfirmPhone = true,
                MerchantPassword = posRequest.MerchantPassword,
                PaxTerminalAsPrinter = paxTerminalAsPrinter,
                SmallReceipt = true,
                Tax = tax
            };

            _settingRepository.Add(newSetting);
        }
Exemple #3
0
        public DataResponse GetSettings(PosCredentials posRequest)
        {
            try
            {
                var allsettings = _blackstonePosService.Get(_settingRepository);

                var setting = allsettings.FirstOrDefault(set => set.MerchantId == posRequest.MerchantId);

                if (setting == null)
                    AddNewDefaultSettings(posRequest);

                var status = setting != null ? 200 : 201;

                var message = setting != null ? string.Empty : "Setting could not be retrieved.";

                var data = setting;

                return new DataResponse
                {
                    Data = data,
                    Status = status,
                    ErrorMessage = message
                };
            }
            catch (Exception exception)
            {
                return new DataResponse(exception);
            }
        }
Exemple #4
0
        public DataResponse GetSavedAchPayments(PosCredentials posRequest)
        {
            var savedPayments = _blackstonePosService.GetSavedPayments(posRequest.MerchantId.ToString());

            return savedPayments;
        }
Exemple #5
0
        public DataResponse GetAppMainLogoUrl(PosCredentials posRequest)
        {
            try
            {
                var cashier = _cashierRepository.FindCashier(posRequest.MerchantId, posRequest.MerchantPassword);

                //Extensible to more Brands upon rules definition...
                var brandKey = cashier.IsFullCarga ? "fullCarga" : "blackstonePos";

                var logoUrl = _appLogoRepository.GetAppLogoByBrandKey(brandKey);

                var data = logoUrl != null ? logoUrl.BrandAppLogoUrl : string.Empty;

                return new DataResponse
                {
                    Data = data,
                    Status = logoUrl!= null? 200:201,
                    ErrorMessage = logoUrl!= null? string.Empty: "Errors trying to fetch the App Logo"
                };

            }
            catch (Exception exception)
            {
                return new DataResponse(exception);
            }
        }
Exemple #6
0
        public DataResponse GetAllCashiers(PosCredentials posRequest)
        {
            var allCashiers = _blackstonePosService.Get(_cashierRepository);

            var cashiersResult = allCashiers.Where(cashier => cashier.MerchantId == posRequest.MerchantId && cashier.IsMerchant.HasValue && !cashier.IsMerchant.Value).ToList();

            var distinctCashiers = cashiersResult.Distinct(new CashierComparer());

            var status = cashiersResult != null ? 200 : 201;

            var message = cashiersResult != null ? string.Empty : "Cashiers could not be retrieved.";

            return new DataResponse
            {
                Data = distinctCashiers,
                Status = status,
                ErrorMessage = message
            };
        }
        public DataResponse GetPosMainProducts(PosCredentials posRequest)
        {
            var mainProducts = _blackstonePosService.GetActiveMainProducts(posRequest.MerchantId);

            return mainProducts;
        }