Index: main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/browser.py
===================================================================
--- main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/browser.py	(revision 10735)
+++ main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/browser.py	(revision 10736)
@@ -112,14 +112,13 @@
         xmldict['institution_item_name'] = self.category
         xmldict['institution_name'] = INSTITUTION_NAME
+        xmldict['institution_amt'] = 0.0
+        dalash_amt = 200.0
+        provider_amt = 300.0
+        gateway_amt = GATEWAY_AMT
         self.pay_item_id = '000'
         if self.context.p_category == 'schoolfee':
-            provider_amt = 1200.0
-            xmldict['provider_amt'] = 100 * provider_amt
             self.pay_item_id = '101'
             dalash_amt = 1800.0
-            xmldict['dalash_amt'] = 100 * dalash_amt
-            xmldict['institution_amt'] = 100 * (
-                self.context.amount_auth - provider_amt -
-                GATEWAY_AMT - dalash_amt)
+            provider_amt = 1200.0
             if xmldict['faculty'] in ('CPGS',):
                 xmldict['institution_acct'] = "1771180233"
@@ -145,13 +144,94 @@
                 xmldict['institution_bank_id'] = '8'
                 self.pay_item_id = '108'
-
+        elif self.context.p_category == 'certificate':
+            self.pay_item_id = '111'
+            xmldict['institution_acct'] = "0131959715"
+            xmldict['institution_bank_id'] = '10'
+        elif self.context.p_category == 'state_result':
+            self.pay_item_id = '112'
+            xmldict['institution_acct'] = "0131959715"
+            xmldict['institution_bank_id'] = '10'
+        elif self.context.p_category == 'transcript_local':
+            self.pay_item_id = '113'
+            xmldict['institution_acct'] = "0131959715"
+            xmldict['institution_bank_id'] = '10'
+        elif self.context.p_category == 'transcript_foreign':
+            self.pay_item_id = '114'
+            xmldict['institution_acct'] = "0131959715"
+            xmldict['institution_bank_id'] = '10'
+        elif self.context.p_category == 'ver_result':
+            self.pay_item_id = '115'
+            xmldict['institution_acct'] = "0131959715"
+            xmldict['institution_bank_id'] = '10'
+        elif self.context.p_category == 'change_course':
+            self.pay_item_id = '116'
+            xmldict['institution_acct'] = "0131959715"
+            xmldict['institution_bank_id'] = '10'
+        elif self.context.p_category == 'change_inst':
+            self.pay_item_id = '117'
+            xmldict['institution_acct'] = "0131959715"
+            xmldict['institution_bank_id'] = '10'
+        elif self.context.p_category == 'jamb_reject':
+            self.pay_item_id = '118'
+            xmldict['institution_acct'] = "0131959715"
+            xmldict['institution_bank_id'] = '10'
+        elif self.context.p_category == 'cert_of_cert':
+            self.pay_item_id = '119'
+            xmldict['institution_acct'] = "0131959715"
+            xmldict['institution_bank_id'] = '10'
+        elif self.context.p_category == 'ref_let':
+            self.pay_item_id = '120'
+            xmldict['institution_acct'] = "0131959715"
+            xmldict['institution_bank_id'] = '10'
+        elif self.context.p_category == 'proc_cert':
+            self.pay_item_id = '121'
+            xmldict['institution_acct'] = "0131959715"
+            xmldict['institution_bank_id'] = '10'
+        elif self.context.p_category == 'loss_idcard':
+            self.pay_item_id = '122'
+            xmldict['institution_acct'] = "0131959715"
+            xmldict['institution_bank_id'] = '10'
+            dalash_amt = 6.0
+            xmldict['dalash_amt'] = 100 * dalash_amt
+            provider_amt = 9.0
+            gateway_amt = 15.0
+        elif self.context.p_category == 'loss_examcard':
+            self.pay_item_id = '123'
+            xmldict['institution_acct'] = "0131959715"
+            xmldict['institution_bank_id'] = '10'
+            dalash_amt = 3.0
+            xmldict['dalash_amt'] = 100 * dalash_amt
+            provider_amt = 4.5
+            gateway_amt = 7.5
+        elif self.context.p_category == 'loss_result':
+            self.pay_item_id = '124'
+            xmldict['institution_acct'] = "0131959715"
+            xmldict['institution_bank_id'] = '10'
+        elif self.context.p_category == 'loss_receipt':
+            self.pay_item_id = '125'
+            xmldict['institution_acct'] = "0131959715"
+            xmldict['institution_bank_id'] = '10'
+        elif self.context.p_category == 'loss_clearance':
+            self.pay_item_id = '126'
+            xmldict['institution_acct'] = "0131959715"
+            xmldict['institution_bank_id'] = '10'
+        elif self.context.p_category == 'conv_brochure':
+            self.pay_item_id = '127'
+            xmldict['institution_acct'] = "0131959715"
+            xmldict['institution_bank_id'] = '10'
         elif 'maintenance' in self.context.p_category:
             self.pay_item_id = '102'
             xmldict['institution_acct'] = "0039050937"
             xmldict['institution_bank_id'] = '31'
