Index: /main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/etranzact/browser.py
===================================================================
--- /main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/etranzact/browser.py	(revision 16083)
+++ /main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/etranzact/browser.py	(revision 16084)
@@ -32,21 +32,60 @@
 
 from kofacustom.nigeria.etranzact.tests import (
-    HOST, HTTPS, SECRET_KEY, TERMINAL_ID)
+    HOST, HTTPS)
 
 HOST = 'www.etranzact.net'
 HTTPS = True
-#SECRET_KEY =
-TERMINAL_ID = '7007134590'
 GATEWAY_AMT = 500.0
 LOGO_URL = 'https://iuokada.waeup.org/static_custom/iou_logo.png'
 
+WEBCONNECT_STUD_PARAMS = {
+    'schoolfee': ('7007139588','QIgl9a35R30A1RGK'),
+    'schoolfee40': ('7007139589','3coU0eolOEbEUeO3'),
+    'secondinstal': ('7007139590','zGpEjy6CdPxCHqen'),
+    'transcript_local': ('7007139592','ndgxUtzJgHRkvXlB'),
+    'transcript_overseas': ('7007139592','ndgxUtzJgHRkvXlB'),
+    'registration': ('7007139599','KGHjZ2hRbaDJGBX8'),
+    'book': ('7007139600','rrKE2Ua7eu8TF0Is'),
+    'parentsconsult': ('7007139598','HsqjOlAB5xfQNDyo'),
+    'sundry': ('7007139591','0XkOFShPnWn8tY5O'),
+    }
+
+def determine_appl_params(payment):
+    terminal_id = ''
+    secret_key = ''
+    if payment.__parent__.__parent__.prefix.startswith('pg'):
+        terminal_id = '7007139606'
+        secret_key = 'E64s3IN9cXRJeltY'
+    else:
+        terminal_id = '7007139604'
+        secret_key = 'vlEEJxvJBjC468g1'
+    return terminal_id, secret_key
+
+def determine_stud_params(payment):
+    terminal_id = ''
+    secret_key = ''
+    for key in WEBCONNECT_STUD_PARAMS.keys():
+        if payment.p_category == key:
+            terminal_id = WEBCONNECT_STUD_PARAMS[key][0]
+            secret_key = WEBCONNECT_STUD_PARAMS[key][1]
+    if not terminal_id:
+        terminal_id = WEBCONNECT_STUD_PARAMS['sundry'][0]
+        secret_key = WEBCONNECT_STUD_PARAMS['sundry'][1]
+    return terminal_id, secret_key
+
 class CustomEtranzactPageApplicant(EtranzactPageApplicant):
 
     host = HOST
     https = HTTPS
-    secret_key = SECRET_KEY
-    terminal_id = TERMINAL_ID
-    logo_url = LOGO_URL
-    gateway_amt = GATEWAY_AMT
+    logo_url = LOGO_URL
+    gateway_amt = GATEWAY_AMT
+
+    @property
+    def terminal_id(self):
+        return determine_appl_params(self.context)[0]
+
+    @property
+    def secret_key(self):
+        return determine_appl_params(self.context)[1]
 
     def update(self):
@@ -73,6 +112,11 @@
 class CustomEtranzactReceiveResponseApplicant(EtranzactReceiveResponseApplicant):
 
-    secret_key = SECRET_KEY
-    terminal_id = TERMINAL_ID
+    @property
+    def terminal_id(self):
+        return determine_appl_params(self.context)[0]
+
+    @property
+    def secret_key(self):
+        return determine_appl_params(self.context)[1]
 
 class CustomEtranzactRequestPaymentStatusPageApplicant(
@@ -81,7 +125,13 @@
     host = HOST
     https = HTTPS
-    secret_key = SECRET_KEY
-    terminal_id = TERMINAL_ID
-    logo_url = LOGO_URL
+    logo_url = LOGO_URL
+
+    @property
+    def terminal_id(self):
+        return determine_appl_params(self.context)[0]
+
+    @property
+    def secret_key(self):
+        return determine_appl_params(self.context)[1]
 
 class CustomEtranzactPageStudent(EtranzactPageStudent):
@@ -89,8 +139,14 @@
     host = HOST
     https = HTTPS
-    secret_key = SECRET_KEY
-    terminal_id = TERMINAL_ID
-    logo_url = LOGO_URL
-    gateway_amt = GATEWAY_AMT
+    logo_url = LOGO_URL
+    gateway_amt = GATEWAY_AMT
+
+    @property
+    def terminal_id(self):
+        return determine_stud_params(self.context)[0]
+
+    @property
+    def secret_key(self):
+        return determine_stud_params(self.context)[1]
 
     def update(self):
@@ -117,6 +173,11 @@
 class CustomEtranzactReceiveResponseStudent(EtranzactReceiveResponseStudent):
 
-    secret_key = SECRET_KEY
-    terminal_id = TERMINAL_ID
+    @property
+    def terminal_id(self):
+        return determine_stud_params(self.context)[0]
+
+    @property
+    def secret_key(self):
+        return determine_stud_params(self.context)[1]
 
 class CustomEtranzactRequestPaymentStatusPageStudent(
@@ -125,7 +186,17 @@
     host = HOST
     https = HTTPS
-    secret_key = SECRET_KEY
-    terminal_id = TERMINAL_ID
-    logo_url = LOGO_URL
+    logo_url = LOGO_URL
+
+    @property
+    def terminal_id(self):
+        return determine_stud_params(self.context)[0]
+
+    @property
+    def secret_key(self):
+        return determine_stud_params(self.context)[1]
+
+
+
+
 
 # Payoutlet customizations
@@ -182,5 +253,5 @@
     """ Query history of Etranzact payments
     """
-    terminal_id = TERMINAL_ID
+    terminal_id = '7007134590'
     host = HOST
     https = HTTPS
