Ejemplo n.º 1
0
        private void Start()
        {
            LoadPersistedState();

            _spi = new Spi(_posId, _serialNumber, _eftposAddress, _spiSecrets);
            _spi.SetPosInfo("assembly", "2.6.3");
            _spi.StatusChanged           += OnSpiStatusChanged;
            _spi.PairingFlowStateChanged += OnPairingFlowStateChanged;
            _spi.SecretsChanged          += OnSecretsChanged;
            _spi.TxFlowStateChanged      += OnTxFlowStateChanged;

            _pat = _spi.EnablePayAtTable();
            EnablePayAtTableConfigs();
            _pat.GetBillStatus        = PayAtTableGetBillDetails;
            _pat.BillPaymentReceived  = PayAtTableBillPaymentReceived;
            _pat.BillPaymentFlowEnded = PayAtTableBillPaymentFlowEnded;
            _pat.GetOpenTables        = PayAtTableGetOpenTables;

            try
            {
                _spi.Start();
            }
            catch (Exception e)
            {
                Console.WriteLine($@"SPI check failed: {e.Message}", @"Please ensure you followed all the configuration steps on your machine");
            }

            Console.Clear();
            Console.WriteLine("# Welcome to TablePos !");
            PrintStatusAndActions();
            Console.Write("> ");
            AcceptUserInput();
        }
Ejemplo n.º 2
0
        private void Start()
        {
            LoadPersistedState();

            _spi = new Spi(_posId, _serialNumber, _eftposAddress, _spiSecrets); // It is ok to not have the secrets yet to start with.
            _spi.SetPosInfo("assembly", "2.6.3");
            _spi.StatusChanged           += OnSpiStatusChanged;
            _spi.PairingFlowStateChanged += OnPairingFlowStateChanged;
            _spi.SecretsChanged          += OnSecretsChanged;
            _spi.TxFlowStateChanged      += OnTxFlowStateChanged;
            _spiPreauth = _spi.EnablePreauth();
            _spi.Start();

            Console.Clear();
            Console.WriteLine("# Welcome to MotelPos!");
            PrintStatusAndActions();
            Console.Write("> ");
            AcceptUserInput();
        }