private void StartCardScanner()
        {
            try
            {
                long amount      = (long)(Convert.ToDouble(totalAmount.Total) * 100);
                long amountOther = 0;
                tr = new TransactionRequest(amount + amountOther, amountOther, TransactionTypeEnum.PurchaseGoodsAndServices);

                cardApp = new EMVTerminalApplication(new CardQProcessor(cardInterfaceManger, SessionSingleton.DeviceId), configProvider);
                cardApp.UserInterfaceRequest += Ta_UserInterfaceRequest;
                cardApp.ProcessCompleted     += Ta_ProcessCompleted;
                cardApp.ExceptionOccured     += Ta_ExceptionOccured;
                cardApp.StartTransactionRequest(tr);
            }
            catch (Exception ex)
            {
                SetStatusLabel(ex.Message);
            }
        }
示例#2
0
        private async void CmdProcess_Click(object sender, EventArgs e)
        {
            try
            {
                SetProcessButtonEnabled(false);
                TransactionRequest tr  = new TransactionRequest(transactionVM.Amount + transactionVM.AmountOther, transactionVM.AmountOther, (TransactionTypeEnum)cmbTransactionType.SelectedItem);
                List <string>      ids = (await cardInterfaceManger.GetCardReaders()).Where(x => x.ToLower().Contains("contactless")).ToList();
                if (ids.Count == 0)
                {
                    await App.Current.MainPage.DisplayAlert("Error", "No contactless reader found", "OK");

                    return;
                }
                ta = new EMVTerminalApplication(new CardQProcessor(cardInterfaceManger, ids[0]), configProvider);
                ta.UserInterfaceRequest += Ta_UserInterfaceRequest;
                ta.ProcessCompleted     += Ta_ProcessCompleted;
                ta.ExceptionOccured     += Ta_ExceptionOccured;
                ta.StartTransactionRequest(tr);
            }
            catch (Exception ex)
            {
                SetStatusLabel(ex.Message);
            }
        }