Index: /main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/etranzact/browser.py
===================================================================
--- /main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/etranzact/browser.py	(revision 16269)
+++ /main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/etranzact/browser.py	(revision 16270)
@@ -159,14 +159,8 @@
         # Already now it becomes an Etranzact payment. We set the net amount
         # and add the gateway amount.
-        provider_amt = 0.0
-        if self.context.p_category in (
-            'registration', 'required_combi', 'pg_other'):
-            provider_amt = 5000.0
-        if not self.context.r_company:
-            self.context.net_amt = self.context.amount_auth
-            self.context.amount_auth += self.gateway_amt
-            self.context.amount_auth += provider_amt
-            self.context.gateway_amt = self.gateway_amt
-            self.context.provider_amt = provider_amt
+        if not self.context.r_company:
+            self.context.net_amt = self.context.amount_auth
+            self.context.amount_auth += self.gateway_amt
+            self.context.gateway_amt = self.gateway_amt
             self.context.r_company = u'etranzact'
         self.amount = "%.1f" % self.context.amount_auth
@@ -222,14 +216,8 @@
         # Already now it becomes an Etranzact payment. We set the net amount
         # and add the gateway amount.
-        provider_amt = 0.0
-        if self.context.p_category in (
-            'registration', 'required_combi', 'pg_other'):
-            provider_amt = 5000.0
-        if not self.context.r_company:
-            self.context.net_amt = self.context.amount_auth
-            self.context.amount_auth += self.gateway_amt
-            self.context.amount_auth += provider_amt
-            self.context.gateway_amt = self.gateway_amt
-            self.context.provider_amt = provider_amt
+        if not self.context.r_company:
+            self.context.net_amt = self.context.amount_auth
+            self.context.amount_auth += self.gateway_amt
+            self.context.gateway_amt = self.gateway_amt
             self.context.r_company = u'etranzact'
         return
@@ -248,11 +236,8 @@
         # Already now it becomes an Etranzact payment. We set the net amount
         # and add the gateway amount.
-        provider_amt = 0.0
-        if not self.context.r_company:
-            self.context.net_amt = self.context.amount_auth
-            self.context.amount_auth += self.gateway_amt
-            self.context.amount_auth += provider_amt
-            self.context.gateway_amt = self.gateway_amt
-            self.context.provider_amt = provider_amt
+        if not self.context.r_company:
+            self.context.net_amt = self.context.amount_auth
+            self.context.amount_auth += self.gateway_amt
+            self.context.gateway_amt = self.gateway_amt
             self.context.r_company = u'etranzact'
         return
Index: /main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/interswitch/browser.py
===================================================================
--- /main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/interswitch/browser.py	(revision 16269)
+++ /main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/interswitch/browser.py	(revision 16270)
@@ -126,8 +126,6 @@
         xmldict['institution_item_name'] = self.context.category
         xmldict['institution_name'] = INSTITUTION_NAME
-        xmldict['institution_amt'] = 100 * self.context.net_amt
-        if not self.context.provider_amt:
-            self.context.provider_amt = provider_amt
-            self.context.amount_auth += provider_amt
+        xmldict['institution_amt'] = 100 * self.context.net_amt - (
+            100 * provider_amt)
         if provider_amt == 0:
             xmltext = """<payment_item_detail>
Index: /main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/interswitch/tests.py
===================================================================
--- /main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/interswitch/tests.py	(revision 16269)
+++ /main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/interswitch/tests.py	(revision 16270)
@@ -53,5 +53,5 @@
 
     def test_interswitch_form(self):
-        self.app['configuration']['2004'].registration_fee = 2000.0
+        self.app['configuration']['2004'].registration_fee = 7000.0
         self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
         self.browser.open(self.payments_path)
@@ -62,9 +62,10 @@
         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>2000.0</span>' in self.browser.contents)
+            '<span>7000.0</span>' in self.browser.contents)
         self.payment_url = self.browser.url
         self.browser.getLink("Pay via Interswitch", index=0).click()
@@ -75,10 +76,14 @@
         payment = self.student['payments'][self.value]
         self.assertEqual(payment.amount_auth, 7250)
-        self.assertEqual(payment.net_amt, 2000)
+        self.assertEqual(payment.net_amt, 7000)
         self.assertTrue(
             '<input type="hidden" name="amount" value="725000" />' in
             self.browser.contents)
+        # WAeAC charge have been substracted
         self.assertTrue(
             'item_name="Registration Fee" item_amt="200000" bank_id="117" acct_num="1011050158"' in
+            self.browser.contents)
+        self.assertTrue(
+            'item_name="WAeAC" item_amt="500000" bank_id="31" acct_num="0773411069"' in
             self.browser.contents)
 
@@ -99,9 +104,9 @@
                            self.browser.contents)
         self.assertEqual(self.student.current_mode, 'ug_ft')
-        # 5000 provider charge and 250 gateway charge have been added
-        self.assertTrue(
-            '<input type="hidden" name="amount" value="625000" />' in
-            self.browser.contents)
-        self.assertEqual(acc_payment.amount_auth, 6250)
+        # 250 gateway charge have been added
+        self.assertTrue(
+            '<input type="hidden" name="amount" value="125000" />' in
+            self.browser.contents)
+        self.assertEqual(acc_payment.amount_auth, 1250)
         self.assertEqual(acc_payment.net_amt, 1000)
         delta = timedelta(days=8)
Index: /main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/utils.py
===================================================================
--- /main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/utils.py	(revision 16269)
+++ /main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/utils.py	(revision 16270)
@@ -247,4 +247,10 @@
         payment = createObject(u'waeup.StudentOnlinePayment')
         timestamp = ("%d" % int(time()*10000))[1:]
+        if category in (
+            'registration', 'required_combi', 'pg_other'):
+            payment.provider_amt = 5000.0
+        if category in (
+            'schoolfee', 'schoolfee40') and student.is_jupeb:
+            payment.provider_amt = 5000.0
         payment.p_id = "p%s" % timestamp
         payment.p_category = category
