Exemplo n.º 1
0
        private void metroButton5_Click(object sender, EventArgs e)
        {
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                var dsiEMVX        = new DSIEMVXLib.DsiEMVX();
                var emvTransaction = EMVTransactions.EMVParamDownload;
                var configData     = new ConfigurationData();

                var request = EMVRequest.GetEMVParamDownloadRequest(configData, GetTransData());

                MessageBox.Show(request);

                DateTime startTime = DateTime.Now;

                var transactionProcessFactory = new TransactionProcessFactory();
                var emvTxnProcessor           = transactionProcessFactory.GetObject(emvTransaction);
                emvTxnProcessor.Request = request;
                emvTxnProcessor.Process(dsiEMVX, configData, GetTransData());

                TimeSpan ts = DateTime.Now.Subtract(startTime);
                //this.lblClock.Text = string.Format("{0}:{1}:{2}.{3}", ts.Hours.ToString("0#"), ts.Minutes.ToString("0#"), ts.Seconds.ToString("0#"), ts.Milliseconds.ToString("#"));
                MessageBox.Show(emvTxnProcessor.Response);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                Cursor.Current = Cursors.Arrow;
            }
        }
Exemplo n.º 2
0
        private void btnSendTransaction_Click(object sender, EventArgs e)
        {
            Cursor.Current   = Cursors.WaitCursor;
            txtResponse.Text = string.Empty;

            DateTime startTime = DateTime.Now;

            var transactionProcessFactory = new TransactionProcessFactory();
            var emvTxnProcessor           = transactionProcessFactory.GetObject(emvTransaction);

            emvTxnProcessor.Request = txtRequest.Text;
            emvTxnProcessor.Process(dsiEMVX, configData, GetTransData());

            TimeSpan ts = DateTime.Now.Subtract(startTime);

            this.lblClock.Text = string.Format("{0}:{1}:{2}.{3}", ts.Hours.ToString("0#"), ts.Minutes.ToString("0#"), ts.Seconds.ToString("0#"), ts.Milliseconds.ToString("#"));

            txtResponse.Text = emvTxnProcessor.Response;

            Cursor.Current = Cursors.Arrow;
        }