예제 #1
0
        public void InitialiseVim()
        {
            // Create VIM instance
            try
            {
                vim = VimFactory.CreateVim(new VimConfig.Builder()
                                           //.ConnectMode(VimConnectMode.EcrConnectMode)
                                           .LogLocation(Directory.GetCurrentDirectory())
                                           .LogLevel(VimLogLevel.DEBUG)
                                           .DefaultCurrency(CurrencyType.SEK)
                                           .Build());
            }
            catch (VimConfigException e)
            {
                // Unable to configure VIM
                log.Error($"Unable to configure VIM {e.Message}");
            }
            // Add optional TerminalConnectListener to accept/reject connecting payment terminals
            vim.SetTerminalConnectListener(this);
            // Add mandatory VimListener
            vim.AddVimListener(this);

            // Initialise VIM and start listening for payment terminals
            try
            {
                vim.Initialise();
            }
            catch (InvalidOperationException e)
            {
                // Initialization failed
                log.Error($"Initialization failed {e.Message}");
            }


            //Set terminal MixedConnectionMode
            //InitialisedMixedConnectionMode();
        }