Index: main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_webservices.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_webservices.py	(revision 16192)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_webservices.py	(revision 16193)
@@ -799,4 +799,96 @@
                                    )
         self.assertEqual(xmlout, response)
+        return
+
+    def test_get_payment(self):
+        payment1 = StudentOnlinePayment()
+        payment1.p_id = 'my-id1'
+        payment1.p_session = 2012
+        payment1.amount_auth = 12.12
+        payment1.p_state = u'failed'
+        payment1.p_category = u'schoolfee'
+        payment1.r_company = u'xyz'
+        self.student['payments']['my-payment1'] = payment1
+        server = ServerProxy('http://mgr:mgrpw@localhost/app', allow_none=True)
+        results = server.get_payment()
+        self.assertEqual(results, None)
+        results = server.get_payment('nonsense')
+        self.assertEqual(results, None)
+        results = server.get_payment('my-id1')
+        self.assertEqual(
+            results,
+                {'display_item': None,
+                'p_id': 'my-id1',
+                'p_category': 'schoolfee',
+                'amount_auth': 12.12, 'p_session': 2012,
+                'p_state': 'failed',
+                'r_company': 'xyz',
+                'fullname': 'Anna Tester',
+                'id': 'K1000000',
+                'matric_number': '234'}
+                )
+
+        REQUEST_XML = """\
+<?xml version="1.0"?>
+<methodCall>
+<methodName>get_payment</methodName>
+<params>
+<param>
+<value><string>my-id1</string></value>
+</param>
+</params>
+</methodCall>"""
+        RESPONSE_XML = """\
+<?xml version='1.0'?>
+<methodResponse>
+<params>
+<param>
+<value><struct>
+<member>
+<name>display_item</name>
+<value><nil/></value></member>
+<member>
+<name>amount_auth</name>
+<value><double>12.12</double></value>
+</member>
+<member>
+<name>p_id</name>
+<value><string>my-id1</string></value>
+</member>
+<member>
+<name>r_company</name>
+<value><string>xyz</string></value>
+</member>
+<member>
+<name>matric_number</name>
+<value><string>234</string></value>
+</member>
+<member>
+<name>p_category</name>
+<value><string>schoolfee</string></value>
+</member>
+<member>
+<name>fullname</name>
+<value><string>Anna Tester</string></value>
+</member>
+<member>
+<name>p_state</name>
+<value><string>failed</string></value>
+</member>
+<member>
+<name>p_session</name>
+<value><int>2012</int></value>
+</member>
+<member>
+<name>id</name>
+<value><string>K1000000</string></value>
+</member>
+</struct></value>
+</param>
+</params>
+</methodResponse>
+"""
+        xmlout = self.XMLRPC_post(REQUEST_XML)
+        self.assertEqual(xmlout, RESPONSE_XML)
         return
 
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/webservices.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/webservices.py	(revision 16192)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/webservices.py	(revision 16193)
@@ -420,7 +420,29 @@
 
     @grok.require('waeup.xmlrpc')
+    def get_payment(self, p_id='non_existent'):
+        """Returns payment and payer data of payment tickets with specific p_id.
+        """
+        cat = getUtility(ICatalog, name='payments_catalog')
+        result = list(cat.searchResults(p_id=(p_id, p_id)))
+        if not len(result):
+            return None
+        payment =  result[0]
+        return dict(
+                p_id=payment.p_id,
+                amount_auth=payment.amount_auth,
+                p_category=payment.p_category,
+                display_item=payment.display_item,
+                p_session=payment.p_session,
+                p_state=payment.p_state,
+                r_company=getattr(payment, 'r_company', None),
+                id = IPayer(payment).id,
+                matric_number = IPayer(payment).matric_number,
+                fullname = IPayer(payment).display_fullname,
+                )
+
+    @grok.require('waeup.xmlrpc')
     def get_unpaid_payments(self, days=3, company=None):
-        """Returns the p_ids of unpaid payment tickets which have
-        been created during the past days.
+        """Returns the payment and payer data of unpaid payment
+        tickets which have been created during the past days.
         """
         days_in_seconds = 86400 * int(days)
