## Script (Python) "epayment_cb" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters= ##title= ## # $Id: epayment_cb.py 1246 2007-01-08 18:25:17Z joachim $ """ payment callback """ import logging logger = logging.getLogger('EPayment.') import DateTime request = context.REQUEST students = context.portal_url.getPortalObject().campus.students student_id = context.getStudentId() if student_id is None: return context.REQUEST.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url()) student = getattr(students,student_id) sbrain = context.students_catalog(id=student_id)[0] res = context.portal_catalog(portal_type="Certificate", id = sbrain.course) if not res: return None resp_codes = (("x_RespDesc","resp_desc"), ("x_RespPayRef","resp_pay_reference"), ("x_RespCode","resp_code"), ("x_CardNum","resp_card_num"), ("x_ApprAmt","resp_approved_amount"), ) pd = {} #from Products.zdb import set_trace;set_trace() for rc,pdk in resp_codes: pd[pdk] = request.get(rc) context.getContent().edit(mapping=pd) return request.RESPONSE.redirect("%s/waeup_document_view" % context.absolute_url())