Index: /main/waeup.uniben/trunk/src/waeup/uniben/interswitch/browser.py
===================================================================
--- /main/waeup.uniben/trunk/src/waeup/uniben/interswitch/browser.py	(revision 9383)
+++ /main/waeup.uniben/trunk/src/waeup/uniben/interswitch/browser.py	(revision 9384)
@@ -229,47 +229,55 @@
         xmldict['provider_bank_id'] = PROVIDER_BANK_ID
         xmldict['provider_item_name'] = PROVIDER_ITEM_NAME
-        if student.current_mode.endswith('_ft') \
-            and student.state == RETURNING:
-            provider_amt = 600
-        else:
-            provider_amt = 1500
-        xmldict['provider_amt'] = 100 * provider_amt
         # Institution data
-        studycourse = student['studycourse']
         xmldict['institution_acct'] = ''
         xmldict['institution_bank_id'] = ''
-        if student.current_mode.endswith('_ft'):
-            #post-grad full-time students of all faculties
-            if student.is_postgrad:
-                xmldict['institution_acct'] = '1012842833'
-                xmldict['institution_bank_id'] = '117'
-            #all other part-time students depending on faculty
-            elif student.faccode in ('SSC','LAW','MED'):
-                xmldict['institution_acct'] = '0005986938'
-                xmldict['institution_bank_id'] = '31'
-            elif student.faccode in ('ENG','PSC','PHA'):
-                xmldict['institution_acct'] = '0014413973'
-                xmldict['institution_bank_id'] = '129'
-            elif student.faccode in ('LSC','DEN','AGR'):
-                xmldict['institution_acct'] = '1012801319'
-                xmldict['institution_bank_id'] = '117'
-            elif student.faccode in ('ART','EDU','MGS','BMS'):
-                xmldict['institution_acct'] = '6220027556'
-                xmldict['institution_bank_id'] = '51'
-        elif student.current_mode.endswith('_pt'):
-            #post-grad part-time students of all faculties
-            if student.is_postgrad:
-                xmldict['institution_acct'] = '0023708207'
-                xmldict['institution_bank_id'] = '72'
-            #all other part-time students depending on faculty
-            elif student.faccode in ('ENG','LAW','MGS'):
-                xmldict['institution_acct'] = '2019006824'
-                xmldict['institution_bank_id'] = '8'
-            elif student.faccode in ('IPA','PHA','SSC','AGR','EDU'):
-                xmldict['institution_acct'] = '0122012109'
-                xmldict['institution_bank_id'] = '16'
-        xmldict['institution_amt'] = 100 * (self.context.amount_auth - provider_amt - 150)
-        xmldict['institution_item_name'] = self.context.p_category
+        xmldict['institution_amt'] = '0.0'
+        if self.context.p_category == 'schoolfee':
+            if student.current_mode.endswith('_ft') \
+                and student.state == RETURNING:
+                provider_amt = 600
+            else:
+                provider_amt = 1500
+            #studycourse = student['studycourse']
+            if student.current_mode.endswith('_ft'):
+                #post-grad full-time students of all faculties
+                if student.is_postgrad:
+                    xmldict['institution_acct'] = '1012842833'
+                    xmldict['institution_bank_id'] = '117'
+                #all other part-time students depending on faculty
+                elif student.faccode in ('SSC','LAW','MED'):
+                    xmldict['institution_acct'] = '0005986938'
+                    xmldict['institution_bank_id'] = '31'
+                elif student.faccode in ('ENG','PSC','PHA'):
+                    xmldict['institution_acct'] = '0014413973'
+                    xmldict['institution_bank_id'] = '129'
+                elif student.faccode in ('LSC','DEN','AGR'):
+                    xmldict['institution_acct'] = '1012801319'
+                    xmldict['institution_bank_id'] = '117'
+                elif student.faccode in ('ART','EDU','MGS','BMS'):
+                    xmldict['institution_acct'] = '6220027556'
+                    xmldict['institution_bank_id'] = '51'
+            elif student.current_mode.endswith('_pt'):
+                #post-grad part-time students of all faculties
+                if student.is_postgrad:
+                    xmldict['institution_acct'] = '0023708207'
+                    xmldict['institution_bank_id'] = '72'
+                #all other part-time students depending on faculty
+                elif student.faccode in ('ENG','LAW','MGS'):
+                    xmldict['institution_acct'] = '2019006824'
+                    xmldict['institution_bank_id'] = '8'
+                elif student.faccode in ('IPA','PHA','SSC','AGR','EDU'):
+                    xmldict['institution_acct'] = '0122012109'
+                    xmldict['institution_bank_id'] = '16'
+        elif self.context.p_category == 'clearance':
+            provider_amt = 1500
+            xmldict['institution_bank_id'] = '7'
+            xmldict['institution_acct'] = '1003475516'
+
+        xmldict['provider_amt'] = 100 * provider_amt
+        xmldict['institution_item_name'] = self.category
         xmldict['institution_name'] = INSTITUTION_NAME
