Exemple #1
0
        /// <summary>
        /// Pass the command string to the terminal core for execution, then examine the resulting instructions.
        /// </summary>
        /// <param name="commandString">The command string passed from the command line.</param>
        private static void InvokeCommand(string commandString)
        {
            // Instantiate the Ninject kernel and pass in the pre-defined Ninject Module from Terminal.Core.Ninject.
            var kernel = new StandardKernel(new TerminalBindings(false));

            // Grab the terminal API object from Ninject.
            _terminalApi = kernel.Get <TerminalApi>();

            // Set the username on the API. This tells the API if someone is logged in or not. If nobody is logged in
            // then _username is null by default;
            _terminalApi.Username = _username;
            // Set the CommandContext object. This persists state information between API requests.
            _terminalApi.CommandContext = _commandContext;

            // Launch a separate thread to print a loading message while waiting for the terminal API to execute commands.
            var loadingThread = new Thread(ShowLoading);

            loadingThread.Start();

            // Pass command string to the terminal API. No pre-parsing necessary, just pass the string.
            var commandResult = _terminalApi.ExecuteCommand(commandString);

            // Stop the loading message thread when API returns.
            loadingThread.Abort();
            loadingThread.Join();

            // Pass result object to special method that will determine how to display the results.
            InterpretResult(commandResult);
        }
 public PosPaymentCloudApi(Client client)
     : base(client)
 {
     IsApiKeyRequired            = true;
     _saleToPoiMessageSerializer = new SaleToPoiMessageSerializer();
     _terminalApiAsync           = new TerminalApi(this, true);
     _terminalApiSync            = new TerminalApi(this, false);
 }
 public PosPayment(Client client)
     : base(client)
 {
     _saleToPoiMessageSerializer        = new SaleToPoiMessageSerializer();
     _messageSecuredEncryptor           = new SaleToPoiMessageSecuredEncryptor();
     _saleToPoiMessageSecuredSerializer = new SaleToPoiMessageSecuredSerializer();
     _terminalApiAsync = new TerminalApi(this, true);
     _terminalApiSync  = new TerminalApi(this, false);
 }
        private IPosDataService CreatePosfDatService(Data.DataObjects.Server server, string tenantAlias)
        {
            IAPIConfig apiConfig = new ApiConfig()
            {
                Tenant                 = tenantAlias,
                TerminalId             = Guid.NewGuid().ToString(),
                AuthorizationAddress   = server.AuthorizationAddress,
                BackOfficeAddress      = server.BackofficeAddress,
                OrderServiceAddress    = server.ServiceAddress.ToLowerInvariant().Replace("/terminalservice.svc", "/orderservice.svc"),
                TerminalServiceAddress = server.ServiceAddress
            };
            IBackOfficeApi    b = new BackOfficeApi(apiConfig);
            IAuthorizationApi a = new AuthorizationApi(apiConfig);
            ITerminalApi      t = new TerminalApi(apiConfig, new SerializationService(), new CheckServerConnectionService());
            var posfDatService  = new PosDataService(_container, b, a, t, server.Login, server.Password);

            return(posfDatService);
        }
Exemple #5
0
        /// <summary>
        /// Pass the command string to the terminal API for execution, then examine the resulting instructions.
        /// </summary>
        /// <param name="commandString">The command string passed from the command line.</param>
        private static void InvokeCommand(string commandString)
        {
            var kernel = new StandardKernel(new U413Bindings(false));

            _terminalApi                = kernel.Get <TerminalApi>();
            _terminalApi.Username       = _username;
            _terminalApi.CommandContext = _commandContext;

            var loadingThread = new Thread(ShowLoading);

            loadingThread.Start();

            var commandResult = _terminalApi.ExecuteCommand(commandString);

            loadingThread.Abort();
            loadingThread.Join();

            InterpretResult(commandResult);
        }
Exemple #6
0
 public TerminalApiWrapper(IAPIConfig config, ISerializationService serializationService, ICheckServerConnectionService checkServerConnectionService)
 {
     _api         = new TerminalApi(config, serializationService, checkServerConnectionService);
     _reportItems = new List <ReportItem>();
 }
 public TerminalController(TerminalApi terminalCore)
 {
     _terminalCore = terminalCore;
 }
 public ApiController(TerminalApi terminalApi, IDataBucket dataBucket, UIContext uiContext)
 {
     _terminalApi = terminalApi;
     _dataBucket  = dataBucket;
     _uiContext   = uiContext;
 }
Exemple #9
0
 public TerminalController(TerminalApi terminalApi)
 {
     _terminalApi = terminalApi;
 }
 public GetIntersightTerminalAuditLog()
 {
     ApiInstance = new TerminalApi(Config);
     MethodName  = "GetTerminalAuditLogListWithHttpInfo";
 }