Index: /WAeUP_SRP/trunk/skins/waeup_epayment/getPaymentInfo.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_epayment/getPaymentInfo.py	(revision 2048)
+++ /WAeUP_SRP/trunk/skins/waeup_epayment/getPaymentInfo.py	(revision 2048)
@@ -0,0 +1,66 @@
+## Script (Python) "getPaymentInfo"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=
+##title=
+##
+# $Id$
+"""
+return Info about the current Student
+"""
+import logging
+logger = logging.getLogger('Skins.getStudentBaseInfo')
+from DateTime import DateTime
+
+request = context.REQUEST
+mtool = context.portal_membership
+wf = context.portal_workflow
+member = mtool.getAuthenticatedMember()
+member_id = str(member)
+
+if mtool.isAnonymousUser():
+    return None
+info = {}
+requested_id = context.getStudentId()
+if requested_id and not context.isStaff() and member_id != requested_id:
+    logger.info('%s tried to access %s' % (member_id,requested_id))
+    return None
+elif context.isStaff():
+    student_id = requested_id
+else:
+    student_id = member_id
+
+
+#students_object = context.portal_url.getPortalObject().campus.students
+#student = getattr(students_object,student_id)
+
+res = context.students_catalog(id = student_id)
+if len(res) != 1:
+    return None
+sbrain = res[0]
+info['id'] = student_id
+info['student'] = context.getFormattedStudentEntry(sbrain)
+payment = context.getContent()
+info['payment'] = payment
+info['is_online_pmt'] = io = payment.resp_code in ('00','AP','IP')
+info['is_scratchcard_pmt'] = isc =  payment.resp_code == 'SC'
+if isc:
+    from Products.zdb import set_trace
+    set_trace()
+    p,b,n = str(payment.order_id).split('-')
+    batch_object = getattr(context.pins,"%s_%s" % (p,b),None)
+    if batch_object is None:
+        info['cost'] = "unknown"
+    else:
+        info['cost'] = "%6.2f N" % getattr(batch_object.getContent(),'cost',0.0)
+info['is_interrupted'] = ii = payment.resp_code == ''
+info['unknown_code'] = not (io or isc or ii)
+info['resp_code'] = payment.resp_code
+info['resp_desc'] = payment.resp_desc
+#info['entry_mode'] = sbrain.entry_mode
+
+
+return info
Index: /WAeUP_SRP/trunk/skins/waeup_epayment/payment_receipt.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_epayment/payment_receipt.pt	(revision 2047)
+++ /WAeUP_SRP/trunk/skins/waeup_epayment/payment_receipt.pt	(revision 2048)
@@ -1,14 +1,11 @@
 <metal:body use-macro="here/slip_template/macros/master">
     <metal:main fill-slot="main"
-                tal:define="info context/getStudentBaseInfo;
-                            info_doc context/getDocumentInfo">
-      
-      <span tal:condition="python: not info or not info_doc">
+                tal:define="info context/getPaymentInfo;">
+      <span tal:condition="python: not info">
         <span tal:content="here/illegal_view" />
       </span>
       
-      <span tal:condition="python: info and info_doc">
-      
-        <metal:block tal:condition="python:info_doc['doc'].resp_code in ('00','AP','IP')">            
+      <span tal:condition="python: info">
+        <metal:block tal:condition="info/is_online_pmt">
         <h3>Online Payment Receipt</h3>
         <br />
@@ -43,8 +40,5 @@
               />
         </metal:block>
-
-  
-
-        <metal:block tal:condition="python:info_doc['doc'].resp_code=='SC'">            
+        <metal:block tal:condition="info/is_scratchcard_pmt">            
         <h3>Scratch Card Payment Receipt</h3>
         <br />
@@ -79,5 +73,5 @@
         </tr>             
         </table>                 
-        <table tal:define="pm python:info_doc['doc']">
+        <table tal:define="pm nocall: info/payment">
         <tr>
           <td width="220px">Access Code:</td> 
@@ -103,11 +97,11 @@
         </metal:block>
 
-        <metal:block tal:condition="python:not info_doc['doc'].resp_code">            
+        <metal:block tal:condition="info/is_interrupted">            
         <h3>Payment Process Interrupted!</h3>
         <br />        
         </metal:block>
         
-        <metal:block tal:condition="python:info_doc['doc'].resp_code not in ('SC','00','AP','IP','')">            
-        <h3>Response from Bank: "<span tal:content="python:info_doc['doc'].resp_desc" />"</h3>
+        <metal:block tal:condition="info/unknown_code">
+        <h3>Response from Bank: "<span tal:content="info/resp_desc" />"</h3>
         <br />        
         </metal:block>
