Index: main/kofacustom.skeleton/trunk/src/kofacustom/skeleton/etranzact/browser.py
===================================================================
--- main/kofacustom.skeleton/trunk/src/kofacustom/skeleton/etranzact/browser.py	(revision 15755)
+++ main/kofacustom.skeleton/trunk/src/kofacustom/skeleton/etranzact/browser.py	(revision 15756)
@@ -23,9 +23,13 @@
     EtranzactPageStudent, EtranzactReceiveResponseStudent,
     EtranzactRequestPaymentStatusPageStudent)
+from kofacustom.nigeria.etranzact.payoutletbrowser import (
+    EtranzactEnterPinPageStudent, EtranzactEnterPinPageApplicant,
+    EtranzactQueryHistoryPageStudent, EtranzactQueryHistoryPageApplicant)
+from kofacustom.nigeria.etranzact.payoutletwebservice  import NigeriaPaymentDataWebservice
 
 # Temporarily we can use the test portal like in kofacustom.nigeria
 
 from kofacustom.nigeria.etranzact.tests import (
-    HOST, HTTPS, SECRET_KEY, TERMINAL_ID)
+    HOST, HTTPS, SECRET_KEY, TERMINAL_ID, GATEWAY_AMT)
 
 #HOST =
@@ -33,4 +37,5 @@
 #SECRET_KEY =
 #TERMINAL_ID =
+#GATEWAY_AMT =
 LOGO_URL = 'https://iuokada.waeup.org/static_custom/iou_logo.png'
 
@@ -42,4 +47,21 @@
     terminal_id = TERMINAL_ID
     logo_url = LOGO_URL
+    gateway_amt = GATEWAY_AMT
+
+    def update(self):
+        # 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()
+        if error:
+            self.flash(error, type='danger')
+            self.redirect(self.url(self.context, '@@index'))
+            return
+        return
 
 class CustomEtranzactReceiveResponseApplicant(EtranzactReceiveResponseApplicant):
@@ -64,4 +86,21 @@
     terminal_id = TERMINAL_ID
     logo_url = LOGO_URL
+    gateway_amt = GATEWAY_AMT
+
+    def update(self):
+        # 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()
+        if error:
+            self.flash(error, type='danger')
+            self.redirect(self.url(self.context, '@@index'))
+            return
+        return
 
 class CustomEtranzactReceiveResponseStudent(EtranzactReceiveResponseStudent):
@@ -79,4 +118,39 @@
     logo_url = LOGO_URL
 
+# Payoutlet customizations
 
+class CustomEtranzactEnterPinPageStudent(EtranzactEnterPinPageStudent):
+    """Enter confirmation PIN and submit to `EtranzactQueryHistoryPageStudent`
+    """
+    gateway_amt = GATEWAY_AMT
 
+class CustomEtranzactEnterPinPageApplicant(EtranzactEnterPinPageApplicant):
+    """Enter confirmation PIN and submit to `EtranzactQueryHistoryPageApplicant`
+    """
+    gateway_amt = GATEWAY_AMT
+
+class CustomEtranzactQueryHistoryPageStudent(EtranzactQueryHistoryPageStudent):
+    """ Query history of Etranzact payments
+    """
+    terminal_id = TERMINAL_ID
+    host = HOST
+    https = HTTPS
+
+class CustomEtranzactQueryHistoryPageApplicant(EtranzactQueryHistoryPageApplicant):
+    """ Query history of Etranzact payments
+    """
+    terminal_id = TERMINAL_ID
+    host = HOST
+    https = HTTPS
+
+class CustomPaymentDataWebservice(NigeriaPaymentDataWebservice):
+    """A simple webservice to publish payment and payer details on request from
+    accepted IP addresses without authentication.
+    """
+    #ACCEPTED_IP = ('195.219.3.181', '195.219.3.184')
+    ACCEPTED_IP = None
+
+    CATEGORY_MAPPING = {
+        'SCHOOLFEE': ('schoolfee',),
+         }
+
Index: main/kofacustom.skeleton/trunk/src/kofacustom/skeleton/interswitch/browser.py
===================================================================
--- main/kofacustom.skeleton/trunk/src/kofacustom/skeleton/interswitch/browser.py	(revision 15755)
+++ main/kofacustom.skeleton/trunk/src/kofacustom/skeleton/interswitch/browser.py	(revision 15756)
@@ -59,5 +59,6 @@
     currency = CURRENCY
     product_id = PRODUCT_ID
