Index: main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/browser.py
===================================================================
--- main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/browser.py	(revision 9615)
+++ main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/browser.py	(revision 9616)
@@ -194,5 +194,4 @@
     site_name = SITE_NAME
     currency = CURRENCY
-    pay_item_id = '101'
     product_id = PRODUCT_ID
     mac = 'E6BA6CBBA9AF2871EE25C32C8D57C98895B9B001DC5B9CB2C463E2A9BDA44A3F1260C8A364F33789CDF74CB3EE7E6EF5D94F48D3AF7B727E75D97F07618DFA6D'
@@ -229,30 +228,34 @@
         xmldict['provider_item_name'] = PROVIDER_ITEM_NAME
         xmldict['provider_amt'] = 100 * 1200
-        # Dalash data
-        xmldict['dalash_amt'] = 100 * 1800
         # Institution data
-        if xmldict['faculty'] in ('CPGS',):
-            xmldict['institution_acct'] = "1771180233"
-            xmldict['institution_bank_id'] = '120'
-        elif xmldict['faculty'] in ('IBAS',):
-            xmldict['institution_acct'] = "0006772436"
-            xmldict['institution_bank_id'] = '121'
-        elif xmldict['faculty'] in ('IETS',):
-            xmldict['institution_acct'] = "0106259811"
-            xmldict['institution_bank_id'] = '10'
-        elif xmldict['faculty'] in ('IFMS',):
-            xmldict['institution_acct'] = "2013910271"
-            xmldict['institution_bank_id'] = '8'
-        elif xmldict['faculty'] in ('ITCH',):
-            #acct. number changed from Zenith to FBN by gbenga Nov. 11, 2012
-            xmldict['institution_acct'] = "2013910271"
-            xmldict['institution_bank_id'] = '8'
-        else:
-            xmldict['institution_acct'] = "0000000000000"
-            xmldict['institution_bank_id'] = '0'
-        xmldict['institution_amt'] = 100 * (
-            self.context.amount_auth - 1200 - 300 - 1800)
-        xmldict['institution_item_name'] = self.context.p_category
+        xmldict['institution_acct'] = "0000000000000"
+        xmldict['institution_bank_id'] = '0'
+        xmldict['institution_item_name'] = self.category
         xmldict['institution_name'] = INSTITUTION_NAME
+        xmldict['institution_amt'] = 100 * self.context.amount_auth
+        xmldict['dalash_amt'] = 0
+        self.pay_item_id = '000'
+        if self.context.p_category == 'schoolfee':
+            self.pay_item_id = '101'
+            # Dalash data
+            xmldict['dalash_amt'] = 100 * 1800
+            if xmldict['faculty'] in ('CPGS',):
+                xmldict['institution_acct'] = "1771180233"
+                xmldict['institution_bank_id'] = '120'
+            elif xmldict['faculty'] in ('IBAS',):
+                xmldict['institution_acct'] = "0006772436"
+                xmldict['institution_bank_id'] = '121'
+            elif xmldict['faculty'] in ('IETS',):
+                xmldict['institution_acct'] = "0106259811"
+                xmldict['institution_bank_id'] = '10'
+            elif xmldict['faculty'] in ('IFMS',):
+                xmldict['institution_acct'] = "2013910271"
+                xmldict['institution_bank_id'] = '8'
+            elif xmldict['faculty'] in ('ITCH',):
+                #acct. number changed from Zenith to FBN by gbenga Nov. 11, 2012
+                xmldict['institution_acct'] = "2013910271"
+                xmldict['institution_bank_id'] = '8'
+            xmldict['institution_amt'] = 100 * (
+                self.context.amount_auth - 1200 - 300 - 1800)
 
         hashargs = (
Index: main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/tests.py
===================================================================
--- main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/tests.py	(revision 9615)
+++ main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/tests.py	(revision 9616)
@@ -112,5 +112,5 @@
             self.browser.contents)
         self.assertMatches(
-            '...item_name="schoolfee" item_amt="3380000" bank_id="120" acct_num="1771180233"...',
+            '...item_name="School Fee" item_amt="3380000" bank_id="120" acct_num="1771180233"...',
             self.browser.contents)
         self.assertMatches(
@@ -120,4 +120,59 @@
             '...item_name="BT Education" item_amt="120000" bank_id="117" acct_num="1010764827"...',
             self.browser.contents)
+
+        # Let's do the same for maintenance fee payment
+
+        self.browser.open(self.payments_path)
+        self.browser.open(self.payments_path + '/addop')
+        self.browser.getControl(
+            name="form.p_category").value = ['hostel_maintenance']
+        self.browser.getControl("Create ticket").click()
+        self.assertMatches('...You have not yet booked accommodation...',
+                           self.browser.contents)
+        # Students have to book bed first
+        self.browser.open(self.acco_path)
+        IWorkflowState(self.student).setState('admitted')
+        self.browser.getLink("Book accommodation").click()
+        self.assertFalse('Activation Code:' in self.browser.contents)
+        self.browser.getControl("Create bed ticket").click()
+        # Bed is randomly selected but, since there is only
+        # one bed for this student, we know that ...
+        self.assertMatches('...Hall 1, Block A, Room 101, Bed A...',
+                           self.browser.contents)
+        self.assertMatches('...ticket created...',
+                           self.browser.contents)
+        self.browser.open(self.payments_path + '/addop')
+        self.browser.getControl(
+            name="form.p_category").value = ['hostel_maintenance']
+        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)
+
+        # So far maintenance fee is not yet properly configured!!!
+
+        # Maint fee is taken from the session configuration object
+        self.assertMatches(
+            '...<span>987.0</span>...',
+            self.browser.contents)
+        self.payment_url = self.browser.url
+        # Manager can access InterswitchForm
+        self.browser.getLink("CollegePAY", index=0).click()
+        # 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="98700.0" />...',
+            self.browser.contents)
+        self.assertMatches(
+            '...item_name="Hostel Maintenance Fee" item_amt="98700" bank_id="0" acct_num="0000000000000"...',
+            self.browser.contents)
+        # BT does nor charge a fee for maintenance fee
+        #self.assertFalse("BT Education" in self.browser.contents)
 
 #    @external_test
