Index: main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser.py
===================================================================
--- main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser.py	(revision 8204)
+++ main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser.py	(revision 8247)
@@ -19,4 +19,5 @@
 """
 import grok
+from waeup.kofa.widgets.datewidget import FriendlyDatetimeDisplayWidget
 from waeup.kofa.applicants.interfaces import (
     IApplicantRegisterUpdate, IApplicant, IApplicantEdit)
@@ -24,23 +25,31 @@
     OnlinePaymentCallbackPage, ExportPDFPage,
     ApplicantManageFormPage, ApplicantEditFormPage,
-    ApplicantRegistrationPage, ApplicantAddFormPage)
+    ApplicantRegistrationPage, ApplicantAddFormPage,
+    OnlinePaymentDisplayFormPage, AcceptanceFeePaymentAddPage,
+    OnlinePaymentBreadcrumb)
 from waeup.kofa.applicants.viewlets import RequestCallbackActionButton
 from waeup.kofa.applicants.pdf import PDFApplicationSlip
 from waeup.uniben.applicants.interfaces import (
-    IPGApplicant, IUGApplicant, IPGApplicantEdit, IUGApplicantEdit)
+    IPGApplicant, IUGApplicant, IPGApplicantEdit, IUGApplicantEdit,
+    ICustomApplicantOnlinePayment)
 from waeup.uniben.interfaces import MessageFactory as _
 
-class CustomRequestCallbackActionButton(RequestCallbackActionButton):
-    """ Do not display the base package callback button in custom pages.
+#class RequestCallbackActionButton(RequestCallbackActionButton):
+#    """ Do not display the base package callback button in custom pages.
+#    """
+#    @property
+#    def target_url(self):
+#        return ''
+
+#class CustomOnlinePaymentCallbackPage(OnlinePaymentCallbackPage):
+#    """ Neutralize callback simulation view
+#    """
+#    def update(self):
+#        return
+
+class CustomOnlinePaymentBreadcrumb(OnlinePaymentBreadcrumb):
+    """A breadcrumb for payments.
     """
-    @property
-    def target_url(self):
-        return ''
-
-class CustomOnlinePaymentCallbackPage(OnlinePaymentCallbackPage):
-    """ Neutralize callback simulation view
-    """
-    def update(self):
-        return
+    grok.context(ICustomApplicantOnlinePayment)
 
 class CustomPDFApplicationSlip(PDFApplicationSlip):
@@ -107,2 +116,29 @@
         form_fields['reg_number'].for_display = True
         return form_fields
+
+class CustomOnlinePaymentDisplayFormPage(OnlinePaymentDisplayFormPage):
+    """ Page to view an online payment ticket
+    """
+    grok.context(ICustomApplicantOnlinePayment)
+    form_fields = grok.AutoFields(ICustomApplicantOnlinePayment)
+    form_fields[
+        'creation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
+    form_fields[
+        'payment_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
+    grok.template('payment_view')
+
+    @property
+    def transaction_code(self):
+        tcode = self.context.p_id
+        return tcode[len(tcode)-8:len(tcode)]
+
+class CustomAcceptanceFeePaymentAddPage(AcceptanceFeePaymentAddPage):
+    """ Page to add an online payment ticket
+    """
+    factory = u'waeup.CustomApplicantOnlinePayment'
+
+    def _fillCustomFields(self, payment, session_config):
+        payment.surcharge_1 = session_config.surcharge_1
+        payment.surcharge_2 = session_config.surcharge_2
+        payment.surcharge_3 = session_config.surcharge_3
+        return payment
Index: main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser_templates/payment_view.pt
===================================================================
--- main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser_templates/payment_view.pt	(revision 8247)
+++ main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser_templates/payment_view.pt	(revision 8247)
@@ -0,0 +1,18 @@
+<table class="form-table" i18n:domain="waeup.uniben"
+  tal:define="files provider:files">
+  <tbody>
+    <tal:widgets content="structure provider:widgets" />
+    <tr tal:condition="python: files.replace('\n','')">
+      <td class="separator" colspan=2 i18n:translate="">
+        Uploaded Files
+      </td>
+    </tr>
+    <tal:files content="structure files" />
+    <tr>
+      <td class="fieldname">
+        <span i18n:translate="">Transaction Code</span>:
+      </td>
+      <td tal:content="view/transaction_code">TRANSACTIONCODE</td>
+    </tr>
+  </tbody>
+</table>
Index: main/waeup.uniben/trunk/src/waeup/uniben/applicants/interfaces.py
===================================================================
--- main/waeup.uniben/trunk/src/waeup/uniben/applicants/interfaces.py	(revision 8204)
+++ main/waeup.uniben/trunk/src/waeup/uniben/applicants/interfaces.py	(revision 8247)
@@ -24,5 +24,5 @@
     AppCatCertificateSource, CertificateSource)
 from waeup.kofa.schoolgrades import ResultEntryField
-from waeup.kofa.interfaces import SimpleKofaVocabulary
+from waeup.kofa.interfaces import SimpleKofaVocabulary, academic_sessions_vocab
 from waeup.kofa.schema import FormattedDate
 from waeup.kofa.students.vocabularies import nats_vocab
@@ -30,5 +30,5 @@
     lgas_vocab, high_qual, high_grade, exam_types)
 from waeup.uniben.interfaces import MessageFactory as _
