Exemple #1
0
        private void DalMonitorManager_OnTransactionRequested(object sender, PaymentActionEventArgs e)
        {
            try
            {
                //SetRequestHeader(e.Header);

                // TODO: change payment action when request is from receiver only
                //if (commHeader.CommIdentifiers[0].Service == ServiceType.Receiver)
                //if (e.LinkRequest.TCCustID != 0)
                //{
                //    PaymentActionEventArgs = e;
                //}

                if (cancellationTokenSource != null)
                {
                    cancellationTokenSource?.Cancel();
                    cancellationTokenSource?.Dispose();
                }

                cancellationTokenSource = new CancellationTokenSource();

                _ = Task.Run(async() => { await Task.Delay(1); })
                    .ContinueWith(async antecedent =>
                {
                    //await TransactionScreen(e);
                    await PaymentScreen(e);
                }, cancellationTokenSource.Token, TaskContinuationOptions.None, syncContextScheduler);
            }
            catch (Exception ex)
            {
                //_ = loggingClient.LogErrorAsync("Exception occurred in DalMonitorManager_OnTransactionRequested.", ex);
            }
        }
Exemple #2
0
        private async Task ProcessManualPayment(PaymentActionEventArgs e)
        {
            await Task.Delay(1);

            //LinkRequest linkRequest = e.LinkRequest;
            //linkRequest.Actions = new List<LinkActionRequest>()
            //{
            //    new LinkActionRequest()
            //    {
            //        MessageID = e.LinkRequest.Actions[0]?.MessageID,
            //        SessionID = e.LinkRequest.Actions[0]?.SessionID,
            //        Action = LinkAction.PaymentUpdate,
            //        DALRequest = e.LinkRequest.Actions[0]?.DALRequest,
            //        DALActionRequest = new LinkDALActionRequest()
            //        {
            //            DALAction = LinkDALActionType.GetManualPAN
            //        },
            //        PaymentUpdateRequest = new XO.Requests.Payment.LinkPaymentUpdateRequest()
            //        {
            //            ManualPayment = true,
            //            ReferenceInformation = e.LinkRequest.Actions[0]?.PaymentRequest?.ReferenceInformation
            //        }
            //    }
            //};

            //_ = loggingClient.LogInfoAsync($"Monitor Sending Event {LinkAction.PaymentUpdate} to {ServiceType.Servicer}");
            //string jsonToPublish = JsonConvert.SerializeObject(linkRequest);
            //_ = loggingClient.LogInfoAsync($"Sending to Listener: {jsonToPublish}").ConfigureAwait(false);
            //await brokerConnector.PublishAsync(jsonToPublish, commHeader, ServiceType.Servicer);
        }
Exemple #3
0
        private async Task PaymentScreen(PaymentActionEventArgs e)
        {
            bool isManualEntry = ShowManualEntryButton(e);

            PaymentView.DataContext = new UIViewModel(e, isManualEntry);
            PaymentView.Topmost     = true;
            PaymentView.Closing    += TransactionView_Closing;
            PaymentView.CancelTransactionBtn.IsEnabled = true;

            await Task.Delay(1);

            PaymentView.ShowDialog();
        }
Exemple #4
0
        private void Startup_Timer_Elapsed(object sender, ElapsedEventArgs e)
        {
            appStartupTimer?.Stop();
            appStartupTimer?.Dispose();

            this.Dispatcher.Invoke((Action) delegate()
            {
                PaymentActionEventArgs ePayment = new PaymentActionEventArgs()
                {
                    SessionId  = "DEADBEEF-BADDCACA",
                    Message    = "Payment",
                    ButtonText = "Cancel Payment",
                    Timeout    = 5000
                };
                DalMonitorManager_OnTransactionRequested(sender, ePayment);
            });
        }
Exemple #5
0
        private async Task TransactionScreen(PaymentActionEventArgs e)
        {
            bool isManualEntry = ShowManualEntryButton(e);

            TransactionView.DataContext = new UIViewModel(e, isManualEntry);
            TransactionView.Topmost     = true;
            TransactionView.Closing    += TransactionView_Closing;
            TransactionView.CancelTransactionBtn.IsEnabled = true;

            // only engage devices support manual entry
            if (isManualEntry)
            {
                TransactionView.ManualEntryBtn.IsEnabled = true;
            }
            else
            {
                TransactionView.CancelTransactionBtn.HorizontalAlignment = HorizontalAlignment.Center;
            }

            await Task.Delay(1);

            TransactionView.ShowDialog();
        }
Exemple #6
0
 private bool ShowManualEntryButton(PaymentActionEventArgs e)
 => false;
Exemple #7
0
 public UIViewModel(PaymentActionEventArgs e, bool manualEntry)
 => (_sessionId, _message, _buttonText, _timeout, _showManualEntryButton) = (e.SessionId, e.Message, e.ButtonText, e.Timeout, manualEntry);