Index: /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/applicants/payment.py
===================================================================
--- /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/applicants/payment.py	(revision 15754)
+++ /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/applicants/payment.py	(revision 15755)
@@ -41,10 +41,6 @@
         return
 
-    @property
-    def net_amt(self):
-        return self.amount_auth - self.provider_amt - self.gateway_amt
-
 NigeriaApplicantOnlinePayment = attrs_to_fields(
-    NigeriaApplicantOnlinePayment, omit=['display_item', 'net_amt'])
+    NigeriaApplicantOnlinePayment, omit=['display_item',])
 
 # Applicant online payments must be importable. So we might need a factory.
Index: /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/applicantsbrowser.py
===================================================================
--- /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/applicantsbrowser.py	(revision 15754)
+++ /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/applicantsbrowser.py	(revision 15755)
@@ -33,5 +33,5 @@
 
 from kofacustom.nigeria.etranzact.tests import (
-    TERMINAL_ID, HOST, HTTPS, SECRET_KEY, LOGO_URL)
+    TERMINAL_ID, HOST, HTTPS, SECRET_KEY, LOGO_URL, GATEWAY_AMT)
 
 grok.templatedir('browser_templates')
@@ -93,4 +93,5 @@
     terminal_id = TERMINAL_ID
     logo_url = LOGO_URL
+    gateway_amt = GATEWAY_AMT
 
     @property
@@ -101,4 +102,6 @@
 
     def init_update(self):
+        if not module_activated(self.context.__parent__.__parent__.year):
+            return _("Etranzact payments deactivated.")
         if self.context.p_state == 'paid':
             return _("Payment ticket can't be re-sent to Etranzact.")
@@ -116,7 +119,6 @@
         # which authenticates the response.
         self.responseurl = self.url(self.context, 'receive_etranzact')
-        # Already now it becomes a Etranzact payment
-        self.context.r_company = u'etranzact'
-        hashargs = 	self.amount + self.terminal_id+self.transaction_id \
+        self.transaction_id = self.context.p_id
+        hashargs = 	self.amount + self.terminal_id + self.transaction_id \
             + self.responseurl + self.secret_key
         self.hashvalue = hashlib.md5(hashargs).hexdigest()
@@ -125,7 +127,11 @@
 
     def update(self):
-        if not module_activated(self.context.__parent__.__parent__.year):
-            return
-        self.transaction_id = self.context.p_id
+        # Already now it becomes an Etranzact payment. We set the net amount
+        # and add the gateway amount.
+        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
         error = self.init_update()
Index: /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/helpers.py
===================================================================
--- /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/helpers.py	(revision 15754)
+++ /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/helpers.py	(revision 15755)
@@ -181,5 +181,4 @@
     payment.r_card_num = "%s %s" % (form.get('CARD_TYPE', None),
                                     form.get('CARD_NO', None))
-    payment.r_company = u'etranzact'
     if payment.r_code != '0':
         msg = _('Unsuccessful response: ${a}', mapping = {'a': payment.r_desc})
Index: /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/payoutletbrowser.py
===================================================================
--- /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/payoutletbrowser.py	(revision 15754)
+++ /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/payoutletbrowser.py	(revision 15755)
@@ -39,5 +39,5 @@
 from kofacustom.nigeria.students.interfaces import INigeriaStudentOnlinePayment
 from kofacustom.nigeria.applicants.interfaces import INigeriaApplicantOnlinePayment
-from kofacustom.nigeria.etranzact.tests import HOST, TERMINAL_ID, HTTPS
+from kofacustom.nigeria.etranzact.tests import HOST, TERMINAL_ID, HTTPS, GATEWAY_AMT
 from kofacustom.nigeria.etranzact.helpers import query_payoutlet
 
@@ -84,5 +84,5 @@
 
 class EtranzactEnterPinPageStudent(KofaPage):
