private void HandleFinishedGetLastTransaction(TransactionFlowState txState) { if (txState.Response != null) { var gltResponse = new GetLastTransactionResponse(txState.Response); if (_lastCmd.Length > 1) { // User specified that he intended to retrieve a specific tx by pos_ref_id // This is how you can use a handy function to match it. var success = _spi.GltMatch(gltResponse, _lastCmd[1]); if (success == Message.SuccessState.Unknown) { Console.WriteLine("# Did not retrieve Expected Transaction. Here is what we got:"); } else { Console.WriteLine("# Tx Matched Expected Purchase Request."); } } var purchaseResponse = new PurchaseResponse(txState.Response); Console.WriteLine("# Scheme: {0}", purchaseResponse.SchemeName); Console.WriteLine("# Response: {0}", purchaseResponse.GetResponseText()); Console.WriteLine("# RRN: {0}", purchaseResponse.GetRRN()); Console.WriteLine("# Error: {0}", txState.Response.GetError()); Console.WriteLine("# Customer Receipt:"); Console.WriteLine(purchaseResponse.GetCustomerReceipt().TrimEnd()); } else { // We did not even get a response, like in the case of a time-out. Console.WriteLine("# Could Not Retrieve Last Transaction."); } }