Index: /main/waeup.kwarapoly/trunk/CHANGES.txt
===================================================================
--- /main/waeup.kwarapoly/trunk/CHANGES.txt	(revision 11633)
+++ /main/waeup.kwarapoly/trunk/CHANGES.txt	(revision 11634)
@@ -4,4 +4,7 @@
 1.2dev (unreleased)
 ===================
+
+* Use base classes InterswitchPageApplicant and InterswitchPageStudent from
+  kofacustom.nigeria.
 
 * More special payment fee categories added.
Index: /main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/browser.py
===================================================================
--- /main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/browser.py	(revision 11633)
+++ /main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/browser.py	(revision 11634)
@@ -23,9 +23,7 @@
 from kofacustom.nigeria.interswitch.browser import (
     InterswitchPaymentRequestWebservicePageStudent,
-    InterswitchPaymentRequestWebservicePageApplicant
+    InterswitchPaymentRequestWebservicePageApplicant,
+    InterswitchPageStudent, InterswitchPageApplicant,
     )
-from waeup.kofa.browser.layout import KofaPage, UtilityView
-from waeup.kofa.interfaces import IKofaUtils
-from waeup.kofa.utils.helpers import to_timezone
 from waeup.kwarapoly.students.interfaces import ICustomStudentOnlinePayment
 from waeup.kwarapoly.applicants.interfaces import ICustomApplicantOnlinePayment
@@ -53,14 +51,10 @@
 httplib.HTTPConnection.debuglevel = 0
 
-class InterswitchPageStudent(KofaPage):
+class CustomInterswitchPageStudent(InterswitchPageStudent):
     """ View which sends a POST request to the Interswitch
     CollegePAY payment gateway.
     """
     grok.context(ICustomStudentOnlinePayment)
-    grok.name('goto_interswitch')
     grok.template('student_goto_interswitch')
-    grok.require('waeup.payStudent')
-    label = _('Submit data to CollegePAY (Interswitch Payment Gateway)')
-    submit_button = _('Submit')
     action = POST_ACTION
     site_name = SITE_NAME
@@ -73,25 +67,6 @@
 
     def update(self):
-        #if self.context.p_state != 'unpaid':
-        if self.context.p_state == 'paid':
-            self.flash(_("Payment ticket can't be re-send to CollegePAY."))
-            self.redirect(self.url(self.context, '@@index'))
-            return
-
-        student = self.student = self.context.student
-        certificate = getattr(student['studycourse'],'certificate',None)
-        self.amount_auth = 100 * self.context.amount_auth
-        xmldict = {}
-        if certificate is not None:
-            xmldict['department'] = certificate.__parent__.__parent__.code
-            xmldict['faculty'] = certificate.__parent__.__parent__.__parent__.code
-        else:
-            xmldict['department'] = None
-            xmldict['faculty'] = None
-        self.category = getUtility(IKofaUtils).PAYMENT_CATEGORIES[self.context.p_category]
-        tz = getUtility(IKofaUtils).tzinfo
-        self.local_date_time = to_timezone(
-            self.context.creation_date, tz).strftime("%Y-%m-%d %H:%M:%S %Z")
-        self.site_redirect_url = self.url(self.context, 'request_webservice')
+        student, certificate, xmldict = super(
+            CustomInterswitchPageStudent, self).update()
         # Provider data
         xmldict['detail_ref'] = self.context.p_id
@@ -243,14 +218,10 @@
         return
 
-class InterswitchPageApplicant(KofaPage):
+class CustomInterswitchPageApplicant(InterswitchPageApplicant):
     """ View which sends a POST request to the Interswitch
     CollegePAY payment gateway.
     """
     grok.context(ICustomApplicantOnlinePayment)
-    grok.require('waeup.payApplicant')
     grok.template('applicant_goto_interswitch')
-    grok.name('goto_interswitch')
-    label = _('Submit data to CollegePAY (Interswitch Payment Gateway)')
-    submit_button = _('Submit')
     action = POST_ACTION
     site_name = SITE_NAME
@@ -264,23 +235,6 @@
 
     def update(self):
-        if self.context.p_state != 'unpaid':
-            self.flash(_("Payment ticket can't be re-send to CollegePAY."))
-            self.redirect(self.url(self.context, '@@index'))
-            return
-        if self.context.__parent__.__parent__.expired \
-            and self.context.__parent__.__parent__.strict_deadline:
-            self.flash(_("Payment ticket can't be send to CollegePAY. "
-                         "Application period has expired."))
-            self.redirect(self.url(self.context, '@@index'))
-            return
-        self.applicant = self.context.__parent__
-        self.amount_auth = 100 * self.context.amount_auth
+        super(CustomInterswitchPageApplicant, self).update()
         xmldict = {}
-        self.category = getUtility(
-            IKofaUtils).PAYMENT_CATEGORIES[self.context.p_category]
-        tz = getUtility(IKofaUtils).tzinfo
-        self.local_date_time = to_timezone(
-            self.context.creation_date, tz).strftime("%Y-%m-%d %H:%M:%S %Z")
-        self.site_redirect_url = self.url(self.context, 'request_webservice')
         provider_amt = 300.0
         dalash_amt = 200.0
@@ -416,5 +370,5 @@
         return
 
-class InterswitchPaymentRequestWebservicePageStudent(
+class CustomInterswitchPaymentRequestWebservicePageStudent(
     InterswitchPaymentRequestWebservicePageStudent):
     """ Request webservice view for the CollegePAY gateway
@@ -425,5 +379,5 @@
     gateway_url = URL
 
-class InterswitchPaymentRequestWebservicePageApplicant(
+class CustomInterswitchPaymentRequestWebservicePageApplicant(
     InterswitchPaymentRequestWebservicePageApplicant):
     """ Request webservice view for the CollegePAY gateway
