public override IFiscalPrinter Connect(IChannel channel, IDictionary <string, string>?options = null)
        {
            var fiscalPrinter = new BgDatecsXIslFiscalPrinter(channel, options);

            var(rawDeviceInfo, _) = fiscalPrinter.GetRawDeviceInfo();
            fiscalPrinter.Info    = ParseDeviceInfo(rawDeviceInfo);
            return(fiscalPrinter);
        }
Esempio n. 2
0
        public override IFiscalPrinter Connect(IChannel channel, bool autoDetect = true, IDictionary <string, string>?options = null)
        {
            var fiscalPrinter = new BgDatecsXIslFiscalPrinter(channel, options);

            var(rawDeviceInfo, _)                      = fiscalPrinter.GetRawDeviceInfo();
            fiscalPrinter.Info                         = ParseDeviceInfo(rawDeviceInfo, autoDetect);
            var(TaxIdentificationNumber, _)            = fiscalPrinter.GetTaxIdentificationNumber();
            fiscalPrinter.Info.TaxIdentificationNumber = TaxIdentificationNumber;
            return(fiscalPrinter);
        }
Esempio n. 3
0
        public override IFiscalPrinter Connect(IChannel channel, bool autoDetect = true, IDictionary <string, string>?options = null)
        {
            var fiscalPrinter         = new BgDatecsXIslFiscalPrinter(channel, options);
            var rawDeviceInfoCacheKey = $"x.isl.{channel.Descriptor}";
            var rawDeviceInfo         = Cache.Get(rawDeviceInfoCacheKey);

            if (rawDeviceInfo == null)
            {
                (rawDeviceInfo, _) = fiscalPrinter.GetRawDeviceInfo();
                Cache.Store(rawDeviceInfoCacheKey, rawDeviceInfo, TimeSpan.FromSeconds(30));
            }
            fiscalPrinter.Info = ParseDeviceInfo(rawDeviceInfo, autoDetect);
            var(TaxIdentificationNumber, _)            = fiscalPrinter.GetTaxIdentificationNumber();
            fiscalPrinter.Info.TaxIdentificationNumber = TaxIdentificationNumber;
            fiscalPrinter.Info.SupportedPaymentTypes   = fiscalPrinter.GetSupportedPaymentTypes();
            return(fiscalPrinter);
        }