Index: main/waeup.aaue/trunk/src/waeup/aaue/interswitch/browser.py
===================================================================
--- main/waeup.aaue/trunk/src/waeup/aaue/interswitch/browser.py	(revision 13413)
+++ main/waeup.aaue/trunk/src/waeup/aaue/interswitch/browser.py	(revision 13414)
@@ -49,6 +49,8 @@
 
 
-def dynamic_gateway_amt(fee):
-    return GATEWAY_AMT
+def gateway_net_amt(fee):
+    if fee > GATEWAY_AMT:
+        return fee - GATEWAY_AMT
+    return 0.0
 
 def contr_agreement(student):
@@ -87,5 +89,6 @@
         xmldict['provider_bank_id'] = PROVIDER_BANK_ID
         xmldict['provider_item_name'] = PROVIDER_ITEM_NAME
-        xmldict['institution_amt'] = 100 * (self.context.amount_auth - provider_amt - GATEWAY_AMT)
+        xmldict['institution_amt'] = 100 * (
+            self.context.amount_auth - provider_amt - GATEWAY_AMT)
         xmldict['institution_item_name'] = self.context.p_category
         xmldict['institution_name'] = INSTITUTION_NAME
@@ -189,8 +192,8 @@
                 joint_venture_amt = 1100.0
                 aaue_share_amt = 1000.0
-                student_union_due_amt = academic_session.union_fee - \
-                    dynamic_gateway_amt(academic_session.union_fee)
-                student_welfare_assurance_amt = academic_session.welfare_fee - \
-                    dynamic_gateway_amt(academic_session.welfare_fee)
+                student_union_due_amt = gateway_net_amt(
+                    academic_session.union_fee)
+                student_welfare_assurance_amt = gateway_net_amt(
+                    academic_session.welfare_fee)
                 xmldict['institution_bank_id'] = '7'
                 xmldict['institution_acct'] = '1014847058'
@@ -204,8 +207,8 @@
                 joint_venture_amt = 1000.0
                 aaue_share_amt = 1500.0
-                student_union_due_amt = academic_session.union_fee - \
-                    dynamic_gateway_amt(academic_session.union_fee)
-                student_welfare_assurance_amt = academic_session.welfare_fee - \
-                    dynamic_gateway_amt(academic_session.welfare_fee)
+                student_union_due_amt = gateway_net_amt(
+                    academic_session.union_fee)
+                student_welfare_assurance_amt = gateway_net_amt(
+                    academic_session.welfare_fee)
                 xmldict['institution_bank_id'] = '117'
                 xmldict['institution_acct'] = '1010827641'
@@ -220,11 +223,10 @@
                 xmldict['student_welfare_assurance_amt'] = 100 * student_welfare_assurance_amt
                 xmldict['institution_amt'] = 100 * (
-                    self.context.amount_auth
+                    gateway_net_amt(self.context.amount_auth)
                     - provider_amt
                     - joint_venture_amt
                     - aaue_share_amt
                     - student_union_due_amt
-                    - student_welfare_assurance_amt
-                    - dynamic_gateway_amt(self.context.amount_auth))
+                    - student_welfare_assurance_amt)
                 xmltext = """<payment_item_detail>
 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
@@ -240,9 +242,8 @@
                 # Schoolfee without additional fees
                 xmldict['institution_amt'] = 100 * (
-                    self.context.amount_auth
+                    gateway_net_amt(self.context.amount_auth)
                     - provider_amt
                     - joint_venture_amt
-                    - aaue_share_amt
-                    - dynamic_gateway_amt(self.context.amount_auth))
+                    - aaue_share_amt)
                 xmltext = """<payment_item_detail>
 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
@@ -273,20 +274,17 @@
             if self.context.p_category.endswith('_incl'):
                 # Clearance including additional fees
-                gown_fee_amt = academic_session.matric_gown_fee - \
-                    dynamic_gateway_amt(academic_session.matric_gown_fee)
-                aaue_fl_fee_amt = academic_session.lapel_fee - \
-                    dynamic_gateway_amt(academic_session.lapel_fee)
+                gown_fee_amt = gateway_net_amt(academic_session.matric_gown_fee)
+                aaue_lf_fee_amt = gateway_net_amt(academic_session.lapel_fee)
                 xmldict['gown_fee_amt'] = 100 * gown_fee_amt
-                xmldict['aaue_fl_fee_amt'] = 100 * aaue_fl_fee_amt
+                xmldict['aaue_lf_fee_amt'] = 100 * aaue_lf_fee_amt
                 xmldict['institution_amt'] = 100 * (
-                    self.context.amount_auth
+                    gateway_net_amt(self.context.amount_auth)
                     - gown_fee_amt
-                    - aaue_fl_fee_amt
-                    - dynamic_gateway_amt(self.context.amount_auth))
+                    - aaue_lf_fee_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_detail item_id="3" item_name="AAU File-Lapel Fee" item_amt="%(aaue_lf_fee_amt)d" bank_id="51" acct_num="4010660109" />
 </item_details>
 </payment_item_detail>""" % xmldict
@@ -295,6 +293,5 @@
                 # Clearance without additional fees
                 xmldict['institution_amt'] = 100 * (
-                    self.context.amount_auth
-                    - dynamic_gateway_amt(self.context.amount_auth))
+                    gateway_net_amt(self.context.amount_auth))
                 xmltext = """<payment_item_detail>
 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
