Changeset 2859 for WAeUP_SRP/base
- Timestamp:
- 4 Dec 2007, 19:24:23 (17 years ago)
- Location:
- WAeUP_SRP/base
- Files:
-
- 1 added
- 4 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"
Note: See TracChangeset for help on using the changeset viewer.