-            xmldict['institution_amt'] = 100 * (
-                self.context.amount_auth - GATEWAY_AMT)
             dalash_amt = 0.0
             provider_amt = 0.0
+
+
+        xmldict['dalash_amt'] = 100 * dalash_amt
+        xmldict['provider_amt'] = 100 * provider_amt
+        xmldict['institution_amt'] = 100 * (
+                self.context.amount_auth - provider_amt -
+                gateway_amt - dalash_amt)
+
 
         hashargs = (
@@ -166,5 +246,12 @@
         # Interswitch amount is not part of the xml data
 
-        if self.context.p_category == 'schoolfee':
+        if 'maintenance' in self.context.p_category:
+            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:
             xmltext = """<payment_item_detail>
 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
@@ -175,14 +262,7 @@
 </payment_item_detail>""" % xmldict
 
-        elif 'maintenance' in self.context.p_category:
-            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
-
         self.xml_data = """<input type="hidden" name="xml_data" value='%s'  />""" % xmltext
         self.context.provider_amt = provider_amt
-        self.context.gateway_amt = GATEWAY_AMT
+        self.context.gateway_amt = gateway_amt
         self.context.thirdparty_amt = dalash_amt
         return
Index: main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/tests.py
===================================================================
--- main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/tests.py	(revision 10735)
+++ main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/tests.py	(revision 10736)
@@ -261,4 +261,110 @@
             '...item_name="BT Education" item_amt="120000" bank_id="117" acct_num="1010764827"...',
             self.browser.contents)