@@ -309,6 +306,5 @@
             xmldict['institution_bank_id'] = '123'
             xmldict['institution_amt'] = 100 * (
-                self.context.amount_auth -
-                dynamic_gateway_amt(self.context.amount_auth))
+                gateway_net_amt(self.context.amount_auth))
             xmltext = """<payment_item_detail>
 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
@@ -323,6 +319,5 @@
             xmldict['institution_bank_id'] = '51'
             xmldict['institution_amt'] = 100 * (
-                self.context.amount_auth -
-                dynamic_gateway_amt(self.context.amount_auth))
+                gateway_net_amt(self.context.amount_auth))
             xmltext = """<payment_item_detail>
 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
@@ -337,6 +332,5 @@
             xmldict['institution_bank_id'] = '123'
             xmldict['institution_amt'] = 100 * (
-                self.context.amount_auth -
-                dynamic_gateway_amt(self.context.amount_auth))
+                gateway_net_amt(self.context.amount_auth))
             xmltext = """<payment_item_detail>
 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
@@ -351,6 +345,5 @@
             xmldict['institution_bank_id'] = '51'
             xmldict['institution_amt'] = 100 * (
-                self.context.amount_auth -
-                dynamic_gateway_amt(self.context.amount_auth))
+                gateway_net_amt(self.context.amount_auth))
             xmltext = """<payment_item_detail>
 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
@@ -365,6 +358,5 @@
             xmldict['institution_bank_id'] = '117'
             xmldict['institution_amt'] = 100 * (
-                self.context.amount_auth -
-                dynamic_gateway_amt(self.context.amount_auth))
+                gateway_net_amt(self.context.amount_auth))
             xmltext = """<payment_item_detail>
 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
@@ -379,6 +371,5 @@
             xmldict['institution_bank_id'] = '123'
             xmldict['institution_amt'] = 100 * (
-                self.context.amount_auth -
-                dynamic_gateway_amt(self.context.amount_auth))
+                gateway_net_amt(self.context.amount_auth))
             xmltext = """<payment_item_detail>
 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
Index: main/waeup.aaue/trunk/src/waeup/aaue/students/browser.py
===================================================================
--- main/waeup.aaue/trunk/src/waeup/aaue/students/browser.py	(revision 13413)
+++ main/waeup.aaue/trunk/src/waeup/aaue/students/browser.py	(revision 13414)
@@ -53,5 +53,5 @@
     ICustomStudentPersonalEdit,
     ICustomUGStudentClearance)
-from waeup.aaue.interswitch.browser import dynamic_gateway_amt
+from waeup.aaue.interswitch.browser import gateway_net_amt
 from waeup.aaue.interfaces import MessageFactory as _
 
@@ -145,16 +145,12 @@
         text += '250.0 Naira Transaction Charge'
         if self.context.p_category == 'schoolfee_incl' and academic_session:
-            welfare_fee = academic_session.welfare_fee - dynamic_gateway_amt(
-                academic_session.welfare_fee)
-            union_fee = academic_session.union_fee - dynamic_gateway_amt(
-                academic_session.union_fee)
+            welfare_fee = gateway_net_amt(academic_session.welfare_fee)
+            union_fee = gateway_net_amt(academic_session.union_fee)
             text += (', %s Naira Student Welfare Assurance Fee and %s Naira Students\' Union Dues'
                      % (welfare_fee, union_fee))
         elif self.context.p_category in (
             'clearance_incl', 'clearance_medical_incl') and academic_session:
-            matric_gown_fee = academic_session.matric_gown_fee - dynamic_gateway_amt(
-                academic_session.matric_gown_fee)
-            lapel_fee = academic_session.lapel_fee - dynamic_gateway_amt(
-                academic_session.lapel_fee)
+            matric_gown_fee = gateway_net_amt(academic_session.matric_gown_fee)
+            lapel_fee = gateway_net_amt(academic_session.lapel_fee)
             text += (', %s Naira Matriculation Gown Fee and %s Naira Lapel/File Fee'
                      % (matric_gown_fee, lapel_fee))
Index: main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py
===================================================================
--- main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py	(revision 13413)
+++ main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py	(revision 13414)
@@ -24,5 +24,5 @@
 from waeup.kofa.accesscodes import create_accesscode
 from waeup.kofa.students.utils import trans
-from waeup.aaue.interswitch.browser import dynamic_gateway_amt
+from waeup.aaue.interswitch.browser import gateway_net_amt
 from waeup.aaue.interfaces import MessageFactory as _
 
@@ -145,8 +145,6 @@
                     # Otherwise we can't add somtehing
                     amount = 0.0
-                amount += academic_session.matric_gown_fee + \
-                    academic_session.lapel_fee - \
-                    dynamic_gateway_amt(academic_session.matric_gown_fee) -\
-                    dynamic_gateway_amt(academic_session.lapel_fee)
+                amount += gateway_net_amt(academic_session.matric_gown_fee) + \
+                    gateway_net_amt(academic_session.lapel_fee)
         elif category == 'late_registration':
             amount = academic_session.late_registration_fee
@@ -183,8 +181,6 @@
                     # Otherwise we can't add somtehing
                     amount = 0.0
-                amount += academic_session.welfare_fee + \
-                    academic_session.union_fee - \
-                    dynamic_gateway_amt(academic_session.welfare_fee) -\
-                    dynamic_gateway_amt(academic_session.union_fee)
+                amount += gateway_net_amt(academic_session.welfare_fee) + \
+                    gateway_net_amt(academic_session.union_fee)
         if amount in (0.0, None):
             return _(u'Amount could not be determined.'), None
