Ignore:
Timestamp:
4 Dec 2007, 19:24:23 (17 years ago)
Author:
joachim
Message:

implementing the payments_catalog

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/uniben/waeup_custom/getPaymentsFolderInfo.py

    r2847 r2859  
    1111"""
    1212Info for the PaymentsFolder
     13try:
     14    from Products.zdb import set_trace
     15except:
     16    def set_trace():
     17        pass
    1318"""
    1419
     
    1621if mtool.isAnonymousUser():
    1722    return None
    18 try:
    19     from Products.zdb import set_trace
    20 except:
    21     def set_trace():
    22         pass
    23 
    2423
    2524#import logging
     
    3635import DateTime
    3736request = context.REQUEST
    38 students = context.portal_url.getPortalObject().campus.students
     37#students = context.portal_url.getPortalObject().campus.students
    3938student_id = context.getStudentId()
    4039if student_id is None:
    4140    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)
     42student_record = context.students_catalog.getRecordByKey(student_id)
     43context['updatePayments']()
    4544payments = []
    46 #from Products.zdb import set_trace;set_trace()
    4745
    4846info = {}
    4947is_so = info['is_so'] = context.isSectionOfficer()
    5048is_student = info['is_student'] = context.isStudent()
    51 info['student_name'] = s_brain.name
     49info['student_name'] = student_record.name
    5250info['query_url'] = "https://webpay.interswitchng.com/paydirect/services/TransactionQueryURL.aspx"
    53 review_state = info['review_state'] = s_brain.review_state
    54 parttime = s_brain.mode and s_brain.mode.endswith('_pt')
    55 fulltime = s_brain.mode and s_brain.mode.endswith('_ft')
     51review_state = info['review_state'] = student_record.review_state
     52parttime = student_record.mode and student_record.mode.endswith('_pt')
     53fulltime = student_record.mode and student_record.mode.endswith('_ft')
    5654
    5755#if review_state == 'cleared_and_validated' or (parttime and review_state == 'returning'):
     
    6058#    sc_payment = True
    6159
    62 session = s_brain.session
    63 next_info = context.getNextInfo(s_brain)
     60session = student_record.session
     61next_info = context.getNextInfo(student_record)
    6462info['next_session'] = next_info['next_session_id']
    6563info['next_session_str'] = next_info['next_session_str']
     
    7371info['prod_id'] = '61'
    7472
    75 info['student_name'] = s_brain.name
     73info['student_name'] = student_record.name
    7674payments_path = "%s/campus/students/%s/payments" % (context.portal_url.getPortalPath(),student_id)
    7775sos = context.portal_catalog(container_path=payments_path)
     
    9795        if review_state == 'opened' and info['review_state'] == 'cleared_and_validated' and hasattr(so_doc, 'order_id') and not so_doc.resp_code:
    9896            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)
    10198            href = '%(query_url)s' % info
    10299            href += '?transRef=%(trans_ref)s' % row
Note: See TracChangeset for help on using the changeset viewer.