public static UserInterfaceRequest ProtocolActivation(
            EntryPointEnum entryPoint,
            TransactionRequest transactionRequest,
            List <Tuple <TerminalSupportedKernelAidTransactionTypeCombination, EntryPointPreProcessingIndicators> > preProcessingIndicators,
            EMVTerminalProcessingOutcome preProcessingOutcome,
            bool restart)
        {
            #region 3.2.1.1
            if (!restart)
            #endregion
            {
                if (entryPoint == EntryPointEnum.StartB)
                {
                    List <Tuple <TerminalSupportedKernelAidTransactionTypeCombination, EntryPointPreProcessingIndicators> > preProcessingIndicatorsNew = new List <Tuple <TerminalSupportedKernelAidTransactionTypeCombination, EntryPointPreProcessingIndicators> >();
                    //3.2.1.1
                    foreach (Tuple <TerminalSupportedKernelAidTransactionTypeCombination, EntryPointPreProcessingIndicators> kc in preProcessingIndicators)
                    {
                        preProcessingIndicatorsNew.Add(Tuple.Create(kc.Item1, new EntryPointPreProcessingIndicators()));
                    }

                    preProcessingIndicators = preProcessingIndicatorsNew;

                    foreach (Tuple <TerminalSupportedKernelAidTransactionTypeCombination, EntryPointPreProcessingIndicators> kc in preProcessingIndicators)
                    {
                        if (((TerminalSupportedContactlessKernelAidTransactionTypeCombination)kc.Item1).TTQ != null)
                        {
                            kc.Item2.TTQ = (TERMINAL_TRANSACTION_QUALIFIERS_9F66_KRN)((TerminalSupportedContactlessKernelAidTransactionTypeCombination)kc.Item1).TTQ.Clone();
                            kc.Item2.TTQ.Value.OnlineCryptogramRequired = false;
                            kc.Item2.TTQ.Value.CVMRequired = false;
                        }
                    }
                }
                //clear the candidate list
            }
            #region 3.2.1.2
            else
            #endregion
            {
                if (preProcessingOutcome.UIRequestOnRestartPresent)
                {
                    return(preProcessingOutcome.UserInterfaceRequest);
                }
            }
            #region 3.2.1.2
            if (!restart || (preProcessingOutcome != null && !preProcessingOutcome.UIRequestOnRestartPresent))
            #endregion
            {
                UserInterfaceRequest userInterfaceRequest = new UserInterfaceRequest()
                {
                    MessageIdentifier = MessageIdentifiersEnum.PresentCard,
                    Status            = StatusEnum.ReadyToRead,
                };
                return(userInterfaceRequest);
            }
            return(null);
        }
Ejemplo n.º 2
0
        public static UserInterfaceRequest ProtocolActivation()
        {
            UserInterfaceRequest userInterfaceRequest = new UserInterfaceRequest()
            {
                MessageIdentifier = MessageIdentifiersEnum.PresentCard,
                Status            = StatusEnum.ReadyToRead,
            };

            return(userInterfaceRequest);
        }
        public void CancelTransactionRequest()
        {
            StopTerminalApplication();

            EMVTerminalProcessingOutcome processingOutcomeOUT = new EMVTerminalProcessingOutcome()
            {
                NextProcessState          = EMVTerminalPreProcessingStateEnum.EndProcess,
                UIRequestOnOutcomePresent = true
            };
            UserInterfaceRequest uird = new UserInterfaceRequest()
            {
                MessageIdentifier = MessageIdentifiersEnum.ClearDisplay,
                Status            = StatusEnum.ReadyToRead
            };

            processingOutcomeOUT.UserInterfaceRequest = uird;
            OnProcessCompleted(processingOutcomeOUT);
        }
Ejemplo n.º 4
0
        protected async Task ProtocolActivation_B()
        {
            cardInField = false;
            UserInterfaceRequest request = EMVContactlessProtocolActivation.ProtocolActivation(EntryPointEnum.StartA, tr, preProcessingValues, null, false);

            if (request != null)
            {
                OnUserInterfaceRequest(new UIMessageEventArgs(request.MessageIdentifier, request.Status));
            }
            await Task.Run(() =>
            {
                while (!cardInField)
                {
                    if (cancellationTokenForPreProcessing.Token.IsCancellationRequested)
                    {
                        break;
                    }
                }
            });

            return;
        }
        public void CancelTransactionRequest()
        {
            cardQProcessor.StopServiceQProcess();
            //StopServiceQProcess();
            if (cancellationTokenForPreProcessing != null)
            {
                cancellationTokenForPreProcessing.Cancel();
            }

            TerminalProcessingOutcome processingOutcomeOUT = new TerminalProcessingOutcome()
            {
                NextProcessState          = EMVTerminalPreProcessingStateEnum.EndProcess,
                UIRequestOnOutcomePresent = true
            };
            UserInterfaceRequest uird = new UserInterfaceRequest()
            {
                MessageIdentifier = MessageIdentifiersEnum.ClearDisplay,
                Status            = StatusEnum.ReadyToRead
            };

            processingOutcomeOUT.UserInterfaceRequest = uird;
            OnProcessCompleted(processingOutcomeOUT);
        }
 protected void OnUserInterfaceRequest(UIMessageEventArgs e)
 {
     UserInterfaceRequest?.Invoke(this, e);
 }