-    """
+    """Enter confirmation PIN and submit to `EtranzactQueryHistoryPageStudent`
     """
     grok.context(INigeriaStudentOnlinePayment)
@@ -95,13 +95,23 @@
     action = 'query_payoutlet_history'
     placeholder = _('Confirmation Number (PIN)')
+    gateway_amt = GATEWAY_AMT
 
     def update(self):
         if not module_activated(self.context.student.current_session):
             return
+        if self.context.r_company and self.context.r_company != 'etranzact':
+            return _("Payment ticket has been used for another payment gateway.")
         super(EtranzactEnterPinPageStudent, self).update()
+        # Already now it becomes an Etranzact payment. We set the net amount
+        # and add the gateway amount.
+        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
 
 class EtranzactEnterPinPageApplicant(EtranzactEnterPinPageStudent):
-    """
+    """Enter confirmation PIN and submit to `EtranzactQueryHistoryPageApplicant`
     """
     grok.require('waeup.payApplicant')
@@ -155,5 +165,4 @@
         if not module_activated(self.context.__parent__.__parent__.year):
             return
-        ob_class = self.__implemented__.__name__
         if self.context.p_state == 'paid':
             self.flash(_('This ticket has already been paid.'))
Index: /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/studentsbrowser.py
===================================================================
--- /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/studentsbrowser.py	(revision 15754)
+++ /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/studentsbrowser.py	(revision 15755)
@@ -33,5 +33,5 @@
 
 from kofacustom.nigeria.etranzact.tests import (
-    TERMINAL_ID, HOST, HTTPS, SECRET_KEY, LOGO_URL)
+    TERMINAL_ID, HOST, HTTPS, SECRET_KEY, LOGO_URL, GATEWAY_AMT)
 
 grok.templatedir('browser_templates')
@@ -93,4 +93,5 @@
     terminal_id = TERMINAL_ID
     logo_url = LOGO_URL
+    gateway_amt = GATEWAY_AMT
 
     @property
@@ -101,4 +102,6 @@
 
     def init_update(self):
+        if not module_activated(self.context.student.current_session):
+            return _("Etranzact payments deactivated.")
         if self.context.p_state == 'paid':
             return _("Payment ticket can't be re-sent to Etranzact.")
@@ -116,7 +119,6 @@
         # which authenticates the response.
         self.responseurl = self.url(self.context, 'receive_etranzact')
-        # Already now it becomes a Etranzact payment
-        self.context.r_company = u'etranzact'
-        hashargs = 	self.amount + self.terminal_id+self.transaction_id \
+        self.transaction_id = self.context.p_id
+        hashargs = 	self.amount + self.terminal_id + self.transaction_id \
             + self.responseurl + self.secret_key
         self.hashvalue = hashlib.md5(hashargs).hexdigest()
@@ -125,7 +127,11 @@
 
     def update(self):
-        if not module_activated(self.context.student.current_session):
-            return
-        self.transaction_id = self.context.p_id
+        # Already now it becomes an Etranzact payment. We set the net amount
+        # and add the gateway amount.
+        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
         error = self.init_update()
Index: /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/tests.py
===================================================================
--- /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/tests.py	(revision 15754)
+++ /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/tests.py	(revision 15755)
@@ -41,5 +41,5 @@
 #   do exist really and are not bothered by being spammed by a test programme.
 
-EXTERNAL_TESTS = True
+EXTERNAL_TESTS = False
 
 TERMINAL_ID = '5003021194'
@@ -48,4 +48,5 @@
 SECRET_KEY = 'DEMO_KEY'
 LOGO_URL = 'https://iuokada.waeup.org/static_custom/iou_logo.png'
+GATEWAY_AMT = 500.0
 
 # Valid transaction id in Etranzact system
Index: /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/browser.py
===================================================================
--- /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/browser.py	(revision 15754)
+++ /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/browser.py	(revision 15755)
@@ -34,4 +34,6 @@
 from kofacustom.nigeria.interfaces import MessageFactory as _
 
+GATEWAY_AMT = 300.0
+
 # Buttons
 
@@ -306,4 +308,5 @@
     xml_data = None
     hashvalue = None
+    gateway_amt = GATEWAY_AMT
 
     def init_update(self):
@@ -317,4 +320,6 @@
         if time_delta.days > 7:
             return _("This payment ticket is too old. Please create a new ticket.")
+        if self.context.r_company and self.context.r_company != 'interswitch':
+            return _("Payment ticket has been used for another payment gateway.")
         student = self.context.student
         certificate = getattr(student['studycourse'],'certificate',None)
