source: WAeUP_SRP/trunk/skins/waeup_epayment/pay_online.py @ 1167

Last change on this file since 1167 was 1158, checked in by joachim, 18 years ago

added jamb_reg_no checking + phone_nr
made schoolfee_code a string field in certificate.xml

  • Property svn:keywords set to Id
File size: 1.3 KB
Line 
1## Script (Python) "pay_online"
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: pay_online.py 1158 2006-12-30 16:58:14Z joachim $
11"""
12pay online
13"""
14import logging
15logger = logging.getLogger('EPayment.')
16import DateTime
17
18request = context.REQUEST
19students = context.portal_url.getPortalObject().campus.students
20
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",
28                                     id = sbrain.course)
29if not res:
30    return None
31sfc = res[0].getObject().getContent().school_fee_code
32info = {}
33info['callback_url'] = "%s/epayment_cb" % student.absolute_url()
34info['payment_type_code'] = sfc
35info['payment_type_description'] = "Schoolfee %s for 2006/2007 Session" % sfc
36info['payment_bill_to'] = sbrain.name
37info['payment_ship_to'] = "University of Benin"
38info['student_id'] = student_id
39info['student_name'] = sbrain.name
40info['student_email'] = sbrain.email
41info['order_id'] = "%s%s" % (student_id[1:],DateTime.DateTime().strftime("%d%m%y%H%M%S"))
42info['amount'] = "75000"
43return context.wema_form(info=info)
Note: See TracBrowser for help on using the repository browser.