Пример #1
0
        // Methods
        /// <summary>
        /// Create all instances needed to perform MicroPos operations, called on form loading.
        /// </summary>
        /// <param name="sender">Form loading parameters.</param>
        /// <param name="e">Loading event arguments.</param>
        private void Setup(object sender, RoutedEventArgs e)
        {
            // Initialize plataforma desktop
            Microtef.Platform.Desktop.DesktopInitializer.Initialize();

            // Gets the TmsClient to Activation
            this.Tms = TmsProvider.Get("https://tms.stone.com.br/", "https://poihostcommunication.stone.com.br/", "https://localhost:81/");

            // Constrói as mensagens que serão apresentadas na tela do pinpad:
            this.PinpadMessages                  = new DisplayableMessages();
            PinpadMessages.ApprovedMessage       = ":-)";
            PinpadMessages.DeclinedMessage       = ":-(";
            PinpadMessages.InitializationMessage = "Ola";
            PinpadMessages.MainLabel             = "Stone Pagamentos";
            PinpadMessages.ProcessingMessage     = "Processando...";

            this.approvedTransactions = new Collection <IAuthorizationReport>();

            this.Authorizers = DeviceProvider.ActivateAndGetAll(this.stoneCode, PinpadMessages);

            this.uxCbbxAllPinpads.Items.Clear();
            foreach (ICardPaymentAuthorizer c in this.Authorizers)
            {
                this.uxCbbxAllPinpads.Items.Add(c.PinpadFacade.Infos.SerialNumber);
            }

            this.uxBtnCancelTransaction.IsEnabled = false;
        }
Пример #2
0
        private void OnUpdateAllPinpads(object sender, RoutedEventArgs e)
        {
            this.Authorizers = DeviceProvider.ActivateAndGetAll(this.stoneCode, this.PinpadMessages);

            this.uxCbbxAllPinpads.Items.Clear();
            foreach (ICardPaymentAuthorizer c in this.Authorizers)
            {
                this.uxCbbxAllPinpads.Items.Add(c.PinpadFacade.Infos.SerialNumber);
            }
        }
        public static ICollection <GasStationAuthorizer> CreateAll()
        {
            ICollection <ICardPaymentAuthorizer> authorizers = DeviceProvider.ActivateAndGetAll(StoneCode, new DisplayableMessages()
            {
                ApprovedMessage = "Aprovada", DeclinedMessage = "Negada", InitializationMessage = "Iniciando...", MainLabel = "Stone Pagamentos", ProcessingMessage = "Processando..."
            });

            if (authorizers == null || authorizers.Count <= 0)
            {
                return(null);
            }

            ICollection <GasStationAuthorizer> gasAuthorizers = new List <GasStationAuthorizer>();

            foreach (ICardPaymentAuthorizer authorizer in authorizers)
            {
                gasAuthorizers.Add(new GasStationAuthorizer(authorizer));
            }

            return(gasAuthorizers);
        }