+        xmldict['institution_amt'] = 100 * (
+            self.context.amount_auth - provider_amt - 150)
         # Interswitch amount is not part of the xml data
         xmltext = """<payment_item_detail>
Index: /main/waeup.uniben/trunk/src/waeup/uniben/interswitch/tests.py
===================================================================
--- /main/waeup.uniben/trunk/src/waeup/uniben/interswitch/tests.py	(revision 9383)
+++ /main/waeup.uniben/trunk/src/waeup/uniben/interswitch/tests.py	(revision 9384)
@@ -51,4 +51,5 @@
         self.student.nationality = u'NG'
         self.browser.open(self.payments_path + '/addop')
+        self.browser.getControl(name="form.p_category").value = ['schoolfee']
         self.browser.getControl("Create ticket").click()
         self.assertMatches('...ticket created...',
@@ -57,10 +58,4 @@
         value = ctrl.options[0]
         self.browser.getLink(value).click()
-        self.assertMatches('...Amount Authorized...',
-                           self.browser.contents)
-        self.assertMatches(
-            '...<span>40000.0</span>...',
-            self.browser.contents)
-        self.payment_url = self.browser.url
 
 
@@ -78,4 +73,11 @@
     def test_interswitch_form(self):
 
+        # School fee ticket already created in setUp method
+        self.assertMatches('...Amount Authorized...',
+                           self.browser.contents)
+        self.assertMatches(
+            '...<span>40000.0</span>...',
+            self.browser.contents)
+        self.payment_url = self.browser.url
         # Manager can access InterswitchForm
         self.browser.getLink("CollegePAY", index=0).click()
@@ -84,7 +86,48 @@
         # The total amount to be processed by Interswitch
         # has been reduced by the Interswitch fee of 150 Nairas
+        self.assertMatches('...Total Amount Authorized:...',
+                           self.browser.contents)
         self.assertMatches(
             '...<input type="hidden" name="amount" value="4000000.0" />...',
             self.browser.contents)
+        self.assertMatches(
+            '...item_name="School Fee" item_amt="3835000" bank_id="" acct_num=""...',
+            self.browser.contents)
+        self.assertMatches(
+            '...item_name="BT Education" item_amt="150000" bank_id="117" acct_num="1010764827"...',
+            self.browser.contents)
+
+        # Create clearance fee ticket
+        self.browser.open(self.payments_path + '/addop')
+        self.browser.getControl(name="form.p_category").value = ['clearance']
+        self.browser.getControl("Create ticket").click()
+        self.assertMatches('...ticket created...',
+                           self.browser.contents)
+        ctrl = self.browser.getControl(name='val_id')
+        value = ctrl.options[1]
+        self.browser.getLink(value).click()
+        self.assertMatches('...Amount Authorized...',
+                           self.browser.contents)
+        self.assertMatches(
+            '...<span>45000.0</span>...',
+            self.browser.contents)
+        # Manager can access InterswitchForm
+        self.browser.getLink("CollegePAY", index=0).click()
+        self.assertMatches('...Total Amount Authorized:...',
+                           self.browser.contents)
+        # The total amount to be processed by Interswitch
+        # has been reduced by the Interswitch fee of 150 Nairas
+        self.assertMatches('...Total Amount Authorized:...',
+                           self.browser.contents)
+        self.assertMatches(
+            '...<input type="hidden" name="amount" value="4500000.0" />...',
+            self.browser.contents)
+        self.assertMatches(
+            '...item_name="Acceptance Fee" item_amt="4335000" bank_id="7" acct_num="1003475516"...',
+            self.browser.contents)
+        self.assertMatches(
+            '...item_name="BT Education" item_amt="150000" bank_id="117" acct_num="1010764827"...',
+            self.browser.contents)
+
 
 #    @external_test