@@ -326,5 +331,4 @@
             self.context.p_item, self.context.p_session):
             return _("This type of payment has already been made.")
-        self.amount_auth = int(100 * self.context.amount_auth)
         xmldict = {}
         if certificate is not None:
@@ -341,5 +345,4 @@
         self.student = student
         self.xmldict = xmldict
-        self.context.r_company = u'interswitch'
         return
 
@@ -351,4 +354,12 @@
             self.flash(error, type='danger')
             self.redirect(self.url(self.context, '@@index'))
+        # Already now it becomes an Interswitch payment. We set the net amount
+        # and add the gateway amount.
+        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'interswitch'
+        self.amount_auth = int(100 * self.context.amount_auth)
         return
 
@@ -363,5 +374,4 @@
     label = _('Submit data to CollegePAY (Interswitch Payment Gateway)')
     submit_button = _('Submit')
-    hashvalue = None
 
     action = None
@@ -371,4 +381,6 @@
     product_id = None
     xml_data = None
+    hashvalue = None
+    gateway_amt = GATEWAY_AMT
 
     def init_update(self):
@@ -379,4 +391,6 @@
             return _("Payment ticket can't be send to CollegePAY. "
                      "Application period has expired.")
+        if self.context.r_company and self.context.r_company != 'interswitch':
+            return _("Payment ticket has been used for another payment gateway.")
         tz = getUtility(IKofaUtils).tzinfo
         time_delta = datetime.utcnow() - self.context.creation_date
@@ -384,5 +398,4 @@
             return _("This payment ticket is too old. Please create a new ticket.")
         self.applicant = self.context.__parent__
-        self.amount_auth = int(100 * self.context.amount_auth)
         self.category = self.context.category
         tz = getUtility(IKofaUtils).tzinfo
@@ -390,5 +403,4 @@
             self.context.creation_date, tz).strftime("%Y-%m-%d %H:%M:%S %Z")
         self.site_redirect_url = self.url(self.context, 'request_webservice')
-        self.context.r_company = u'interswitch'
         return
 
@@ -400,3 +412,11 @@
             self.flash(error, type='danger')
             self.redirect(self.url(self.context, '@@index'))
-        return
+        # Already now it becomes an Interswitch payment. We set the net amount
+        # and add the gateway amount.
+        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'interswitch'
+        self.amount_auth = int(100 * self.context.amount_auth)
+        return
Index: /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/tests.py
===================================================================
--- /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/tests.py	(revision 15754)
+++ /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/tests.py	(revision 15755)
@@ -103,9 +103,9 @@
         # Split amounts have been set.
         self.assertEqual(self.student['payments'][value].provider_amt, 0.0)
-        self.assertEqual(self.student['payments'][value].gateway_amt, 0.0)
+        self.assertEqual(self.student['payments'][value].gateway_amt, 300.0)
         self.assertMatches('...<input type="hidden" name="pay_item_id" />...',
                            self.browser.contents)
-        self.assertMatches(
-            '...<input type="hidden" name="amount" value="2000000" />...',
+        self.assertTrue(
+            '<input type="hidden" name="amount" value="2030000" />' in
             self.browser.contents)
 
@@ -118,6 +118,6 @@
                            self.browser.contents)
         self.assertEqual(self.student.current_mode, 'ug_ft')
-        self.assertMatches(
-            '...<input type="hidden" name="amount" value="4000000" />...',
+        self.assertTrue(
+            '<input type="hidden" name="amount" value="4030000" />' in
             self.browser.contents)
         delta = timedelta(days=8)
Index: /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/payments/interfaces.py
===================================================================
--- /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/payments/interfaces.py	(revision 15754)
+++ /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/payments/interfaces.py	(revision 15755)
@@ -111,5 +111,5 @@
         default = 0.0,
         required = False,
-        readonly = True,
+        readonly = False,
         )
 
Index: /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/applicantsbrowser.py
===================================================================
--- /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/applicantsbrowser.py	(revision 15754)
+++ /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/applicantsbrowser.py	(revision 15755)
@@ -34,5 +34,5 @@
 
 from kofacustom.nigeria.remita.tests import (
-    MERCHANTID, HOST, HTTPS, API_KEY, SERVICETYPEID)
+    MERCHANTID, HOST, HTTPS, API_KEY, SERVICETYPEID, GATEWAY_AMT)
 
 grok.templatedir('browser_templates')
