void ViewModelProcessed(object sender, OnProcessedArgs args)
        {
            var processType = args.ProcessType;
            var gratuity    = _viewModel.Gratuity;
            var ticket      = SelectedTicket;

            InteractionService.UserIntraction.DeblurMainWindow();
            _view.Close();

            var result = new CreditCardProcessingResult {
                ProcessType = processType
            };

            if (processType == ProcessType.PreAuth)
            {
                result.Amount = Preauth(_view.SwipeDataBox.SecurePassword, ticket, _viewModel.TenderedAmount, gratuity);
            }

            if (processType == ProcessType.Force)
            {
                result.Amount = Force(_view.SwipeDataBox.SecurePassword, ticket, _viewModel.TenderedAmount, gratuity);
            }

            result.PublishEvent(EventTopicNames.PaymentProcessed);
        }
        private void OnPreAuth()
        {
            var args = new OnProcessedArgs {
                ProcessType = ProcessType.PreAuth
            };

            InvokeProcessed(args);
        }
        private void InvokeProcessed(OnProcessedArgs args)
        {
            OnProcessed handler = Processed;

            if (handler != null)
            {
                handler(this, args);
            }
        }
        void ViewModelProcessed(object sender, OnProcessedArgs args)
        {
            var processType = args.ProcessType;
            var gratuity = _viewModel.Gratuity;
            var ticket = SelectedTicket;

            InteractionService.UserIntraction.DeblurMainWindow();
            _view.Close();

            var result = new CreditCardProcessingResult { ProcessType = processType };

            if (processType == ProcessType.PreAuth)
                result.Amount = Preauth(_view.SwipeDataBox.SecurePassword, ticket, _viewModel.TenderedAmount, gratuity);

            if (processType == ProcessType.Force)
                result.Amount = Force(_view.SwipeDataBox.SecurePassword, ticket, _viewModel.TenderedAmount, gratuity);

            result.PublishEvent(EventTopicNames.PaymentProcessed);
        }
 private void OnPreAuth()
 {
     var args = new OnProcessedArgs { ProcessType = ProcessType.PreAuth };
     InvokeProcessed(args);
 }
 private void InvokeProcessed(OnProcessedArgs args)
 {
     OnProcessed handler = Processed;
     if (handler != null) handler(this, args);
 }