source: WAeUP_SRP/trunk/skins/waeup_epayment/epayment_cb.py @ 1312

Last change on this file since 1312 was 1308, checked in by Henrik Bettermann, 18 years ago

transition order changed (don't use sources from custom)

  • Property svn:keywords set to Id
File size: 1.3 KB
RevLine 
[1224]1## Script (Python) "epayment_cb"
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: epayment_cb.py 1308 2007-01-16 08:15:05Z henrik $
11"""
12payment callback
13"""
14import logging
15logger = logging.getLogger('EPayment.')
16import DateTime
17
18request = context.REQUEST
19students = context.portal_url.getPortalObject().campus.students
[1303]20wftool = context.portal_workflow
[1224]21student_id = context.getStudentId()
22if student_id is None:
23    return context.REQUEST.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url())
24
25student = getattr(students,student_id)
26sbrain = context.students_catalog(id=student_id)[0]
27res = context.portal_catalog(portal_type="Certificate",
[1229]28                            id = sbrain.course)
[1224]29if not res:
30    return None
31
[1246]32resp_codes = (("x_RespDesc","resp_desc"),
[1224]33              ("x_RespPayRef","resp_pay_reference"),
34              ("x_RespCode","resp_code"),
35              ("x_CardNum","resp_card_num"),
36              ("x_ApprAmt","resp_approved_amount"),
37              )
[1229]38pd = {}
[1243]39#from Products.zdb import set_trace;set_trace()
[1224]40for rc,pdk in resp_codes:
41    pd[pdk] = request.get(rc)
[1229]42context.getContent().edit(mapping=pd)
[1303]43wftool.doActionFor(student,'pay_school_fee')
[1308]44wftool.doActionFor(context,'close')
[1303]45
[1304]46return request.RESPONSE.redirect("%s/waeup_document_view" % context.absolute_url())
Note: See TracBrowser for help on using the repository browser.