コード例 #1
0
 /// <summary>
 /// Constructor with values. Initialize SimpleMessages with specified values.
 /// </summary>
 /// <param name="firstLine">First line with up to 16 characters long message, if using padding.</param>
 /// <param name="secondLine">Second line with up to 16 characters long message, if using padding.</param>
 /// <param name="padding">Padding to use when requested or Undefined to fire exceptions if requested.</param>
 public SimpleMessageProperty(string firstLine, string secondLine, DisplayPaddingType padding = DisplayPaddingType.Center)
     : this()
 {
     this.Padding    = padding;
     this.FirstLine  = firstLine;
     this.SecondLine = secondLine;
 }
コード例 #2
0
        // Transaction Methods
        /// <summary>
        /// On Pinpad screen, alternates between "RETIRE O CARTÃO" and parameter 'message' received, until card removal.
        /// </summary>
        /// <param name="message">Message to be shown on pinpad screen. Must not exceed 16 characters. This message remains on Pinpad screen after card removal.</param>
        /// <param name="padding">Message alignment.</param>
        /// <returns></returns>
        public bool RemoveCard(string message, DisplayPaddingType padding)
        {
            RmcRequest request = new RmcRequest();

            // Assemblies RMC command.
            request.RMC_MSG.Value = new SimpleMessageProperty(message, padding);

            // Sends command and receive response
            GenericResponse response = null;

            while (response == null)
            {
                response = this.pinpadCommunication.SendRequestAndReceiveResponse <GenericResponse>(request);
            }

            // Getting legacy response status code:
            AbecsResponseStatus legacyStatus = AbecsResponseStatus.ST_OK;

            // Mapping legacy status code into Pinpad.Sdk response status code.
            this.LastCommandStatus = ResponseStatusMapper.MapLegacyResponseStatus(legacyStatus);

            // Verifies if the command was executed.
            if (this.LastCommandStatus == ResponseStatus.Ok)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #3
0
        /// <summary>
        /// Show something in pinpad display.
        /// </summary>
        /// <param name="firstLine">Message presented in the first line.</param>
        /// <param name="secondLine">Message presented in the second line.</param>
        /// <param name="padding">Alignment.</param>
        /// <param name="waitForWey">Whether the pinpad should wait for a key.</param>
        public void ShowSomething(string firstLine, string secondLine, DisplayPaddingType padding, bool waitForWey = false)
        {
            this.authorizer.PinpadController.Display.ShowMessage(firstLine, secondLine, padding);

            Task waitForKeyTask = new Task(() =>
            {
                if (waitForWey == true)
                {
                    PinpadKeyCode key = PinpadKeyCode.Undefined;
                    do
                    {
                        key = this.authorizer.PinpadController.Keyboard.GetKey();
                    } while (key == PinpadKeyCode.Undefined);
                }
            });

            waitForKeyTask.Start();
            waitForKeyTask.Wait();
        }
コード例 #4
0
 // Constructor
 /// <summary>
 /// Constructor with values. Initialize SimpleMessages with specified values.
 /// </summary>
 /// <param name="fullValue">32 characters message, 16 characters each line.</param>
 /// <param name="padding">Alignment to the message to be present on pinpad display.</param>
 public SimpleMessageProperty(string fullValue, DisplayPaddingType padding = DisplayPaddingType.Undefined)
     : this()
 {
     this.Padding   = padding;
     this.FullValue = fullValue;
 }