## Script (Python) "pay_online" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters= ##title= ## # $Id: pay_online.py 1158 2006-12-30 16:58:14Z joachim $ """ pay online """ 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 sfc = res[0].getObject().getContent().school_fee_code info = {} info['callback_url'] = "%s/epayment_cb" % student.absolute_url() info['payment_type_code'] = sfc info['payment_type_description'] = "Schoolfee %s for 2006/2007 Session" % sfc info['payment_bill_to'] = sbrain.name info['payment_ship_to'] = "University of Benin" info['student_id'] = student_id info['student_name'] = sbrain.name info['student_email'] = sbrain.email info['order_id'] = "%s%s" % (student_id[1:],DateTime.DateTime().strftime("%d%m%y%H%M%S")) info['amount'] = "75000" return context.wema_form(info=info)