Index: main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/interswitch/browser.py
===================================================================
--- main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/interswitch/browser.py	(revision 17900)
+++ main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/interswitch/browser.py	(revision 18034)
@@ -19,4 +19,6 @@
 import hashlib
 import grok
+from waeup.kofa.students.interfaces import IStudentsUtils
+from zope.component import getUtility
 from kofacustom.nigeria.interswitch.browser import (
     module_activated,
@@ -52,4 +54,27 @@
 HTTPS = True
 
+BANK_ACCOUNTS = {
+    'access':               ('1228744877', '117'),
+    'parentsconsult':       ('1228747029', '117'),
+    'health_insurance':     ('1228744884', '117'),
+    'municipal_returning':  ('0040621193','31'),
+    'clearance':            ('0040621193','31'),
+    'develop':              ('0040621193','31'),
+    'medical_screening':    ('1311220657','117'),
+    'conv':                 ('0040621193','31'),
+    'registration_fresh':   ('0040621193','31'),
+    'science':              ('0040621193','31'),
+    'id_card':              ('0040621193','31'),
+    'alumni':               ('1311974981','117'),
+    'lab_support':          ('0040621193','31'),
+    'registration_return':  ('0040621193','31'),
+    'book':                 ('1228744877','117'),
+    'waecneco':             ('0040621193','31'),
+    'jambver':              ('0040621193','31'),
+    'pg_other':             ('0040621193','31'),
+    'municipal_fresh':      ('0040621193','31'),
+    'matric':               ('0040621193','31')
+    }
+
 class CustomInterswitchPageStudent(InterswitchPageStudent):
     """ View which sends a POST request to the Interswitch
@@ -65,4 +90,5 @@
 
     def update(self):
+        student_utils = getUtility(IStudentsUtils)
         if not module_activated(
             self.context.student.current_session, self.context):
@@ -97,13 +123,6 @@
             'schoolfee', 'schoolfee40', 'secondinstal'):
             self.pay_item_id = '101'
-        elif self.context.p_category == 'book':
-            self.pay_item_id = '103'
-        elif self.context.p_category == 'parentsconsult':
-            self.pay_item_id = '104'
-        elif self.context.p_category in (
-            'municipal_fresh', 'municipal_returning',
-            'transcript_local', 'transcript_overseas', 'transcript'):
-            self.pay_item_id = '105'
         else:
+            # we use the same item_id for all sundry payments
             self.pay_item_id = '102'
         if self.context.p_category in (
@@ -143,13 +162,8 @@
 
             # Overwrite above selection
-            if self.context.p_category == 'book':
-                xmldict['institution_acct'] = '1228744877'
-                xmldict['institution_bank_id'] = '117'
-            elif self.context.p_category == 'parentsconsult':
-                xmldict['institution_acct'] = '1228747029'
-                xmldict['institution_bank_id'] = '117'
-            elif self.context.p_category == 'health_insurance':
-                xmldict['institution_acct'] = '1228744884'
-                xmldict['institution_bank_id'] = '117'
+            sundry_acct = BANK_ACCOUNTS.get(self.context.p_category, None)
+            if sundry_acct is True:
+                xmldict['institution_acct'] = sundry_acct[0]
+                xmldict['institution_bank_id'] = sundry_acct[0]
 
         if provider_amt == 0:
@@ -166,4 +180,28 @@
 </item_details>
 </payment_item_detail>""" % xmldict
+
+        # Overwrite xmltext above because we have to split required combi
+        if self.context.p_category == 'required_combi':
+            rp = student_utils._collect_required_payment_items(self.context.student)
+            academic_session = student_utils._getSessionConfiguration(self.context.p_session)
+            xmltext = """<payment_item_detail>
+<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
+<item_detail item_id="1" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />""" % xmldict
+            item_id = 2
+            for cat in rp:
+                fee_name = cat + '_fee'
+                item_name = cat
+                item_amt = 100 * getattr(academic_session, fee_name, 0.0)
+                if item_name.startswith('registration'):
+                    item_amt -= 100 * provider_amt
+                bank_id = BANK_ACCOUNTS[cat][1]
+                acct_num = BANK_ACCOUNTS[cat][0]
+                xmltext += """
+<item_detail item_id="%s" item_name="%s" item_amt="%d" bank_id="%s" acct_num="%s" />""" % (item_id, item_name, item_amt, bank_id, acct_num)
+                item_id += 1
+            xmltext += """
+</item_details>
+</payment_item_detail>""" % xmldict
+
         self.xml_data = """<input type="hidden" name="xml_data" value='%s'  />""" % xmltext
         self.amount_auth = int(100 * self.context.amount_auth)
Index: main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/interswitch/tests.py
===================================================================
--- main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/interswitch/tests.py	(revision 17900)
+++ main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/interswitch/tests.py	(revision 18034)
@@ -89,4 +89,58 @@
             self.browser.contents)
 
