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

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

            var(rawDeviceInfo, _)                      = fiscalPrinter.GetRawDeviceInfo();
            fiscalPrinter.Info                         = ParseDeviceInfo(rawDeviceInfo, autoDetect);
            var(TaxIdentificationNumber, _)            = fiscalPrinter.GetTaxIdentificationNumber();
            fiscalPrinter.Info.TaxIdentificationNumber = TaxIdentificationNumber;
            return(fiscalPrinter);
        }
Ejemplo n.º 3
0
        public override IFiscalPrinter Connect(IChannel channel, bool autoDetect = true, IDictionary <string, string>?options = null)
        {
            var fiscalPrinter         = new BgDatecsPIslFiscalPrinter(channel, options);
            var rawDeviceInfoCacheKey = $"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);
        }