Ejemplo n.º 1
0
        public Pos(string posId, FiscalPrinter fiscalPrinter, IPed ped)
        {
            Ensure.NotNull(posId, nameof(posId));
            Ensure.NotNull(fiscalPrinter, nameof(fiscalPrinter));
            Ensure.NotNull(ped, nameof(_ped));

            PosId = posId;
            _printer = fiscalPrinter;
            _ped = ped;
        }
Ejemplo n.º 2
0
 private void ProcessAction(string requestType, FiscalPrinter printer, string requestId, string message)
 {
     switch (requestType.ToLower())
     {
         case "ack":
         case "nak":
             _eventsMonitor.FireEvent(Network.CreateHeader(requestType, printer.FiscalPrinterId, requestId), requestType.ToLower());
             break;
     }
 }
Ejemplo n.º 3
0
        public FiscalPrinter RegisterPrinter(string printerId)
        {
            Ensure.NotNull(printerId, nameof(printerId));

            FiscalPrinter printer;
            if (!_printers.TryGetValue(printerId, out printer))
                _printers[printerId] = printer = new FiscalPrinter(printerId, async (printData) => await PrintPaymentReceipt(printerId, printData));

            return printer;
        }