Index: main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py	(revision 8452)
+++ main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py	(revision 8453)
@@ -523,4 +523,9 @@
         """
 
+    def doAfterApplicantPaymentApproval():
+        """Process applicant after payment was approved.
+
+        """
+
     def approveApplicantPayment():
         """Approve payment and process applicant.
Index: main/waeup.kofa/trunk/src/waeup/kofa/applicants/payment.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/applicants/payment.py	(revision 8452)
+++ main/waeup.kofa/trunk/src/waeup/kofa/applicants/payment.py	(revision 8453)
@@ -40,4 +40,17 @@
         return
 
+    def doAfterApplicantPaymentApproval(self):
+        """Process applicant after payment was approved.
+        """
+        wf_info = IWorkflowInfo(self.__parent__)
+        try:
+            wf_info.fireTransition('approve')
+        except InvalidTransitionError:
+            msg = log = 'Error: %s' % sys.exc_info()[1]
+            return False, msg, log
+        log = 'payment approved: %s' % self.p_id
+        msg = _('Payment approved')
+        return False, msg, log
+
     def doAfterApplicantPayment(self):
         """Process applicant after payment was made.
@@ -45,5 +58,5 @@
         wf_info = IWorkflowInfo(self.__parent__)
         try:
-            wf_info.fireTransition('approve')
+            wf_info.fireTransition('pay')
         except InvalidTransitionError:
             msg = log = 'Error: %s' % sys.exc_info()[1]
@@ -59,5 +72,5 @@
             return False, _('This ticket has already been paid.'), None
         self.approve()
-        return self.doAfterApplicantPayment()
+        return self.doAfterApplicantPaymentApproval()
 
 ApplicantOnlinePayment = attrs_to_fields(ApplicantOnlinePayment)
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py	(revision 8452)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py	(revision 8453)
@@ -515,4 +515,9 @@
         """
 
+    def doAfterStudentPaymentApproval():
+        """Process student after payment was approved.
+
+        """
+
     def approveStudentPayment():
         """Approve payment and process student.
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/payments.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/payments.py	(revision 8452)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/payments.py	(revision 8453)
@@ -89,4 +89,33 @@
         return True, msg, log
 
+    def doAfterStudentPaymentApproval(self):
+        """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
+        log = 'payment approved: %s' % self.p_id
+        msg = _('Payment approved')
+        return True, msg, log
+
     def approveStudentPayment(self):
         """Approve payment and process student.
