- Timestamp:
- 4 Dec 2007, 19:24:23 (17 years ago)
- Location:
- WAeUP_SRP
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/Payment.py
r1247 r2859 13 13 import Globals 14 14 import DateTime 15 import logging 15 16 import re 16 17 p_home = Globals.package_home(globals()) … … 29 30 """compose title""" 30 31 return "Payments" 32 33 security.declareProtected(View,"updatePayments") 34 def updatePayments(self): 35 """upgrade all payments in folder""" 36 logger = logging.getLogger('PaymentsFolder.updatePayments') 37 #import pdb;pdb.set_trace() 38 for payment in self.aq_parent.objectValues(): 39 d = {} 40 student_record = self.students_catalog.getRecordByKey(self.getStudentId()) 41 doc = payment.getContent() 42 d['key'] = payment.getId() 43 d['amount'] = doc.amount 44 d['description'] = d['type_description'] = doc.type_description 45 subject = '' 46 if doc.type_description.startswith('School'): 47 subject = 'schoolfee' 48 sp = doc.type_description.rfind('/') 49 d['session_id'] = doc.type_description[sp-2:sp] 50 d['subject'] = subject # zb. schoolfee 51 while True: 52 if doc.resp_code == "SC": 53 p_type = "sc" 54 p_status = "paid" 55 break 56 if doc.resp_code in ("00","IP"): 57 p_type = "online" 58 p_status = "paid" 59 break 60 p_type = "online" 61 p_status = "open" 62 break 63 d['key'] = payment.getId() 64 d['type'] = p_type # scratch card 65 d['target'] = student_record.course 66 d['status'] = p_status 67 d['resp_approved_amount'] = getattr(doc,'resp_approved_amount',None) 68 d['resp_pay_reference'] = doc.resp_pay_reference 69 d['resp_desc'] = doc.resp_desc 70 d['order_id'] = doc.order_id 71 d['resp_code'] = doc.resp_code 72 d['resp_card_num'] = doc.resp_card_num 73 d['date'] = getattr(doc,'date',None) 74 d['resp_date'] = getattr(doc,'resp_date',None) 75 # msg = " ".join(["%s: %s" % (key,value) for key,value in d.items()]) 76 # logger.info(msg) 77 doc.edit(mapping = d) 31 78 32 79 InitializeClass(PaymentsFolder) -
WAeUP_SRP/base/WAeUPTables.py
r2857 r2859 516 516 name = "portal_pins" 517 517 key = 'pin' 518 518 519 def __init__(self,name=None): 519 520 if name == None: … … 1435 1436 WAeUPTable.__init__(self, name) 1436 1437 1438 1437 1439 security.declarePrivate('notify_event_listener') ###( 1438 1440 def notify_event_listener(self,event_type,object,infos): … … 1458 1460 return 1459 1461 for field in self.schema(): 1460 data[field] = getattr(object,field )1462 data[field] = getattr(object,field,'') 1461 1463 rpl = infos['rpath'].split('/') 1462 1464 student_id = rpl[-3] 1463 1465 data['student_id'] = student_id 1464 self.modifyRecord(**data) 1466 try: 1467 self.modifyRecord(**data) 1468 except KeyError: 1469 self.addRecord(**data) 1470 except: 1471 logger = logging.getLogger('WAeUPTables.PaymentsCatalog.%s' % self.__name__) 1472 logger.info("could not add or modify entry for %(key)s" % data) 1465 1473 ###) 1466 1474 -
WAeUP_SRP/base/skins/waeup_epayment/interswitch_cb.py
r2856 r2859 61 61 if pd['resp_code'] == '00' and len(pd['resp_approved_amount']) > 4: 62 62 pd['resp_approved_amount'] = pd['resp_approved_amount'][:-2] 63 pd['status'] = 'paid' 63 64 else: 64 65 pd['resp_approved_amount'] = '0' 66 pd['status'] = 'failed' 65 67 66 68 review_state = wftool.getInfoFor(context,'review_state',None) -
WAeUP_SRP/base/skins/waeup_epayment/pay_by_sc.py
r2678 r2859 103 103 info['type_code'] = "%s" % pin #type_code is redundant and will be removed soon 104 104 info['type_description'] = 'School Fee for Session %s' % next_session_str 105 info['type'] = 'SC' 106 info['status'] = 'paid' 107 info['target'] = s_brain.course 108 info['subject'] = 'schoolfee' 105 109 info['resp_code'] = "SC" 106 110 info['resp_desc'] = "SC Payment Successful" -
WAeUP_SRP/uniben/profiles/default/payments_catalog.xml
r2853 r2859 15 15 <column value="student_id"/> 16 16 <column value="subject"/> 17 <column value="surcharge"/> 17 18 <column value="type"/> 18 19 <column value="target"/> -
WAeUP_SRP/uniben/waeup_custom/getPaymentsFolderInfo.py
r2847 r2859 11 11 """ 12 12 Info for the PaymentsFolder 13 try: 14 from Products.zdb import set_trace 15 except: 16 def set_trace(): 17 pass 13 18 """ 14 19 … … 16 21 if mtool.isAnonymousUser(): 17 22 return None 18 try:19 from Products.zdb import set_trace20 except:21 def set_trace():22 pass23 24 23 25 24 #import logging … … 36 35 import DateTime 37 36 request = context.REQUEST 38 students = context.portal_url.getPortalObject().campus.students37 #students = context.portal_url.getPortalObject().campus.students 39 38 student_id = context.getStudentId() 40 39 if student_id is None: 41 40 return context.REQUEST.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url()) 42 student = getattr(students,student_id)43 s _brain = context.students_catalog(id = student_id)[0]44 41 #student = getattr(students,student_id) 42 student_record = context.students_catalog.getRecordByKey(student_id) 43 context['updatePayments']() 45 44 payments = [] 46 #from Products.zdb import set_trace;set_trace()47 45 48 46 info = {} 49 47 is_so = info['is_so'] = context.isSectionOfficer() 50 48 is_student = info['is_student'] = context.isStudent() 51 info['student_name'] = s _brain.name49 info['student_name'] = student_record.name 52 50 info['query_url'] = "https://webpay.interswitchng.com/paydirect/services/TransactionQueryURL.aspx" 53 review_state = info['review_state'] = s _brain.review_state54 parttime = s _brain.mode and s_brain.mode.endswith('_pt')55 fulltime = s _brain.mode and s_brain.mode.endswith('_ft')51 review_state = info['review_state'] = student_record.review_state 52 parttime = student_record.mode and student_record.mode.endswith('_pt') 53 fulltime = student_record.mode and student_record.mode.endswith('_ft') 56 54 57 55 #if review_state == 'cleared_and_validated' or (parttime and review_state == 'returning'): … … 60 58 # sc_payment = True 61 59 62 session = s _brain.session63 next_info = context.getNextInfo(s _brain)60 session = student_record.session 61 next_info = context.getNextInfo(student_record) 64 62 info['next_session'] = next_info['next_session_id'] 65 63 info['next_session_str'] = next_info['next_session_str'] … … 73 71 info['prod_id'] = '61' 74 72 75 info['student_name'] = s _brain.name73 info['student_name'] = student_record.name 76 74 payments_path = "%s/campus/students/%s/payments" % (context.portal_url.getPortalPath(),student_id) 77 75 sos = context.portal_catalog(container_path=payments_path) … … 97 95 if review_state == 'opened' and info['review_state'] == 'cleared_and_validated' and hasattr(so_doc, 'order_id') and not so_doc.resp_code: 98 96 row['is_requeryable'] = True 99 row['callback_url'] = "%s/payments/%s/interswitch_cb" % (student.absolute_url(), 100 so.getId) 97 row['callback_url'] = "%s/interswitch_cb" % (payments_path) 101 98 href = '%(query_url)s' % info 102 99 href += '?transRef=%(trans_ref)s' % row
Note: See TracChangeset for help on using the changeset viewer.