Changeset 1226 for WAeUP_SRP/trunk/skins/waeup_epayment/pay_online.py
- Timestamp:
- 7 Jan 2007, 16:48:21 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_epayment/pay_online.py
r1224 r1226 15 15 logger = logging.getLogger('EPayment.') 16 16 import DateTime 17 import time18 19 17 request = context.REQUEST 20 18 students = context.portal_url.getPortalObject().campus.students … … 29 27 id = sbrain.course) 30 28 if not res: 31 return None 32 sfc = res[0].getObject().getContent().school_fee_code 29 logger.info('"%s","certificate not found", "%s"' % (student_id,course)) 30 sfc = "ART" 31 else: 32 sfc = res[0].getPath().split('/')[-4] 33 33 info = {} 34 info['type_code'] = "ART" #sfc 34 info['amount'] = "75000" 35 info['type_code'] = sfc 35 36 info['type_description'] = "Schoolfee %s for 2006/2007 Session" % sfc 36 37 info['pay_bill_to'] = sbrain.name … … 39 40 info['student_name'] = sbrain.name 40 41 info['student_email'] = sbrain.email 41 info['pay_date'] = DateTime.DateTime().strftime("%d%m%y%H%M%S") 42 order_id = info['order_id'] = "%d" % int(time.time()*1000) 42 now = DateTime.DateTime() 43 info['pay_date'] = now.strftime("%d%m%y%H%M%S") 44 order_id = info['order_id'] = "%d" % int(now.timeTime()*1000) 43 45 info['order_id'] = "%s%s" % (student_id[1:],order_id) 44 info['amount'] = "75000"45 46 if "payments" not in student.objectIds(): 46 student.invokeFactory('PaymentsFolder','payment ')47 student.invokeFactory('PaymentsFolder','payments') 47 48 payments = getattr(student,'payments') 48 49 d = {} 49 50 d['Title'] = 'Online Payments' 50 payment .getContent().edit(mapping=d)51 payments.getContent().edit(mapping=d) 51 52 else: 52 53 payments = getattr(student,'payments') 53 54 p_id = "p%s" % order_id 54 55 payments.invokeFactory('Payment', p_id) 56 #from Products.zdb import set_trace;set_trace() 55 57 payment = getattr(payments,p_id) 56 58 d = {} 57 59 d.update(info) 58 d['Title'] = "%( payment_type_description)s %(pay_date) %(amount)s N" % info60 d['Title'] = "%(type_description)s %(pay_date) %(amount)s N" % info 59 61 payment.getContent().edit(mapping=d) 60 62 info['callback_url'] = "%s/payments/%s/epayment_cb" % (student.absolute_url(),p_id) 61 logger.info('"%(student_id)s","%( payment_type_description)s", "%(amount)s N"' % info)63 logger.info('"%(student_id)s","%(type_description)s", "%(amount)s N"' % info) 62 64 return context.wema_form(info=info)
Note: See TracChangeset for help on using the changeset viewer.