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