Index: main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/browser_templates/requery_etranzact.pt
===================================================================
--- main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/browser_templates/requery_etranzact.pt	(revision 15592)
+++ main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/browser_templates/requery_etranzact.pt	(revision 15593)
@@ -12,5 +12,5 @@
           Transaction Id:</td>
         <td>
-          <span tal:replace="view/context/p_id">TRANSID</span>
+          <span tal:replace="view/transaction_id">TRANSID</span>
         </td>
       </tr>
Index: main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/helpers.py
===================================================================
--- main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/helpers.py	(revision 15592)
+++ main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/helpers.py	(revision 15593)
@@ -54,7 +54,4 @@
         return 'Connection error (%s, %s)' % (response.status, response.reason)
     resp = response.read()
-    resp = resp.replace('\r\n','')
-    # eTranzact sends strange HTML tags which must be removed.
-    resp = re.sub("<.*?>", "", resp)
     return resp
 
Index: main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/tests.py
===================================================================
--- main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/tests.py	(revision 15592)
+++ main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/tests.py	(revision 15593)
@@ -115,8 +115,7 @@
         response = query_history(HOST, self.terminal_id,
                                 transaction_id, HTTPS, 'http://xxxxx')
-        self.assertEqual(
-            response,
+        self.assertTrue(
             'Transaction with the given transaction_id (%s) not found'
-            % transaction_id)
+            % transaction_id in response)
         # Okay, let's create a transaction
         caller_response = create_transaction(transaction_id)
@@ -126,8 +125,23 @@
         query_response = query_history(HOST, self.terminal_id,
                                 transaction_id, HTTPS, 'http://xxxxx')
-        self.assertEqual(query_response, '')
+        self.assertTrue(
+            '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"\r\n    '
+            '"http://www.w3.org/TR/html4/loose.dtd">' in query_response)
         # The same, an 'empty' response obviously means that the transaction
-        # was found. The result was  sent to the response_url (see below).
-        # We need browser tests.
+        # was found but no result was  sent to the response_url because the
+        # payment was cancelled.
+
+        # Peter: No response would be returned because payment status information
+        # was not saved. Whenever you get a null response, means payment was
+        # not received only payments with error code 0 is successful.
+        # So in this case transaction fails.
+
+        # Peter has manually created a successful payment. Let's use this one.
+        transaction_id = 'etz1568638104web'
+        query_response = query_history(HOST, self.terminal_id,
+                                transaction_id, HTTPS, 'http://xxxxx')
+        # Now eTranzact is redirecting but the response is still useless
+        print query_response
+        self.assertTrue('Redirecting...' in query_response)
         return
 
@@ -163,5 +177,4 @@
         self.browser.getLink("Pay via eTranzact").click()
         self.assertTrue("Pay now" in self.browser.contents)
-        # Means of testing end here. We have to manually
         # create an eTranzact transaction.
         logo_url = 'http://xxxx'
@@ -178,4 +191,15 @@
                    customer.display_fullname, hashvalue,
                    logo_url)
+        self.browser.open(self.payment_url + '/requery_history')
+        # Means of testing end here.
+
+        #hashargs = 	amount + TERMINAL_ID + 'etz1568638104web' \
+        #    + responseurl + 'DEMO_KEY'
+        #hashvalue = hashlib.md5(hashargs).hexdigest()
+        #self.browser.open(self.payment_url + '/requery_history')
+        #self.browser.getControl("Requery now").click()
+        #import pdb; pdb.set_trace()
+
+
         return
 
