source: WAeUP_SRP/trunk/skins/waeup_uniben/getPaymentInfo.py @ 8028

Last change on this file since 8028 was 7901, checked in by Henrik Bettermann, 13 years ago

Implement eTranzact payment and restructure change school fee payment.

Session 2011/2012: eTranzact and Interswitch payments only
Previous sessions: scratch card payments only

  • Property svn:keywords set to Id
File size: 1.3 KB
RevLine 
[7900]1## Script (Python) "getPaymentInfo"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=
8##title=
9##
10# $Id: getPaymentInfo.py 7901 2012-03-17 10:16:07Z henrik $
11"""
12return Info about the current Student
13"""
14import logging
15logger = logging.getLogger('Skins.getStudentBaseInfo')
16from DateTime import DateTime
17try:
18    from Products.zdb import set_trace
19except:
20    def set_trace():
21        pass
22
23info = context.waeup_tool.getAccessInfo(context)
24student_id = info['student_id']
25if student_id is None:
26    return None
27
28
29
30res = context.students_catalog(id = student_id)
31if len(res) != 1:
32    return None
33sbrain = res[0]
34info['id'] = student_id
35info['student'] = context.getFormattedStudentEntry(sbrain)
36payment = context.getContent()
37info['payment_doc'] = payment
[7901]38info['is_etranzact_pmt'] = ie = payment.type == 'etranzact'
[7900]39info['is_online_pmt'] = io = payment.resp_code in ('0','00','AP','IP',)
40info['is_request_pmt'] = ir = payment.resp_code in ('RP',)
41info['is_scratchcard_pmt'] = isc =  payment.resp_code == 'SC'
[7901]42info['is_interrupted'] = ii = payment.resp_code == '' and not ie
43info['unknown_code'] = not (io or isc or ii or ir or ie)
[7900]44info['resp_code'] = payment.resp_code
45info['resp_desc'] = payment.resp_desc
46#info['entry_mode'] = sbrain.entry_mode
47
48
49return info
Note: See TracBrowser for help on using the repository browser.