Index: main/waeup.kofa/trunk/src/waeup/kofa/students/payments.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/payments.py	(revision 8708)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/payments.py	(revision 8732)
@@ -61,7 +61,5 @@
             return None
 
-    def doAfterStudentPayment(self):
-        """Process student after payment was made.
-        """
+    def _createActivationCodes(self):
         student = self.getStudent()
         if self.p_category == 'clearance':
@@ -70,12 +68,12 @@
                 'CLR',0,self.amount_auth,student.student_id)
             if error:
-                return False, error, error
+                return error
             self.ac = pin
-        elif self.p_category == 'schoolfee':
+        elif self.p_category in ('schoolfee', 'schoolfee_1'):
             # Create SFE access code
             pin, error = create_accesscode(
                 'SFE',0,self.amount_auth,student.student_id)
             if error:
-                return False, error, error
+                return error
             self.ac = pin
         elif self.p_category == 'bed_allocation':
@@ -84,6 +82,14 @@
                 'HOS',0,self.amount_auth,student.student_id)
             if error:
-                return False, error, error
+                return error
             self.ac = pin
+        return None
+
+    def doAfterStudentPayment(self):
+        """Process student after payment was made.
+        """
+        error = self._createActivationCodes()
+        if error is not None:
+            return False, error, error
         log = 'successful payment: %s' % self.p_id
         msg = _('Successful payment')
@@ -93,26 +99,7 @@
         """Process student after payment was approved.
         """
-        student = self.getStudent()
-        if self.p_category == 'clearance':
-            # Create CLR access code
-            pin, error = create_accesscode(
-                'CLR',0,self.amount_auth,student.student_id)
-            if error:
-                return False, error, error
-            self.ac = pin
-        elif self.p_category == 'schoolfee':
-            # Create SFE access code
-            pin, error = create_accesscode(
-                'SFE',0,self.amount_auth,student.student_id)
-            if error:
-                return False, error, error
-            self.ac = pin
-        elif self.p_category == 'bed_allocation':
-            # Create HOS access code
-            pin, error = create_accesscode(
-                'HOS',0,self.amount_auth,student.student_id)
-            if error:
-                return False, error, error
-            self.ac = pin
+        error = self._createActivationCodes()
+        if error is not None:
+            return False, error, error
         log = 'payment approved: %s' % self.p_id
         msg = _('Payment approved')
@@ -125,5 +112,5 @@
             return False, _('This ticket has already been paid.'), None
         self.approve()
-        return self.doAfterStudentPayment()
+        return self.doAfterStudentPaymentApproval()
 
 
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 8708)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py	(revision 8732)
@@ -1312,5 +1312,5 @@
         self.browser.open(payment_url)
         self.browser.getLink("Approve payment").click()
-        self.assertMatches('...Successful payment...',
+        self.assertMatches('...Payment approved...',
                           self.browser.contents)
 
@@ -1363,5 +1363,5 @@
         self.browser.getLink(value).click()
         self.browser.open(self.browser.url + '/approve')
-        self.assertMatches('...Successful payment...',
+        self.assertMatches('...Payment approved...',
                           self.browser.contents)
         expected = '''...
@@ -1402,5 +1402,5 @@
         # In the base package they can 'use' a fake approval view
         self.browser.open(payment_url + '/fake_approve')
-        self.assertMatches('...Successful payment...',
+        self.assertMatches('...Payment approved...',
                           self.browser.contents)
         expected = '''...
@@ -1484,5 +1484,5 @@
         self.assertEqual(len(self.app['accesscodes']['SFE-0']),0)
         self.browser.open(self.browser.url + '/fake_approve')
-        self.assertMatches('...Successful payment...',
+        self.assertMatches('...Payment approved...',
                           self.browser.contents)
 
@@ -1548,5 +1548,5 @@
         self.assertEqual(len(self.app['accesscodes']['SFE-0']),0)
         self.browser.open(self.browser.url + '/fake_approve')
-        self.assertMatches('...Successful payment...',
+        self.assertMatches('...Payment approved...',
                           self.browser.contents)
 
