Index: main/waeup.aaue/trunk/src/waeup/aaue/interswitch/browser.py
===================================================================
--- main/waeup.aaue/trunk/src/waeup/aaue/interswitch/browser.py	(revision 12728)
+++ main/waeup.aaue/trunk/src/waeup/aaue/interswitch/browser.py	(revision 12729)
@@ -116,17 +116,11 @@
 
     def update(self):
-
-        self.flash('Payment method not yet configured.', type='danger')
-        self.redirect(self.url(self.context, '@@index'))
-        return
-
-
-        error = self.init_update()
-        if error:
-            self.flash(error, type='danger')
-            self.redirect(self.url(self.context, '@@index'))
-            return
+        #self.flash('Payment method not yet configured.', type='danger')
+        #self.redirect(self.url(self.context, '@@index'))
+        #return
+        super(CustomInterswitchPageStudent, self).update()
         student = self.student
         xmldict = self.xmldict
+        xmltext = ""
         # Provider data
         xmldict['detail_ref'] = self.context.p_id
@@ -134,32 +128,75 @@
         xmldict['provider_bank_id'] = PROVIDER_BANK_ID
         xmldict['provider_item_name'] = PROVIDER_ITEM_NAME
-        # Institution data
-        xmldict['institution_acct'] = '00000000'
-        xmldict['institution_bank_id'] = '00'
-        xmldict['institution_amt'] = '0.0'
-        provider_amt = 0.0
-        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 - GATEWAY_AMT)
-        # Interswitch amount is not part of the xml data
-        if provider_amt == 0:
-            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="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
-</item_details>
-</payment_item_detail>""" % xmldict
-        else:
+
+        if self.context.p_category == 'schoolfee':
+            if student.faccode == 'FCETA':
+                xmldict['institution_acct'] = '1190118227'
+                xmldict['institution_bank_id'] = '123'
+            else:
+                xmldict['institution_bank_id'] = '7'
+                xmldict['institution_acct'] = '1014847058'
+            if student.current_mode == 'found':
+                self.pay_item_id = '103'
+            else:
+                self.pay_item_id = '105'
+            provider_amt = 1900.0
+            joint_venture_amt = 1100.0
+            aaue_share_amt = 1000.0
+            student_union_due_amt = 1000.0
+            student_welfare_assurance_amt = 500.0
+            xmldict['provider_amt'] = 100 * provider_amt
+            xmldict['joint_venture_amt'] = 100 * joint_venture_amt
+            xmldict['aaue_share_amt'] = 100 * aaue_share_amt
+            xmldict['student_union_due_amt'] = 100 * student_union_due_amt
+            xmldict['student_welfare_assurance_amt'] = 100 * student_welfare_assurance_amt
+            xmldict['institution_amt'] = 100 * (
+                self.context.amount_auth
+                - provider_amt
+                - joint_venture_amt
+                - aaue_share_amt
+                - student_union_due_amt
+                - student_welfare_assurance_amt
+                - GATEWAY_AMT)
             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="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
 <item_detail item_id="2" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />
+<item_detail item_id="3" item_name="Joint Venture" item_amt="%(joint_venture_amt)d" bank_id="51" acct_num="5060023759" />
+<item_detail item_id="4" item_name="AAUE Share" item_amt="%(aaue_share_amt)d" bank_id="51" acct_num="5060020947" />
+<item_detail item_id="5" item_name="Student Union" item_amt="%(student_union_due_amt)d" bank_id="123" acct_num="1006360118" />
+<item_detail item_id="6" item_name="Student Welfare Assurance" item_amt="%(student_welfare_assurance_amt)d" bank_id="31" acct_num="1006407792" />
 </item_details>
 </payment_item_detail>""" % xmldict
