Index: main/waeup.uniben/trunk/src/waeup/uniben/interswitch/browser.py
===================================================================
--- main/waeup.uniben/trunk/src/waeup/uniben/interswitch/browser.py	(revision 11478)
+++ main/waeup.uniben/trunk/src/waeup/uniben/interswitch/browser.py	(revision 11633)
@@ -18,12 +18,9 @@
 import httplib
 import grok
-from zope.component import getUtility
 from kofacustom.nigeria.interswitch.browser import (
     InterswitchPaymentRequestWebservicePageApplicant,
-    InterswitchPaymentRequestWebservicePageStudent
+    InterswitchPaymentRequestWebservicePageStudent,
+    InterswitchPageStudent, InterswitchPageApplicant,
     )
-from waeup.kofa.browser.layout import KofaPage
-from waeup.kofa.interfaces import IKofaUtils
-from waeup.kofa.utils.helpers import to_timezone
 from waeup.uniben.students.interfaces import ICustomStudentOnlinePayment
 from waeup.uniben.applicants.interfaces import ICustomApplicantOnlinePayment
@@ -49,14 +46,9 @@
 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
@@ -65,29 +57,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)
-        if certificate is None:
-            self.flash(_("Study course data are incomplete."))
-            self.redirect(self.url(self.context, '@@index'))
-            return
-        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
@@ -165,14 +134,9 @@
         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
@@ -182,22 +146,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 = 400.0
         if self.applicant.applicant_id.startswith('pg'):
@@ -233,5 +181,5 @@
         return
 
