Changeset 3068 for WAeUP_SRP/uniben/waeup_custom
- Timestamp:
- 30 Jan 2008, 18:49:19 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/uniben/waeup_custom/getPaymentsFolderInfo.py
r3060 r3068 19 19 20 20 mtool = context.portal_membership 21 wftool = context.portal_workflow 21 22 member = mtool.getAuthenticatedMember() 22 23 if mtool.isAnonymousUser(): … … 75 76 76 77 info['student_name'] = student_record.name 77 payments_path = "%s/campus/students/%s/payments" % (context.portal_url.getPortalPath(),student_id)78 sos = context.portal_catalog(container_path=payments_path)79 78 info['is_so'] = is_so 80 79 81 for so in sos:80 for payment_id,payment in context.objectItems(): 82 81 row = {} 83 row['id'] = so.getId84 row['title'] = so.Title85 url = row['url'] = "%s/%s" % (payments_path,so.getId)86 so_doc = context.restrictedTraverse(url,default=None).getContent()87 row['type'] = so.portal_type88 review_state = row['review_state'] = so.review_state89 if so_doc.type_description.startswith('School Fee'):82 row['id'] = payment_id 83 row['title'] = payment.Title() 84 url = row['url'] = payment.absolute_url() 85 payment_doc = payment.getContent() 86 row['type'] = payment_doc.portal_type 87 review_state = row['review_state'] = wftool.getInfoFor(payment,'review_state',None) 88 if payment_doc.type_description.startswith('School Fee'): 90 89 row['is_approvable'] = is_so and (review_state == "opened") and info['review_state'] == 'cleared_and_validated' 91 90 else: … … 93 92 row['is_requeryable'] = False 94 93 #set_trace() 95 row['resp_desc'] = getattr( so_doc,'resp_desc','no response')96 row['trans_ref'] = getattr( so_doc,'order_id','')97 if so_doc.type_description.startswith('School Fee'):94 row['resp_desc'] = getattr(payment_doc,'resp_desc','no response') 95 row['trans_ref'] = getattr(payment_doc,'order_id','') 96 if payment_doc.type_description.startswith('School Fee'): 98 97 if (review_state == 'opened' and info['review_state'] in ('cleared_and_validated',) and \ 99 hasattr( so_doc, 'order_id') and not so_doc.resp_code) or str(member) in ('admin',):98 hasattr(payment_doc, 'order_id') and not payment_doc.resp_code) or str(member) in ('admin',): 100 99 row['is_requeryable'] = True 101 row['callback_url'] = "%s/payments/%s/interswitch_cb" % (student.absolute_url(), 102 so.getId) 100 row['callback_url'] = "%(url)s/interswitch_cb" % row 103 101 href = '%(query_url)s' % info 104 102 href += '?transRef=%(trans_ref)s' % row … … 106 104 href += '&redirectURL=%(callback_url)s' % row 107 105 row['href'] = href 108 if (review_state == "closed") and so_doc.resp_code in ('SC','00','AP','IP',):106 if (review_state == "closed") and payment_doc.resp_code in ('SC','00','AP','IP',): 109 107 row['confirmed'] = 'active' 110 108 else: 111 109 row['confirmed'] = 'unsuccessful' 112 110 row['is_editable'] = is_so and (row['confirmed'] == 'active') 113 114 111 payments.append(row) 115 112
Note: See TracChangeset for help on using the changeset viewer.