-    mac = MAC  
+    mac = MAC
+    gateway_amt = GATEWAY_AMT
 
     def update(self):
@@ -67,4 +68,11 @@
             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'
         student = self.student
         xmldict = self.xmldict
@@ -77,5 +85,4 @@
         xmldict['institution_acct'] = '00000000'
         xmldict['institution_bank_id'] = '00'
-        xmldict['institution_amt'] = '0.0'
         provider_amt = 0.0
         self.pay_item_id = '0000' # must be provided by Interswitch
@@ -83,7 +90,8 @@
         xmldict['institution_item_name'] = self.context.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
+        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
         if provider_amt == 0:
             xmltext = """<payment_item_detail>
@@ -101,6 +109,5 @@
         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.amount_auth = int(100 * self.context.amount_auth)
         hashargs = (
             self.context.p_id +
@@ -124,4 +131,5 @@
     product_id = PRODUCT_ID
     mac = MAC
+    gateway_amt = GATEWAY_AMT
 
     def update(self):
@@ -131,4 +139,11 @@
             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'
         xmldict = {}
         provider_amt = 400.0
@@ -140,8 +155,10 @@
         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_item_name'] = self.context.category
         xmldict['institution_name'] = INSTITUTION_NAME
-        # Interswitch amount is not part of the xml data
+        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
         xmltext = """<payment_item_detail>
 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s">
@@ -151,7 +168,5 @@
 </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.amount_auth = int(100 * self.context.amount_auth)
         hashargs = (
             self.context.p_id +
Index: main/kofacustom.skeleton/trunk/src/kofacustom/skeleton/interswitch/tests.py
===================================================================
--- main/kofacustom.skeleton/trunk/src/kofacustom/skeleton/interswitch/tests.py	(revision 15755)
+++ main/kofacustom.skeleton/trunk/src/kofacustom/skeleton/interswitch/tests.py	(revision 15756)
@@ -70,13 +70,13 @@
             '<span>40000.0</span>' in self.browser.contents)
         self.payment_url = self.browser.url
-        self.browser.getLink("CollegePAY", index=0).click()
+        self.browser.getLink("Pay via Interswitch", index=0).click()
         self.assertTrue('<input type="hidden" name="pay_item_id" value="0000" />' in
                            self.browser.contents)
         self.assertEqual(self.student.current_mode, 'ug_ft')
         self.assertTrue(
-            '<input type="hidden" name="amount" value="4000000" />' in
-            self.browser.contents)
-        self.assertTrue(
-            'item_name="School Fee" item_amt="3985000" bank_id="00" acct_num="00000000"' in
+            '<input type="hidden" name="amount" value="4015000" />' in
+            self.browser.contents)
+        self.assertTrue(
+            'item_name="School Fee" item_amt="4000000" bank_id="00" acct_num="00000000"' in
             self.browser.contents)
 
@@ -88,8 +88,8 @@
         acc_payment.p_id = 'xyz'
         acc_payment.pay_item_id = '123'
-        acc_payment.amount_auth = 876.0
+        acc_payment.amount_auth = 1000.0
         self.student['payments']['xyz'] = acc_payment
         self.browser.open(self.payments_path + '/xyz')
-        self.browser.getLink("CollegePAY", index=0).click()
+        self.browser.getLink("Pay via Interswitch", index=0).click()
         self.assertMatches('...<input type="hidden" name="pay_item_id" value="0000" />...',
                            self.browser.contents)
