//When this event is fired, it means that the transaction progress has changed, and the developer has a chance to notify the user of the payment application; //In this case we are just printing on the console output but in real applications, you should just have a progress dialog/message to notify the user of your payment application. private static void TransactionOrchestratorOnProgressChanged(TransactionProgress obj) { switch (obj) { case TransactionProgress.Connecting: Console.WriteLine("-------- Connecting --------"); break; case TransactionProgress.Processing: Console.WriteLine("-------- Processing --------"); break; case TransactionProgress.InsertOrSwipeCard: Console.WriteLine("-------- Insert or Swipe a Card --------"); break; case TransactionProgress.EnterPassword: Console.WriteLine("-------- Enter PIN --------"); break; case TransactionProgress.RemoveCard: Console.WriteLine("-------- Remove Card --------"); Console.WriteLine("Press ENTER to close..."); break; case TransactionProgress.UpdateTable: Console.WriteLine("-------- Update Table --------"); break; } }
private void TransactionOrchestratorOnProgressChanged(TransactionProgress obj) { try { string message = string.Empty; if (_progressDialog.IsShowing) { _progressDialog.Dismiss(); } switch (obj) { case TransactionProgress.InsertOrSwipeCard: message = "Insira ou passe o cartão"; break; case TransactionProgress.EnterPassword: message = "Digite a senha"; break; case TransactionProgress.RemoveCard: message = "Retire o cartão"; if (_result != null) { Helpers.Alert(this, "PI - " + _result.OperatorMessage, _result.RAWClientReceipt.Replace('~', '\r'), false, null); return; } break; case TransactionProgress.UpdateTable: message = "Atualizando tabelas..."; break; case TransactionProgress.Connecting: message = "Conectando ao servidor..."; break; case TransactionProgress.Processing: message = "Processando..."; break; } if (!string.IsNullOrWhiteSpace(message)) { _progressDialog = ProgressDialog.Show(this, "PI - Transaction", message, true); } } catch (Exception ex) { Helpers.Alert(this, "PI - TransactionOrchestratorOnProgressChanged - Error", ex.Message, false); } }
private void TransactionOrchestratorOnProgressChanged(TransactionProgress obj) { try { string message = string.Empty; if (_progressDialog.IsShowing) { _progressDialog.Dismiss(); } switch (obj) { case TransactionProgress.InsertOrSwipeCard: message = "Insira ou passe o cartão"; break; case TransactionProgress.EnterPassword: message = "Digite a senha"; break; case TransactionProgress.RemoveCard: message = "Retire o cartão"; if (_result != null) { Helpers.Alert(this, "PI - " + _result.OperatorMessage, _result.RAWClientReceipt.Replace('~','\r'), false, null); return; } break; case TransactionProgress.UpdateTable: message = "Atualizando tabelas..."; break; case TransactionProgress.Connecting: message = "Conectando ao servidor..."; break; case TransactionProgress.Processing: message = "Processando..."; break; } if (!string.IsNullOrWhiteSpace(message)) { _progressDialog = ProgressDialog.Show(this, "PI - Transaction", message, true); } } catch (Exception ex) { Helpers.Alert(this, "PI - TransactionOrchestratorOnProgressChanged - Error", ex.Message, false); } }