source: WAeUP_SRP/trunk/skins/waeup_epayment/requery_payment.py @ 1613

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

implementation of the requery module, will now test it on the uniben-demo

M profiles/default/schemas/payment.xml
AM skins/waeup_epayment/requery_payment.py
AM skins/waeup_epayment/requery_payment_form.pt
M skins/waeup_epayment/getPaymentsFolderInfo.py
M skins/waeup_epayment/payments_view.pt

catch unauthorized delets, must be testet.
M skins/waeup_student/delete_course_result.py

  • Property svn:keywords set to Id
File size: 2.0 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: requery_payment.py 1613 2007-03-21 07:18:53Z joachim $
11"""
12pay online
13"""
14from urllib import urlencode
15import logging
16logger = logging.getLogger('Skins.pay_online')
17import DateTime
18
19if context.portal_membership.isAnonymousUser():
20    return None
21
22request = context.REQUEST
23wftool = context.portal_workflow
24students = context.portal_url.getPortalObject().campus.students
25
26student_id = context.getStudentId()
27student = getattr(students,student_id)
28
29sbrain = context.students_catalog(id=student_id)[0]
30info = {}
31info['site_id'] = '300100100'
32info['currency_id'] = '566'
33
34#from Products.zdb import set_trace;set_trace()
35if student_id is None:
36    return context.REQUEST.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url())
37
38if context.portal_url().find('uniben-demo.waeup.org') >-1 or\
39   context.portal_url().find('uniben.waeup.org') >-1:
40    info['action'] = "http://www.wemaonlinepayments.biz/querytransaction.aspx"
41else:
42    #pass
43    #return None
44    info['action'] = "%s/payments/%s/simulate_queryatransaction" % (student.absolute_url(),p_id)
45
46
47info['callback_url'] = "%s/payments/%s/epayment_requery_cb" % (student.absolute_url(),p_id)
48payment = context
49if payment.portal_type != 'Payment':
50    return
51payment_doc = payment.getContent()
52#from Products.zdb import set_trace;set_trace()
53info['order_id'] = payment_doc.order_id
54info['type_description'] = payment_doc.type_description
55info['pay_bill_to'] = payment_doc.pay_bill_to
56info['amount'] = payment_doc.amount
57logger.info('%(student_id)s requeried online school fee payment for order_id %(order_id)s' % info)
58payment_fields = (('x_SiteID','site_id'),
59                  ('x_OrderID','order_id'),
60                  ('x_Redirect_url','callback_url'),
61                  )
62args = {}
63for arg,field in payment_fields:
64    args[arg] = info[field]
65info['args'] = args
66return context.requery_payment_form(info=info)
Note: See TracBrowser for help on using the repository browser.