Index: main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py	(revision 8264)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py	(revision 8268)
@@ -1077,5 +1077,5 @@
             pay_details  = students_utils.getPaymentDetails(
                 p_category,student)
-        except AttributeError:
+        except (AttributeError, TypeError):
             self.flash(
                 _('Study course data are incomplete.'))
@@ -1104,4 +1104,5 @@
         payment.p_item = p_item
         payment.p_session = p_session
+        payment.p_level = pay_details['p_level']
         payment.amount_auth = pay_details['amount']
         payment = self._fillCustomFields(payment, pay_details)
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py	(revision 8264)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py	(revision 8268)
@@ -502,6 +502,12 @@
     """
 
-IStudentOnlinePayment['p_session'].order = IStudentOnlinePayment[
-    'p_item'].order
+    p_level = schema.Int(
+        title = _(u'Payment Level'),
+        required = False,
+        readonly = True,
+        )
+
+IStudentOnlinePayment['p_level'].order = IStudentOnlinePayment[
+    'p_session'].order
 
 
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py	(revision 8264)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py	(revision 8268)
@@ -1424,4 +1424,8 @@
         self.assertMatches('...Amount Authorized...',
                            self.browser.contents)
+        # Payment session and level have been calculated as defined
+        # in w.k.students.utils
+        self.assertEqual(self.student['payments'][value].p_session, 2005)
+        self.assertEqual(self.student['payments'][value].p_level, 200)
 
         # Students can open the callback view which simulates a valid callback
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py	(revision 8264)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py	(revision 8268)
@@ -227,13 +227,27 @@
     grok.implements(IStudentsUtils)
 
+    def getReturningData(self, student):
+        """ This method defines what happens after school fee payment
+        depending on the student's senate verdict.
+
+        In the base configuration current level is always increased
+        by 100 no matter which verdict has been assigned.
+        """
+        new_level = student['studycourse'].current_level + 100
+        new_session = student['studycourse'].current_session + 1
+        return new_session, new_level
+
     def setReturningData(self, student):
         """ This method defines what happens after school fee payment
-        depending on the student's senate verdict.
+        depending on the student's senate verdict. It folllows
+        the same algorithm as getReturningData but it also sets the new
+        values
 
         In the base configuration current level is always increased
         by 100 no matter which verdict has been assigned.
         """
-        student['studycourse'].current_level += 100
-        student['studycourse'].current_session += 1
+        new_session, new_level = self.getReturningData(student)
+        student['studycourse'].current_level = new_level
+        student['studycourse'].current_session = new_session
         verdict = student['studycourse'].current_verdict
         student['studycourse'].current_verdict = '0'
@@ -250,4 +264,5 @@
         d['error'] = u''
         d['p_session'] = student['studycourse'].current_session
+        d['p_level'] = student['studycourse'].current_level
         session = str(d['p_session'])
         try:
@@ -259,4 +274,7 @@
             d['amount'] = academic_session.school_fee_base
             d['p_item'] = student['studycourse'].certificate.code
+            # In case of school fee payment the payment session and level
+            # contain the values of the session the student has paid for
+            d['p_session'], d['p_level'] = self.getReturningData(student)
         elif category == 'clearance':
             d['p_item'] = student['studycourse'].certificate.code