+        elif self.context.p_category == 'clearance':
+            if student.current_mode == 'found':
+                self.pay_item_id = '102'
+            else:
+                self.pay_item_id = '104'
+            xmldict['institution_acct'] = '1014066976'
+            xmldict['institution_bank_id'] = '117'
+            provider_amt = 0.0
+            gown_fee_amt = 2000.0
+            aaue_fl_fee_amt = 800.0
+            xmldict['gown_fee_amt'] = 100 * gown_fee_amt
+            xmldict['aaue_fl_fee_amt'] = 100 * aaue_fl_fee_amt
+            xmldict['institution_amt'] = 100 * (
+                self.context.amount_auth
+                - gown_fee_amt
+                - aaue_fl_fee_amt
+                - GATEWAY_AMT)
+            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="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
+<item_detail item_id="2" item_name="Matriculation Gown Fee" item_amt="%(gown_fee_amt)d" bank_id="51" acct_num="5060020947" />
+<item_detail item_id="3" item_name="AAU File-Lapel Fee" item_amt="%(aaue_fl_fee_amt)d" bank_id="51" acct_num="4010660109" />
+</item_details>
+</payment_item_detail>""" % xmldict
+
+
         self.xml_data = """<input type="hidden" name="xml_data" value='%s'  />""" % xmltext
         self.context.provider_amt = provider_amt
         self.context.gateway_amt = GATEWAY_AMT
-
         hashargs = (
             self.context.p_id +
@@ -170,5 +207,4 @@
             self.mac)
         self.hashvalue = hashlib.sha512(hashargs).hexdigest()
-
         return
 
Index: main/waeup.aaue/trunk/src/waeup/aaue/interswitch/tests.py
===================================================================
--- main/waeup.aaue/trunk/src/waeup/aaue/interswitch/tests.py	(revision 12728)
+++ main/waeup.aaue/trunk/src/waeup/aaue/interswitch/tests.py	(revision 12729)
@@ -106,6 +106,6 @@
         super(InterswitchTestsStudents, self).setUp()
 
-    def disabled_test_interswitch_form(self):
-        self.app['configuration']['2004'].school_fee_1 = 6666.0
+    def test_interswitch_form_school_fees(self):
+        self.app['configuration']['2004'].school_fee_1 = 51750.0
         # Manager can access InterswitchForm
         self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
@@ -124,9 +124,9 @@
                            self.browser.contents)
         self.assertMatches(
-            '...<span>6666.0</span>...',
+            '...<span>51750.0</span>...',
             self.browser.contents)
         self.payment_url = self.browser.url
         self.browser.getLink("CollegePAY", index=0).click()
-        self.assertMatches('...<input type="hidden" name="pay_item_id" value="101" />...',
+        self.assertMatches('...<input type="hidden" name="pay_item_id" value="105" />...',
                            self.browser.contents)
         self.assertMatches('...Total Amount Authorized:...',
@@ -134,8 +134,41 @@
         self.assertEqual(self.student.current_mode, 'ug_ft')
         self.assertMatches(
-            '...<input type="hidden" name="amount" value="666600" />...',
-            self.browser.contents)
-        self.assertMatches(
-            '...item_name="School Fee" item_amt="641600" bank_id="00" acct_num="00000000"...',
+            '...<input type="hidden" name="amount" value="5175000" />...',
+            self.browser.contents)
+        self.assertMatches(
+            '...item_name="School Fee" item_amt="4600000" bank_id="7" acct_num="1014847058"...',
+            self.browser.contents)
+
+    def test_interswitch_form_acceptance_fees(self):
+        self.app['configuration']['2004'].clearance_fee = 43050.0
+        # Manager can access InterswitchForm
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+        self.browser.open(self.payments_path)
+        IWorkflowState(self.student).setState('admitted')
+        self.student.nationality = u'NG'
+        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')
+        self.value = ctrl.options[0]
+        self.browser.getLink(self.value).click()
+        self.assertMatches('...Amount Authorized...',
+                           self.browser.contents)
+        self.assertMatches(
+            '...<span>43050.0</span>...',
+            self.browser.contents)
+        self.payment_url = self.browser.url
+        self.browser.getLink("CollegePAY", index=0).click()
+        self.assertMatches('...<input type="hidden" name="pay_item_id" value="104" />...',
+                           self.browser.contents)
+        self.assertMatches('...Total Amount Authorized:...',
+                           self.browser.contents)
+        self.assertMatches(
+            '...<input type="hidden" name="amount" value="5175000" />...',
+            self.browser.contents)
+        self.assertMatches(
+            '...item_name="Acceptance Fee" item_amt="4280000" bank_id="117" acct_num="1014066976"...',
             self.browser.contents)
 
