Changeset 3239
- Timestamp:
- 26 Feb 2008, 21:27:15 (17 years ago)
- Location:
- WAeUP_SRP/base/skins/waeup_epayment
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/skins/waeup_epayment/interswitch_acco_cb.py
r3232 r3239 32 32 member = mtool.getAuthenticatedMember() 33 33 member_id = str(member) 34 student_id = context.getStudentId() 34 #student_id = context.getStudentId() 35 access_info = context.waeup_tool.getAccessInfo(context) 36 student_id = access_info['student_id'] 35 37 if student_id is None: # or student_id != member_id: 36 38 logger.info('%s tried to access payment object of %s' % (member_id,student_id)) … … 54 56 pd[pdk] = request.get(rc,'') 55 57 56 57 58 ## for testing purposes 58 59 #pd['resp_desc'] = 'Simulated Callback' … … 71 72 review_state = wftool.getInfoFor(context,'review_state',None) 72 73 if pd['resp_code'] == '': 73 logger.info('%s requeried payment %s and got empty response' % (student_id,context.getId()))74 logger.info('%s requeried payment %s for %s and got empty response' % (member,context.getId(),student_id)) 74 75 return request.RESPONSE.redirect("%s/waeup_document_view" % context.absolute_url()) 76 if access_info['is_student'] and review_state == 'closed': 77 wftool.doActionFor(context,'open') 75 78 pay_doc = context.getContent() 76 79 pay_doc.edit(mapping = pd) … … 79 82 s_brain = context.students_catalog(id=student_id)[0] 80 83 session = s_brain.session 81 #next_session, next_session_str = context.getNextSessionId(session) 84 85 #next_info = context.getNextInfo(s_brain) 86 #next_session_id = next_info['next_session_id'] 87 #next_session_str = next_info['next_session_str'] 88 #next_level_id = next_info['next_level_id'] 89 #next_transition = next_info['next_transition'] 90 #next_verdict = next_info['next_verdict'] 91 #next_previous_verdict = next_info['next_previous_verdict'] 82 92 83 93 if pay_doc.category == 'hostel_maintenance': … … 88 98 d['acco_maint_fee'] = pay_doc.amount 89 99 d['acco_maint_pay_id'] = context.getId() 90 acco_info['acco_doc'].edit(mapping=d) 100 try: 101 acco_info['acco_doc'].edit(mapping=d) 102 except: 103 logger.info('%s requeried payment though maintenance already paid' % student_id) 91 104 referer = request.get('HTTP_REFERER','none') 92 105 logger.info('%s valid callback referer = %s' % (student_id,referer)) … … 107 120 108 121 109 #else:110 # next_info = context.getNextInfo(s_brain)111 # next_session_id = next_info['next_session_id']112 # next_session_str = next_info['next_session_str']113 # next_level_id = next_info['next_level_id']114 # next_transition = next_info['next_transition']115 # next_verdict = next_info['next_verdict']116 # next_previous_verdict = next_info['next_previous_verdict']117 #118 # if resp == '00':119 # if context.getStudentReviewState() == "school_fee_paid":120 # logger.info('%s paid school_fee in state school_fee_paid' % (student_id))121 # else:122 # study_course = getattr(student,'study_course')123 # try:124 # wftool.doActionFor(study_course,'open')125 # except:126 # pass127 # verdict = s_brain.verdict128 # if next_previous_verdict == 'N/A':129 # next_previous_verdict = ''130 # study_course.getContent().edit(mapping= {'current_level': next_level_id,131 # 'current_session': next_session_id,132 # 'current_verdict': next_verdict,133 # 'previous_verdict': next_previous_verdict,134 # })135 # if next_transition:136 # wftool.doActionFor(student,next_transition)137 122 138 # logger.info('%s received valid callback' % student_id)139 # referer = request.get('HTTP_REFERER','none')140 # logger.info('%s valid callback referer = %s' % (student_id,referer))141 # real_ip = request.get('HTTP_X_REAL_IP',"none")142 # logger.info('%s valid callback real_ip = %s' % (student_id,real_ip))143 # else:144 # logger.info('%s received unsuccessfull callback: %s' % (student_id,pd['resp_desc']))145 # try:146 # wftool.doActionFor(context,'close')147 # except:148 # logger.info('%s no workflow action close' % student_id)149 150 -
WAeUP_SRP/base/skins/waeup_epayment/interswitch_cb.py
r3236 r3239 21 21 from AccessControl import Unauthorized 22 22 import DateTime 23 23 24 24 25 if context.portal_membership.isAnonymousUser(): … … 72 73 if pd['resp_code'] == '': 73 74 logger.info('%s requeried payment %s for %s and got empty response' % (member,context.getId(),student_id)) 74 #if review_state == 'opened':75 # wftool.doActionFor(context,'close')76 75 return request.RESPONSE.redirect("%s/waeup_document_view" % context.absolute_url()) 77 76 if access_info['is_student'] and review_state == 'closed': 78 77 wftool.doActionFor(context,'open') 79 context.getContent().edit(mapping = pd) 80 # except: 81 # logger.info('%s tried to edit payment %s in state %s' % (student_id, 82 # context.getId(), 83 # review_state)) 84 # return request.RESPONSE.redirect("%s/waeup_document_view" % context.absolute_url()) 85 78 pay_doc = context.getContent() 79 pay_doc.edit(mapping = pd) 86 80 resp = pd['resp_code'] 87 81 88 82 s_brain = context.students_catalog(id=student_id)[0] 89 83 session = s_brain.session 90 #next_session, next_session_str = context.getNextSessionId(session)91 84 92 85 next_info = context.getNextInfo(s_brain) … … 126 119 else: 127 120 logger.info('%s received unsuccessfull callback: %s' % (student_id,pd['resp_desc'])) 128 if review_state == 'opened':129 wftool.doActionFor(context,'close')130 121 122 wftool.doActionFor(context,'close') 131 123 132 124 return request.RESPONSE.redirect("%s/waeup_document_view" % context.absolute_url())
Note: See TracChangeset for help on using the changeset viewer.