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 | """ |
---|
12 | pay online |
---|
13 | """ |
---|
14 | import logging |
---|
15 | logger = logging.getLogger('EPayment.') |
---|
16 | import DateTime |
---|
17 | |
---|
18 | request = context.REQUEST |
---|
19 | students = context.portal_url.getPortalObject().campus.students |
---|
20 | |
---|
21 | student_id = context.getStudentId() |
---|
22 | if student_id is None: |
---|
23 | return context.REQUEST.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url()) |
---|
24 | |
---|
25 | student = getattr(students,student_id) |
---|
26 | sbrain = context.students_catalog(id=student_id)[0] |
---|
27 | res = context.portal_catalog(portal_type="Certificate", |
---|
28 | id = sbrain.course) |
---|
29 | if not res: |
---|
30 | return None |
---|
31 | sfc = res[0].getObject().getContent().school_fee_code |
---|
32 | info = {} |
---|
33 | info['callback_url'] = "%s/epayment_cb" % student.absolute_url() |
---|
34 | info['payment_type_code'] = sfc |
---|
35 | info['payment_type_description'] = "Schoolfee %s for 2006/2007 Session" % sfc |
---|
36 | info['payment_bill_to'] = sbrain.name |
---|
37 | info['payment_ship_to'] = "University of Benin" |
---|
38 | info['student_id'] = student_id |
---|
39 | info['student_name'] = sbrain.name |
---|
40 | info['student_email'] = sbrain.email |
---|
41 | info['order_id'] = "%s%s" % (student_id[1:],DateTime.DateTime().strftime("%d%m%y%H%M%S")) |
---|
42 | info['amount'] = "75000" |
---|
43 | return context.wema_form(info=info) |
---|