+    def test_interswitch_required_combi(self):
+        # Student is a fresh non-science student
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+        self.browser.open(self.payments_path)
+        IWorkflowState(self.student).setState('cleared')
+        self.student.nationality = u'NG'
+        self.browser.open(self.payments_path + '/addop')
+        self.browser.getControl(name="form.p_category").value = ['schoolfee']
+        self.browser.getControl(name="form.p_option").value = ['first']
+        self.browser.getControl("Create payment").click()
+        self.assertTrue('Make either single payments or make a' in self.browser.contents)
+        self.browser.getControl(name="form.p_category").value = ['required_combi']
+        self.browser.getControl("Create payment").click()
+        self.assertTrue('Student Health Insurance undefined.' in self.browser.contents)
+        self.app['configuration']['2004'].registration_fresh_fee = 10000.0
+        self.app['configuration']['2004'].book_fee = 10000.0
+        self.app['configuration']['2004'].develop_fee = 10000.0
+        self.app['configuration']['2004'].parentsconsult_fee = 10000.0
+        self.app['configuration']['2004'].municipal_fresh_fee = 10000.0
+        self.app['configuration']['2004'].matric_fee = 10000.0
+        self.app['configuration']['2004'].waecneco_fee = 10000.0
+        self.app['configuration']['2004'].jambver_fee = 10000.0
+        self.app['configuration']['2004'].health_insurance_fee = 10000.0
+        self.app['configuration']['2004'].id_card_fee = 10000.0
+        self.app['configuration']['2004'].medical_screening_fee = 10000.0
+        self.browser.getControl(name="form.p_category").value = ['required_combi']
+        self.browser.getControl("Create payment").click()
+        self.assertTrue('Payment created' in self.browser.contents)
+        self.browser.open(self.payments_path)
+        ctrl = self.browser.getControl(name='val_id')
+        self.value = ctrl.options[0]
+        self.browser.getLink(self.value).click()
+        self.assertTrue(
+            '<span>110000.0</span>' in self.browser.contents)
+        self.payment_url = self.browser.url
+        self.browser.getLink("Pay via Interswitch", index=0).click()
+        self.assertTrue('<input type="hidden" name="pay_item_id" value="102" />' in
+                           self.browser.contents)
+        self.assertEqual(self.student.current_mode, 'ug_ft')
+        # 250 gateway charge have been added
+        payment = self.student['payments'][self.value]
+        self.assertEqual(payment.amount_auth, 110250)
+        self.assertEqual(payment.net_amt, 110000)
+        print self.browser.contents
+        self.assertTrue(
+            '<input type="hidden" name="amount" value="11025000" />' in
+            self.browser.contents)
+        self.assertTrue(
+            'item_id="6" item_name="registration_fresh" item_amt="500000" bank_id="31" acct_num="0040621193"' in
+            self.browser.contents)
+        self.assertTrue(
+            'item_id="12" item_name="parentsconsult" item_amt="1000000" bank_id="117" acct_num="1228747029"' in
+            self.browser.contents)
+
     def test_interswitch_form_ticket_expired(self):
         self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
