Index: main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/etranzact/browser.py
===================================================================
--- main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/etranzact/browser.py	(revision 15733)
+++ main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/etranzact/browser.py	(revision 15773)
@@ -22,7 +22,10 @@
 from kofacustom.nigeria.etranzact.studentsbrowser import (
     EtranzactPageStudent, EtranzactReceiveResponseStudent,
-    EtranzactRequestPaymentStatusPageStudent)
+    EtranzactRequestPaymentStatusPageStudent, webconnect_module_activated)
 from kofacustom.nigeria.etranzact.payoutletbrowser import (
-    EtranzactQueryHistoryPageStudent, EtranzactQueryHistoryPageApplicant)
+    EtranzactEnterPinPageStudent, EtranzactEnterPinPageApplicant,
+    EtranzactQueryHistoryPageStudent, EtranzactQueryHistoryPageApplicant,
+    payoutlet_module_activated)
+from kofacustom.nigeria.etranzact.payoutletwebservice  import NigeriaPaymentDataWebservice
 
 # Temporarily we can use the test portal like in kofacustom.nigeria
@@ -35,4 +38,5 @@
 #SECRET_KEY =
 #TERMINAL_ID =
+GATEWAY_AMT = 500.0
 LOGO_URL = 'https://iuokada.waeup.org/static_custom/iou_logo.png'
 
@@ -44,4 +48,24 @@
     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 webconnect_module_activated(
+            self.context.__parent__.__parent__.year, self.context):
+            return _("Etranzact payments deactivated.")
+        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):
@@ -66,4 +90,24 @@
     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 webconnect_module_activated(
+            self.context.student.current_session, self.context):
+            return _("Etranzact payments deactivated.")
+        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):
@@ -81,4 +125,52 @@
     logo_url = LOGO_URL
 
+# Payoutlet customizations
+
+class CustomEtranzactEnterPinPageStudent(EtranzactEnterPinPageStudent):
+    """Enter confirmation PIN and submit to `EtranzactQueryHistoryPageStudent`
+    """
+    gateway_amt = GATEWAY_AMT
+
+    def update(self):
+        if not payoutlet_module_activated(
+            self.context.student.current_session, self.context):
+            return
+        super(EtranzactEnterPinPageStudent, self).update()
+        # 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 == 'registration':
+            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
+            self.context.r_company = u'etranzact'
+        return
+
+class CustomEtranzactEnterPinPageApplicant(EtranzactEnterPinPageApplicant):
+    """Enter confirmation PIN and submit to `EtranzactQueryHistoryPageApplicant`
+    """
+    gateway_amt = GATEWAY_AMT
+
+    def update(self):
+        if not payoutlet_module_activated(
+            self.context.__parent__.__parent__.year, self.context):
+            return
+        super(EtranzactEnterPinPageStudent, self).update()
+        # 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
+            self.context.r_company = u'etranzact'
+        return
+
 class CustomEtranzactQueryHistoryPageStudent(EtranzactQueryHistoryPageStudent):
     """ Query history of Etranzact payments
@@ -94,2 +186,13 @@
     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',),
+         }
