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; }
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; } }
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; }