Index: main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/helpers.py
===================================================================
--- main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/helpers.py	(revision 15731)
+++ main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/helpers.py	(revision 15734)
@@ -30,4 +30,22 @@
 from waeup.kofa.utils.helpers import extract_formvars
 from kofacustom.nigeria.interfaces import MessageFactory as _
+
+ERROR_PART1 = (
+        'PayeeName=N/A~'
+        + 'Faculty=N/A~'
+        + 'Department=N/A~'
+        + 'Level=N/A~'
+        + 'ProgrammeType=N/A~'
+        + 'StudyType=N/A~'
+        + 'Session=N/A~'
+        + 'PayeeID=N/A~'
+        + 'Amount=N/A~'
+        + 'FeeStatus=')
+ERROR_PART2 = (
+        '~Semester=N/A~'
+        + 'PaymentType=N/A~'
+        + 'MatricNumber=N/A~'
+        + 'Email=N/A~'
+        + 'PhoneNumber=N/A')
 
 def write_payments_log(id, payment):
Index: main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/payoutletwebservice.py
===================================================================
--- main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/payoutletwebservice.py	(revision 15731)
+++ main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/payoutletwebservice.py	(revision 15734)
@@ -23,22 +23,5 @@
 from waeup.kofa.payments.interfaces import IPayer
 from waeup.kofa.webservices import PaymentDataWebservice
-
-ERROR_PART1 = (
-        'PayeeName=N/A~'
-        + 'Faculty=N/A~'
-        + 'Department=N/A~'
-        + 'Level=N/A~'
-        + 'ProgrammeType=N/A~'
-        + 'StudyType=N/A~'
-        + 'Session=N/A~'
-        + 'PayeeID=N/A~'
-        + 'Amount=N/A~'
-        + 'FeeStatus=')
-ERROR_PART2 = (
-        '~Semester=N/A~'
-        + 'PaymentType=N/A~'
-        + 'MatricNumber=N/A~'
-        + 'Email=N/A~'
-        + 'PhoneNumber=N/A')
+from kofacustom.nigeria.etranzact.helpers import ERROR_PART1, ERROR_PART2
 
 class NigeriaPaymentDataWebservice(PaymentDataWebservice):
@@ -74,6 +57,6 @@
                 return
         payment_cats_dict = getUtility(IKofaUtils).PAYMENT_CATEGORIES
-        if PAYMENT_TYPE not in self.CATEGORY_MAPPING.keys() \
-            and PAYMENT_TYPE.lower() not in payment_cats_dict.keys():
+        if not PAYMENT_TYPE or (PAYMENT_TYPE not in self.CATEGORY_MAPPING.keys() \
+            and PAYMENT_TYPE.lower() not in payment_cats_dict.keys()):
             self.output = ERROR_PART1 + 'Invalid PAYMENT_TYPE' + ERROR_PART2
             return
Index: main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/tests.py
===================================================================
--- main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/tests.py	(revision 15731)
+++ main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/tests.py	(revision 15734)
@@ -32,5 +32,6 @@
 from kofacustom.nigeria.students.payments import NigeriaStudentOnlinePayment
 from kofacustom.nigeria.testing import FunctionalLayer
-from kofacustom.nigeria.etranzact.helpers import query_history, query_payoutlet
+from kofacustom.nigeria.etranzact.helpers import (
+    query_history, query_payoutlet, ERROR_PART1, ERROR_PART2)
 
 #from kofacustom.nigeria.etranzact.helpers import (query_etranzact)
@@ -269,2 +270,48 @@
         self.assertEqual(self.payment.r_desc, 'Test Test Test-CLEARANCE -001-p5723474039401')
         return
+
+    def test_webservice(self):
+        self.browser.open(
+            'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=SCHOOLFEE'
+            % self.payment.p_id)
+        self.assertEqual(self.browser.contents,
+            'PayeeName=Anna Tester~'
+            'Faculty=fac1~Department=dep1~'
+            'Level=100~ProgrammeType=CERT1~'
+            'StudyType=ug_ft~Session=2004/2005~'
+            'PayeeID=%s~'
+            'Amount=40000.0~FeeStatus=unpaid~'
+            'Semester=N/A~PaymentType=School Fee~'
+            'MatricNumber=234~Email=aa@aa.ng~'
+            'PhoneNumber=1234' % self.payment.p_id)
+        self.browser.open('http://localhost/app/feerequest')
+        self.assertEqual(self.browser.contents, ERROR_PART1 + 'Missing PAYEE_ID' + ERROR_PART2)
+
+        self.browser.open('http://localhost/app/feerequest?NONSENSE=nonsense')
+        self.assertEqual(self.browser.contents, ERROR_PART1 + 'Missing PAYEE_ID' + ERROR_PART2)
+
+        self.browser.open(
+            'http://localhost/app/feerequest?PAYEE_ID=nonsense&PAYMENT_TYPE=SCHOOLFEE')
+        self.assertEqual(self.browser.contents, ERROR_PART1 + 'Invalid PAYEE_ID' + ERROR_PART2)
+
+        self.browser.open(
+            'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=NONSENSE'
+            % self.payment.p_id)
+        self.assertEqual(self.browser.contents, ERROR_PART1 + 'Invalid PAYMENT_TYPE' + ERROR_PART2)
+
+        self.browser.open(
+            'http://localhost/app/feerequest?PAYEE_ID=%s' % self.payment.p_id)
+        self.assertEqual(self.browser.contents, ERROR_PART1 + 'Invalid PAYMENT_TYPE' + ERROR_PART2)
+
+        self.browser.open(
+            'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=CLEARANCE'
+            % self.payment.p_id)
+        self.assertEqual(self.browser.contents, ERROR_PART1 + 'Wrong PAYMENT_TYPE' + ERROR_PART2)
+
+        # Change payment state
+        self.student['payments'][self.payment.p_id].p_state = 'paid'
+
+        self.browser.open(
+            'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=SCHOOLFEE'
+            % self.payment.p_id)
+        self.assertEqual(self.browser.contents, ERROR_PART1 + 'PAYEE_ID already used' + ERROR_PART2)