@@ -235,4 +235,6 @@
         if self.context.p_state == 'paid':
             return _("Payment ticket can't be re-sent to Remita.")
+        if self.context.r_company and self.context.r_company != 'remita':
+            return _("Payment ticket has been used for another payment gateway.")
         now = datetime.utcnow()
         if self.context.creation_date.tzinfo is not None:
@@ -260,6 +262,4 @@
         if resp.get('statuscode') not in ('021', '025', '055'):
             return 'RRR generation message from Remita: ' + resp.get('status')
-        # Already now it becomes a Remita payment
-        self.context.r_company = u'remita'
         self.rrr = self.context.r_pay_reference = resp['RRR'].rstrip()
         hashargs = 	self.merchantId + self.rrr + self.api_key
@@ -269,5 +269,4 @@
             'RRR retrieved: %s, ServiceTypeId: %s'
             % (self.rrr, self.serviceTypeId))
-
         return
 
@@ -281,3 +280,11 @@
             self.redirect(self.url(self.context, '@@index'))
             return
-        return
+        # Already now it becomes a Remita payment. We set the net amount
+        # and add the gateway amount.
+        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'remita'
+        self.amount_auth = int(100 * self.context.amount_auth)
+        return
Index: /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/studentsbrowser.py
===================================================================
--- /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/studentsbrowser.py	(revision 15754)
+++ /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/studentsbrowser.py	(revision 15755)
@@ -34,5 +34,5 @@
 
 from kofacustom.nigeria.remita.tests import (
-    MERCHANTID, HOST, HTTPS, API_KEY, SERVICETYPEID)
+    MERCHANTID, HOST, HTTPS, API_KEY, SERVICETYPEID, GATEWAY_AMT)
 
 grok.templatedir('browser_templates')
@@ -221,4 +221,5 @@
     api_key = API_KEY
     serviceTypeId = SERVICETYPEID
+    gateway_amt = GATEWAY_AMT
 
     #orderId = '3456346346'
@@ -243,4 +244,6 @@
         if self.context.p_state == 'paid':
             return _("Payment ticket can't be re-sent to Remita.")
+        if self.context.r_company and self.context.r_company != 'remita':
+            return _("Payment ticket has been used for another payment gateway.")
         now = datetime.utcnow()
         if self.context.creation_date.tzinfo is not None:
@@ -276,6 +279,4 @@
         if resp.get('statuscode') not in ('021', '025', '055'):
             return 'RRR generation message from Remita: ' + resp.get('status')
-        # Already now it becomes a Remita payment
-        self.context.r_company = u'remita'
         self.rrr = self.context.r_pay_reference = resp['RRR'].rstrip()
         hashargs = 	self.merchantId + self.rrr + self.api_key
@@ -296,3 +297,11 @@
             self.redirect(self.url(self.context, '@@index'))
             return
-        return
+        # Already now it becomes a Remita payment. We set the net amount
+        # and add the gateway amount.
+        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'remita'
+        self.amount_auth = int(100 * self.context.amount_auth)
+        return
Index: /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/tests.py
===================================================================
--- /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/tests.py	(revision 15754)
+++ /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/tests.py	(revision 15755)
@@ -44,4 +44,5 @@
 API_KEY = '1946'
 SERVICETYPEID = '4430731'
+GATEWAY_AMT = 0.0
 
 def external_test(func):
@@ -86,4 +87,7 @@
                 lineitems=self.lineitems)
         return resp
+
+    def test_dummytest(self):
+        return
 
     @external_test
Index: /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/payments.py
===================================================================
--- /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/payments.py	(revision 15754)
+++ /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/payments.py	(revision 15755)
@@ -64,10 +64,6 @@
             return None
 
-    @property
-    def net_amt(self):
-        return self.amount_auth - self.provider_amt - self.gateway_amt
-
 NigeriaStudentOnlinePayment = attrs_to_fields(NigeriaStudentOnlinePayment,
-    omit=['display_item', 'net_amt'])
+    omit=['display_item',])
 
 class NigeriaStudentOnlinePaymentFactory(StudentOnlinePaymentFactory):