-
+from waeup.uniben.payments.interfaces import ICustomOnlinePayment
 
 class IUGApplicant(IApplicantBaseData):
@@ -261,2 +261,6 @@
     respective form page.
     """
+class ICustomApplicantOnlinePayment(ICustomOnlinePayment):
+    """An applicant payment via payment gateways.
+
+    """
Index: main/waeup.uniben/trunk/src/waeup/uniben/applicants/payment.py
===================================================================
--- main/waeup.uniben/trunk/src/waeup/uniben/applicants/payment.py	(revision 8247)
+++ main/waeup.uniben/trunk/src/waeup/uniben/applicants/payment.py	(revision 8247)
@@ -0,0 +1,53 @@
+## $Id$
+##
+## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+"""
+Acceptance fee payment.
+"""
+import grok
+from zope.component.interfaces import IFactory
+from zope.interface import implementedBy
+from waeup.kofa.payments import OnlinePayment
+from waeup.kofa.utils.helpers import attrs_to_fields
+from waeup.uniben.applicants.interfaces import ICustomApplicantOnlinePayment
+
+class CustomApplicantOnlinePayment(OnlinePayment):
+    """This is an online payment.
+    """
+    grok.implements(ICustomApplicantOnlinePayment)
+    grok.provides(ICustomApplicantOnlinePayment)
+
+    def __init__(self):
+        super(CustomApplicantOnlinePayment, self).__init__()
+        return
+
+CustomApplicantOnlinePayment = attrs_to_fields(CustomApplicantOnlinePayment)
+
+# Applicant online payments must be importable. So we might need a factory.
+class CustomApplicantOnlinePaymentFactory(grok.GlobalUtility):
+    """A factory for applicant online payments.
+    """
+    grok.implements(IFactory)
+    grok.name(u'waeup.CustomApplicantOnlinePayment')
+    title = u"Create a new online payment.",
+    description = u"This factory instantiates new online payment instances."
+
+    def __call__(self, *args, **kw):
+        return CustomApplicantOnlinePayment()
+
+    def getInterfaces(self):
+        return implementedBy(CustomApplicantOnlinePayment)
Index: main/waeup.uniben/trunk/src/waeup/uniben/applicants/utils.py
===================================================================
--- main/waeup.uniben/trunk/src/waeup/uniben/applicants/utils.py	(revision 8204)
+++ main/waeup.uniben/trunk/src/waeup/uniben/applicants/utils.py	(revision 8247)
@@ -19,7 +19,18 @@
 """
 
+import sys
 import grok
+from hurry.workflow.interfaces import IWorkflowInfo, InvalidTransitionError
 from waeup.kofa.applicants.utils import ApplicantsUtils
 from waeup.uniben.interfaces import MessageFactory as _
+
+
+def actions_after_applicant_payment(applicant, view):
+    wf_info = IWorkflowInfo(applicant)
+    try:
+        wf_info.fireTransition('pay')
+    except InvalidTransitionError:
+        view.flash('Error: %s' % sys.exc_info()[1])
+        return
 
 class ApplicantsUtils(ApplicantsUtils):