@@ -98,10 +98,10 @@
         self.assertEqual(self.student.current_mode, 'ug_ft')
         self.assertMatches(
-            '...<input type="hidden" name="amount" value="87600" />...',
+            '...<input type="hidden" name="amount" value="115000" />...',
             self.browser.contents)
         delta = timedelta(days=8)
         acc_payment.creation_date -= delta
         self.browser.open(self.payments_path + '/xyz')
-        self.browser.getLink("CollegePAY", index=0).click()
+        self.browser.getLink("Pay via Interswitch", index=0).click()
         self.assertMatches(
             '...This payment ticket is too old. Please create a new ticket...',
@@ -110,5 +110,5 @@
         acc_payment.creation_date += delta
         self.browser.open(self.payments_path + '/xyz')
-        self.browser.getLink("CollegePAY", index=0).click()
+        self.browser.getLink("Pay via Interswitch", index=0).click()
         self.assertMatches('...Total Amount Authorized:...',
                            self.browser.contents)
@@ -229,5 +229,5 @@
     def test_interswitch_form(self):
         # Manager can access InterswitchForm
-        self.browser.getLink("CollegePAY", index=0).click()
+        self.browser.getLink("Pay via Interswitch", index=0).click()
         self.assertMatches('...Total Amount Authorized:...',
                            self.browser.contents)
@@ -238,5 +238,5 @@
         self.applicant.values()[0].creation_date -= delta
         self.browser.open(self.payment_url)
-        self.browser.getLink("CollegePAY", index=0).click()
+        self.browser.getLink("Pay via Interswitch", index=0).click()
         self.assertMatches(
             '...This payment ticket is too old. Please create a new ticket...',
Index: main/kofacustom.skeleton/trunk/src/kofacustom/skeleton/remita/browser.py
===================================================================
--- main/kofacustom.skeleton/trunk/src/kofacustom/skeleton/remita/browser.py	(revision 15755)
+++ main/kofacustom.skeleton/trunk/src/kofacustom/skeleton/remita/browser.py	(revision 15756)
@@ -91,5 +91,4 @@
             return
         self.orderId = self.context.p_id
-        self.amount = str(self.context.amount_auth)
         error = self.init_update()
         if error:
@@ -97,4 +96,12 @@
             self.redirect(self.url(self.context, '@@index'))
             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
 
@@ -150,5 +157,4 @@
             return
         self.orderId = self.context.p_id
-        self.amount = str(self.context.amount_auth)
         error = self.init_update()
         if error:
@@ -156,3 +162,11 @@
             self.redirect(self.url(self.context, '@@index'))
             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.skeleton/trunk/src/kofacustom/skeleton/students/tests/test_export.py
===================================================================
--- main/kofacustom.skeleton/trunk/src/kofacustom/skeleton/students/tests/test_export.py	(revision 15755)
+++ main/kofacustom.skeleton/trunk/src/kofacustom/skeleton/students/tests/test_export.py	(revision 15756)
@@ -103,10 +103,11 @@
         result = open(self.outfile, 'rb').read()
         self.assertMatches(
-            'ac,amount_auth,creation_date,gateway_amt,p_category,p_combi,p_current,'
+            'ac,amount_auth,creation_date,gateway_amt,net_amt,'
+            'p_category,p_combi,p_current,'
             'p_id,p_item,p_level,p_session,p_state,payment_date,provider_amt,'
             'r_amount_approved,r_card_num,r_code,r_company,r_desc,'
             'r_pay_reference,thirdparty_amt,student_id,state,'
             'current_session\r\n'
-            '666,12.12,%s-04-01 13:12:01#,,schoolfee,[],1,my-id,p-item,'
+            '666,12.12,%s-04-01 13:12:01#,,,schoolfee,[],1,my-id,p-item,'
             '100,%s,paid,%s-04-01 14:12:01#,,12.12,'
             '789,r-code,interswatch,,,,A111111,created,2012\r\n'
