Index: main/waeup.custom/trunk/src/waeup/custom/utils/utils.py
===================================================================
--- main/waeup.custom/trunk/src/waeup/custom/utils/utils.py	(revision 7920)
+++ main/waeup.custom/trunk/src/waeup/custom/utils/utils.py	(revision 7926)
@@ -20,4 +20,34 @@
 import os
 from waeup.kofa.utils.utils import KofaUtils
+from waeup.kofa.accesscodes import create_accesscode
+from waeup.custom.interfaces import MessageFactory as _
+
+def actions_after_payment(student, payment, view):
+    if payment.p_category == 'clearance':
+        # Create CLR access code
+        pin, error = create_accesscode('CLR',0,student.student_id)
+        if error:
+            view.flash(_('Valid callback received. ${a}',
+                mapping = {'a':error}))
+            return
+        payment.ac = pin
+    elif payment.p_category == 'schoolfee':
+        # Create SFE access code
+        pin, error = create_accesscode('SFE',0,student.student_id)
+        if error:
+            view.flash(_('Valid callback received. ${a}',
+                mapping = {'a':error}))
+            return
+        payment.ac = pin
+    elif payment.p_category == 'bed_allocation':
+        # Create HOS access code
+        pin, error = create_accesscode('HOS',0,student.student_id)
+        if error:
+            view.flash(_('Valid callback received. ${a}',
+                mapping = {'a':error}))
+            return
+        payment.ac = pin
+    view.flash(_('Valid callback received.'))
+    return
 
 