-class InterswitchPaymentRequestWebservicePageStudent(
+class CustomInterswitchPaymentRequestWebservicePageStudent(
     InterswitchPaymentRequestWebservicePageStudent):
     """ Request webservice view for the CollegePAY gateway
@@ -242,5 +190,5 @@
     gateway_url = URL
 
-class InterswitchPaymentRequestWebservicePageApplicant(
+class CustomInterswitchPaymentRequestWebservicePageApplicant(
     InterswitchPaymentRequestWebservicePageApplicant):
     """ Request webservice view for the CollegePAY gateway
Index: main/waeup.uniben/trunk/src/waeup/uniben/interswitch/browser_templates/applicant_goto_interswitch.pt
===================================================================
--- main/waeup.uniben/trunk/src/waeup/uniben/interswitch/browser_templates/applicant_goto_interswitch.pt	(revision 11478)
+++ 	(revision )
@@ -1,78 +1,0 @@
-<form i18n:domain="waeup.uniben"
-  tal:attributes="action view/action" method="POST">
-
-  <p i18n:translate="">
-    These data will be submitted to the CollegePAY payment gateway,
-    please check:
-  </p>
-
-  <table class="form-table" i18n:domain="waeup.kofa">
-    <tbody>
-      <tr>
-        <td i18n:translate="" class="fieldname">
-          Total Amount Authorized:</td>
-        <td>
-          <span tal:replace="view/context/amount_auth">AMOUNT</span>
-        </td>
-      </tr>
-      <tr>
-        <td i18n:translate="" class="fieldname">
-          Transaction Reference:</td>
-        <td>
-          <span tal:replace="view/context/p_id">TXNREF</span>
-        </td>
-      </tr>
-      <tr>
-        <td i18n:translate="" class="fieldname">
-          Customer Id:</td>
-        <td>
-          <span tal:replace="view/applicant/applicant_id">CUSTID</span>
-        </td>
-      </tr>
-      <tr>
-        <td i18n:translate="" class="fieldname">
-          Customer Name:</td>
-        <td>
-          <span tal:replace="view/applicant/display_fullname">CUSTNAME</span>
-        </td>
-      </tr>
-      <tr>
-        <td i18n:translate="" class="fieldname">
-          Payment Item:</td>
-        <td>
-          <span tal:replace="view/context/display_item">PAYMENTITEM</span>
-        </td>
-      </tr>
-      <tr>
-        <td i18n:translate="" class="fieldname">
-          Payment Category:</td>
-        <td>
-          <span tal:replace="view/category">PAYMENTCATEGORY</span>
-        </td>
-      </tr>
-    </tbody>
-  </table>
-
-  <input type="hidden" name="product_id" tal:attributes="value view/product_id" />
-  <input type="hidden" name="currency" tal:attributes="value view/currency" />
-  <input type="hidden" name="pay_item_id" tal:attributes="value view/pay_item_id" />
-  <input type="hidden" name="site_redirect_url" tal:attributes="value view/site_redirect_url" />
-  <input type="hidden" name="site_name" tal:attributes="value view/site_name" />
-  <input type="hidden" name="local_date_time" tal:attributes="value view/local_date_time" />
-  <input type="hidden" name="amount" tal:attributes="value view/amount_auth" />
-  <input type="hidden" name="txn_ref" tal:attributes="value view/context/p_id" />
-  <input type="hidden" name="pay_item_name" tal:attributes="value view/context/display_item" />
-  <input type="hidden" name="cust_id_desc" tal:attributes="value view/category" />
-  <input type="hidden" name="cust_id" tal:attributes="value view/applicant/applicant_id" />
-  <input type="hidden" name="cust_name" tal:attributes="value view/applicant/display_fullname" />
-
-  <input type="hidden" name="payment_params" value="college_split" />
-  <span tal:replace="structure view/xml_data"></span>
-  <br />
-  <input type="submit" class="btn btn-primary" tal:attributes="value view/submit_button"/>
-
-  <br /><br />
-
-  <img src="/static/img/interswitch_verve_mastercard.gif" />
-
-</form>
Index: main/waeup.uniben/trunk/src/waeup/uniben/interswitch/browser_templates/student_goto_interswitch.pt
===================================================================
--- main/waeup.uniben/trunk/src/waeup/uniben/interswitch/browser_templates/student_goto_interswitch.pt	(revision 11478)
+++ 	(revision )
@@ -1,78 +1,0 @@
-<form i18n:domain="waeup.uniben"
-  tal:attributes="action view/action" method="POST">
-
-  <p i18n:translate="">
-    These data will be submitted to the CollegePAY payment gateway,
-    please check:
-  </p>
-
-  <table class="form-table" i18n:domain="waeup.kofa">
-    <tbody>
-      <tr>
-        <td i18n:translate="" class="fieldname">
-          Total Amount Authorized:</td>
-        <td>
-          <span tal:replace="view/context/amount_auth">AMOUNT</span>
-        </td>
-      </tr>
-      <tr>
-        <td i18n:translate="" class="fieldname">
-          Transaction Reference:</td>
-        <td>
-          <span tal:replace="view/context/p_id">TXNREF</span>
-        </td>
-      </tr>
-      <tr>
-        <td i18n:translate="" class="fieldname">
-          Customer Id:</td>
-        <td>
-          <span tal:replace="view/student/student_id">CUSTID</span>
-        </td>
-      </tr>
-      <tr>
-        <td i18n:translate="" class="fieldname">
-          Customer Name:</td>
-        <td>
-          <span tal:replace="view/student/display_fullname">CUSTNAME</span>
-        </td>
-      </tr>
-      <tr>
-        <td i18n:translate="" class="fieldname">
-          Payment Item:</td>
-        <td>
-          <span tal:replace="view/context/display_item">PAYMENTITEM</span>
-        </td>
-      </tr>
-      <tr>
-        <td i18n:translate="" class="fieldname">
-          Payment Category:</td>
-        <td>
-          <span tal:replace="view/category">PAYMENTCATEGORY</span>
-        </td>
-      </tr>
-    </tbody>
-  </table>
-
-  <input type="hidden" name="product_id" tal:attributes="value view/product_id" />
-  <input type="hidden" name="currency" tal:attributes="value view/currency" />
-  <input type="hidden" name="pay_item_id" tal:attributes="value view/pay_item_id" />
-  <input type="hidden" name="site_redirect_url" tal:attributes="value view/site_redirect_url" />
-  <input type="hidden" name="site_name" tal:attributes="value view/site_name" />
-  <input type="hidden" name="local_date_time" tal:attributes="value view/local_date_time" />
-  <input type="hidden" name="amount" tal:attributes="value view/amount_auth" />
-  <input type="hidden" name="txn_ref" tal:attributes="value view/context/p_id" />
-  <input type="hidden" name="pay_item_name" tal:attributes="value view/context/display_item" />
-  <input type="hidden" name="cust_id_desc" tal:attributes="value view/category" />
-  <input type="hidden" name="cust_id" tal:attributes="value view/student/student_id" />
-  <input type="hidden" name="cust_name" tal:attributes="value view/student/display_fullname" />
-
-  <input type="hidden" name="payment_params" value="college_split" />
-  <span tal:replace="structure view/xml_data"></span>
-  <br />
-  <input type="submit" class="btn btn-primary" tal:attributes="value view/submit_button"/>
-
-  <br /><br />
-
-  <img src="/static/img/interswitch_verve_mastercard.gif" />
-
-</form>
Index: main/waeup.uniben/trunk/src/waeup/uniben/interswitch/tests.py
===================================================================
--- main/waeup.uniben/trunk/src/waeup/uniben/interswitch/tests.py	(revision 11478)
+++ main/waeup.uniben/trunk/src/waeup/uniben/interswitch/tests.py	(revision 11633)
@@ -361,5 +361,5 @@
         self.assertTrue(
             'zope.mgr - '
-            'waeup.uniben.interswitch.browser.InterswitchPaymentRequestWebservicePageStudent - '
+            'waeup.uniben.interswitch.browser.CustomInterswitchPaymentRequestWebservicePageStudent - '
             'B1000000 - successful schoolfee payment: p3547789850240\n'
             in logcontent)
