Exemplo n.º 1
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);
        }
Exemplo n.º 2
0
        public DataResponse UpdateSettings(Setting setting)
        {
            try
            {
                var updateResult = _blackstonePosService.Update(_settingRepository, setting);

                if(!updateResult)
                    return new DataResponse
                    {
                        ErrorMessage = "Error trying to update settings!",
                        Status = 201
                    };

                var result = GetSettings(setting);

                return result;
            }
            catch (Exception exception)
            {
                return new DataResponse(exception);
            }
        }