Index: /main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser.py
===================================================================
--- /main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser.py	(revision 11781)
+++ /main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser.py	(revision 11782)
@@ -19,14 +19,19 @@
 """
 import grok
-from zope.component import getUtility
+from zope.component import getUtility, createObject
 from zope.security import checkPermission
 from waeup.kofa.interfaces import IExtFileStore
 from waeup.kofa.applicants.browser import (
     ApplicantRegistrationPage, ApplicantsContainerPage,
-    ApplicationFeePaymentAddPage)
+    ApplicationFeePaymentAddPage,
+    OnlinePaymentApprovePage)
+from waeup.kofa.applicants.interfaces import (
+    ISpecialApplicant, IApplicantsUtils)
 from kofacustom.nigeria.applicants.browser import (
     NigeriaApplicantDisplayFormPage,
     NigeriaApplicantManageFormPage,
     NigeriaPDFApplicationSlip)
+from waeup.uniben.applicants.interfaces import (
+    ICustomApplicant)
 
 from waeup.uniben.interfaces import MessageFactory as _
@@ -106,4 +111,14 @@
         return self.target.startswith('pude') \
                and self.context.state in ('paid', 'submitted') 
+
+    # customizations for admission checking payments
+    @property
+    def form_fields(self):
+        if self.context.special:
+            form_fields = grok.AutoFields(ISpecialApplicant).omit('locked')
+        else:
+            form_fields = grok.AutoFields(ICustomApplicant).omit(
+                'locked', 'course_admitted', 'password', 'suspended')
+        return form_fields
 
 class CustomNigeriaPDFApplicationSlip(NigeriaPDFApplicationSlip):
@@ -129,9 +144,41 @@
         store = getUtility(IExtFileStore)
         if not store.getFileByContext(self.context, attr=u'passport.jpg'):
-            return _('Upload your 1"x1" Red  background passport photo before making payment.')
+            return _('Upload your 1"x1" Red background passport photo before making payment.')
         return ''
 
-
-class ApplicantManageFormPage(NigeriaApplicantManageFormPage):
+    # customizations for admission checking payments
+    def update(self):
+        # Additional requirements in custom packages.
+        if self.custom_requirements:
+            self.flash(
+                self.custom_requirements,
+                type='danger')
+            self.redirect(self.url(self.context))
+            return
+        if not self.context.special:
+            for key in self.context.keys():
+                ticket = self.context[key]
+                if ticket.p_state == 'paid':
+                      self.flash(
+                          _('This type of payment has already been made.'),
+                          type='warning')
+                      self.redirect(self.url(self.context))
+                      return
+        applicants_utils = getUtility(IApplicantsUtils)
+        container = self.context.__parent__
+        payment = createObject(self.factory)
+        failure = applicants_utils.setPaymentDetails(
+            container, payment, self.context)
+        if failure is not None:
+            self.flash(failure[0], type='danger')
+            self.redirect(self.url(self.context))
+            return
+        self.context[payment.p_id] = payment
+        self.flash(_('Payment ticket created.'))
+        self.redirect(self.url(payment))
+        return
+
+
+class CustomApplicantManageFormPage(NigeriaApplicantManageFormPage):
 
     @property
@@ -139,2 +186,22 @@
         if not checkPermission('waeup.uploadPassportPictures', self.context):
             return _('You are not entitled to upload passport pictures.')
+
+class CustomOnlinePaymentApprovePage(OnlinePaymentApprovePage):
+    """ Approval view
+    """
+
+    # customizations for admission checking payments
+    def update(self):
+        flashtype, msg, log = self.context.approveApplicantPayment()
+        if log is not None:
+            applicant = self.context.__parent__
+            # Add log message to applicants.log
+            applicant.writeLogMessage(self, log)
+            # Add log message to payments.log
+            self.context.logger.info(
+                '%s,%s,%s,%s,%s,,,,,,' % (
+                applicant.applicant_id,
+                self.context.p_id, self.context.p_category,
+                self.context.amount_auth, self.context.r_code))
+        self.flash(msg, type=flashtype)
+        return
Index: /main/waeup.uniben/trunk/src/waeup/uniben/applicants/utils.py
===================================================================
--- /main/waeup.uniben/trunk/src/waeup/uniben/applicants/utils.py	(revision 11781)
+++ /main/waeup.uniben/trunk/src/waeup/uniben/applicants/utils.py	(revision 11782)
@@ -19,4 +19,6 @@
 """
 
+from time import time
+import grok
 from kofacustom.nigeria.applicants.utils import NigeriaApplicantsUtils
 from waeup.kofa.applicants.workflow import (INITIALIZED,
@@ -26,5 +28,5 @@
 
 
-class ApplicantsUtils(NigeriaApplicantsUtils):
+class CustomApplicantsUtils(NigeriaApplicantsUtils):
     """A collection of parameters and methods subject to customization.
     """
@@ -49,4 +51,34 @@
         }
 
+    # customizations for admission checking payments
+    def setPaymentDetails(self, container, payment, applicant):
+        """Set the payment data of an applicant.
+        """
+        timestamp = ("%d" % int(time()*10000))[1:]
+        session = str(container.year)
+        try:
+            session_config = grok.getSite()['configuration'][session]
+        except KeyError:
+            return _(u'Session configuration object is not available.'), None
+        payment.p_id = "p%s" % timestamp
+        payment.p_item = container.title
+        payment.p_session = container.year
+        payment.amount_auth = 0.0
+        if applicant.special:
+            if applicant.special_application:
+                fee_name = applicant.special_application + '_fee'
+                payment.amount_auth = getattr(session_config, fee_name, 0.0)
+                payment.p_category = applicant.special_application
+            return
+        payment.p_category = 'application'
+        container_fee = container.application_fee
+        if container_fee:
+            payment.amount_auth = container_fee
+            return
+        payment.amount_auth = session_config.application_fee
+        if payment.amount_auth in (0.0, None):
+            return _('Amount could not be determined.'), None
+        return
+
 
     # Temporarily disabled
Index: /main/waeup.uniben/trunk/src/waeup/uniben/interfaces.py
===================================================================
--- /main/waeup.uniben/trunk/src/waeup/uniben/interfaces.py	(revision 11781)
+++ /main/waeup.uniben/trunk/src/waeup/uniben/interfaces.py	(revision 11782)
@@ -94,4 +94,10 @@
         )
 
+    admchecking_fee = schema.Float(
+        title = _(u'Admission Checking Fee'),
+        default = 0.0,
+        required = False,
+        )
+
     def getSessionString():
         """Returns the session string from the vocabulary.
Index: /main/waeup.uniben/trunk/src/waeup/uniben/utils/utils.py
===================================================================
--- /main/waeup.uniben/trunk/src/waeup/uniben/utils/utils.py	(revision 11781)
+++ /main/waeup.uniben/trunk/src/waeup/uniben/utils/utils.py	(revision 11782)
@@ -63,4 +63,5 @@
         'application': 'Application Fee',
         'transcript': 'Transcript Fee',
+        'admission_checking': 'Admission Checking Fee',
         }
 
