Index: /main/waeup.custom/trunk/src/waeup/custom/interswitch/browser.py
===================================================================
--- /main/waeup.custom/trunk/src/waeup/custom/interswitch/browser.py	(revision 7897)
+++ /main/waeup.custom/trunk/src/waeup/custom/interswitch/browser.py	(revision 7898)
@@ -17,5 +17,7 @@
 ##
 from datetime import datetime
-from urllib import urlencode
+import httplib
+import urllib
+from xml.dom.minidom import parseString
 import grok
 from waeup.kofa.browser.layout import KofaPage, UtilityView
@@ -39,4 +41,44 @@
 POST_ACTION = 'https://testwebpay.interswitchng.com/test_paydirect/webpay/pay.aspx'
 
+HOST = 'testwebpay.interswitchng.com'
+URL = '/test_paydirect/services/TransactionQueryWs.asmx'
+httplib.HTTPConnection.debuglevel = 0
+
+def SOAP_post(soap_action,xml):
+    """Handles making the SOAP request.
+
+    Further reading:
+    http://testwebpay.interswitchng.com/test_paydirect/services/TransactionQueryWs.asmx?op=getTransactionData
+    """
+    h = httplib.HTTPConnection(HOST)
+    headers={
+        'Host':HOST,
+        'Content-Type':'text/xml; charset=utf-8',
+        'Content-Length':len(xml),
+        'SOAPAction':'"%s"' % soap_action,
+    }
+    h.request('POST', URL, body=xml,headers=headers)
+    r = h.getresponse()
+    d = r.read()
+    if r.status!=200:
+        raise ValueError('Error connecting: %s, %s' % (r.status, r.reason))
+    return d
+
+def get_SOAP_response(product_id, transref):
+    xml="""\
+<?xml version="1.0" encoding="utf-8"?>
+<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
+  <soap:Body>
+    <getTransactionData xmlns="http://tempuri.org/">
+      <product_id>%s</product_id>
+      <trans_ref>%s</trans_ref>
+    </getTransactionData>
+  </soap:Body>
+</soap:Envelope>""" % (product_id, transref)
+    result_xml=SOAP_post("http://tempuri.org/getTransactionData",xml)
+    doc=parseString(result_xml)
+    response=doc.getElementsByTagName('getTransactionDataResult')[0].firstChild.data
+    return response
+
 class InterswitchActionButton(RequestCallbackActionButton):
     grok.order(2)
@@ -64,5 +106,5 @@
             'prodID':PRODUCT_ID,
             'redirectURL':site_redirect_url}
-        return QUERY_URL + '?%s' % urlencode(args)
+        return QUERY_URL + '?%s' % urllib.urlencode(args)
 
 class InterswitchPage(KofaPage):
@@ -160,5 +202,9 @@
 
         # Add webservice validation
-
+        validation_list = get_SOAP_response(
+            PRODUCT_ID, self.context.p_id).split(':')
+        # Validation does not make sense yet since the query string 
+        # formats are conflicting.
+        print validation_list
 
         write_log_message(self,'valid callback: %s' % self.context.p_id)