+
+    def test_interswitch_form_new_payment_cats(self):
+        # only a few categories covered
+
+        self.app['configuration']['2004'].certificate_fee = 6800.0
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+        self.browser.open(self.payments_path + '/addop')
+        self.browser.getControl(name="form.p_category").value = ['certificate']
+        self.browser.getControl("Create ticket").click()
+        self.assertMatches('...ticket created...', self.browser.contents)
+        ctrl = self.browser.getControl(name='val_id')
+        value = ctrl.options[0]
+        self.browser.getLink(value).click()
+        self.assertMatches('...Amount Authorized...', self.browser.contents)
+        self.assertMatches(
+            '...<span>6800.0</span>...', self.browser.contents)
+        self.browser.getLink("CollegePAY", index=0).click()
+        self.assertEqual(self.student['payments'][value].amount_auth, 6800.0)
+        self.assertEqual(self.student['payments'][value].provider_amt, 300.0)
+        self.assertEqual(self.student['payments'][value].gateway_amt, 300.0)
+        self.assertEqual(self.student['payments'][value].thirdparty_amt, 200.0)
+
+        self.app['configuration']['2004'].transcript_local_fee = 5000.0
+        self.browser.open(self.payments_path + '/addop')
+        self.browser.getControl(name="form.p_category").value = ['transcript_local']
+        self.browser.getControl("Create ticket").click()
+        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>5000.0</span>...', self.browser.contents)
+        self.payment_url = self.browser.url
+        self.browser.getLink("CollegePAY", index=0).click()
+        self.assertEqual(self.student['payments'][value].amount_auth, 5000.0)
+        self.assertEqual(self.student['payments'][value].provider_amt, 300.0)
+        self.assertEqual(self.student['payments'][value].gateway_amt, 300.0)
+        self.assertEqual(self.student['payments'][value].thirdparty_amt, 200.0)
+
+        self.app['configuration']['2004'].loss_idcard_fee = 1000.0
+        self.browser.open(self.payments_path + '/addop')
+        self.browser.getControl(name="form.p_category").value = ['loss_idcard']
+        self.browser.getControl("Create ticket").click()
+        ctrl = self.browser.getControl(name='val_id')
+        value = ctrl.options[2]
+        self.browser.getLink(value).click()
+        self.assertMatches('...Amount Authorized...', self.browser.contents)
+        self.assertMatches(
+            '...<span>1000.0</span>...', self.browser.contents)
+        self.payment_url = self.browser.url
+        self.browser.getLink("CollegePAY", index=0).click()
+        self.assertEqual(self.student['payments'][value].amount_auth, 1000.0)
+        self.assertEqual(self.student['payments'][value].provider_amt, 9.0)
+        self.assertEqual(self.student['payments'][value].gateway_amt, 15.0)
+        self.assertEqual(self.student['payments'][value].thirdparty_amt, 6.0)
+
+        self.app['configuration']['2004'].loss_examcard_fee = 500.0
+        self.browser.open(self.payments_path + '/addop')
+        self.browser.getControl(name="form.p_category").value = ['loss_examcard']
+        self.browser.getControl("Create ticket").click()
+        ctrl = self.browser.getControl(name='val_id')
+        value = ctrl.options[3]
+        self.browser.getLink(value).click()
+        self.assertMatches('...Amount Authorized...', self.browser.contents)
+        self.assertMatches(
+            '...<span>500.0</span>...', self.browser.contents)
+        self.payment_url = self.browser.url
+        self.browser.getLink("CollegePAY", index=0).click()
+        self.assertEqual(self.student['payments'][value].amount_auth, 500.0)
+        self.assertEqual(self.student['payments'][value].provider_amt, 4.5)
+        self.assertEqual(self.student['payments'][value].gateway_amt, 7.5)
+        self.assertEqual(self.student['payments'][value].thirdparty_amt, 3)
+
+        self.app['configuration']['2004'].change_inst_fee = 6000.0
+        self.browser.open(self.payments_path + '/addop')
+        self.browser.getControl(name="form.p_category").value = ['change_inst']
+        self.browser.getControl("Create ticket").click()
+        ctrl = self.browser.getControl(name='val_id')
+        value = ctrl.options[4]
+        self.browser.getLink(value).click()
+        self.assertMatches('...Amount Authorized...', self.browser.contents)
+        self.assertMatches(
+            '...<span>6000.0</span>...', self.browser.contents)
+        self.payment_url = self.browser.url
+        self.browser.getLink("CollegePAY", index=0).click()
+        self.assertEqual(self.student['payments'][value].amount_auth, 6000.0)
+        self.assertEqual(self.student['payments'][value].provider_amt, 300.0)
+        self.assertEqual(self.student['payments'][value].gateway_amt, 300.0)
+        self.assertEqual(self.student['payments'][value].thirdparty_amt, 200.0)
+
+        self.app['configuration']['2004'].loss_result_fee = 7000.0
+        self.browser.open(self.payments_path + '/addop')
+        self.browser.getControl(name="form.p_category").value = ['loss_result']
+        self.browser.getControl("Create ticket").click()
+        ctrl = self.browser.getControl(name='val_id')
+        value = ctrl.options[5]
+        self.browser.getLink(value).click()
+        self.assertMatches('...Amount Authorized...', self.browser.contents)
+        self.assertMatches(
+            '...<span>7000.0</span>...', self.browser.contents)
+        self.payment_url = self.browser.url
+        self.browser.getLink("CollegePAY", index=0).click()
+        self.assertEqual(self.student['payments'][value].amount_auth, 7000.0)
+        self.assertEqual(self.student['payments'][value].provider_amt, 300.0)
+        self.assertEqual(self.student['payments'][value].gateway_amt, 300.0)
+        self.assertEqual(self.student['payments'][value].thirdparty_amt, 200.0)
 
     @external_test
