Changeset 1944


Ignore:
Timestamp:
22 Jun 2007, 07:44:54 (18 years ago)
Author:
joachim
Message:

add searching for groups in member_search, interswitch payment updates

Location:
WAeUP_SRP/trunk
Files:
3 added
7 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/profiles/default/layouts/members_search.xml

    r1449 r1944  
    4444  <property name="is_i18n">True</property>
    4545 </widget>
    46  <table>
     46  <widget name="groups" meta_type="MultiSelect Widget">
     47    <property name="title">Groups</property>
     48    <property name="fields">
     49      <element value="groups"/>
     50    </property>
     51    <property name="label">Groups</property>
     52    <property name="label_edit">Groups</property>
     53    <property name="readonly_layout_modes"/>
     54    <property name="hidden_layout_modes"/>
     55    <property name="hidden_readonly_layout_modes"/>
     56    <property name="vocabulary">groups_voc</property>
     57  </widget>
     58  <table>
    4759  <row>
    4860   <cell name="id" ncols="2"/>
  • WAeUP_SRP/trunk/profiles/default/schemas.xml

    r1756 r1944  
    1313 <object name="faculty" meta_type="CPS Schema"/>
    1414 <object name="members" meta_type="CPS Schema"/>
     15 <object name="members_search" meta_type="CPS Schema"/>
    1516 <object name="payment" meta_type="CPS Schema"/>
    1617 <object name="student" meta_type="CPS Schema"/>
  • WAeUP_SRP/trunk/profiles/default/vocabularies.xml

    r1796 r1944  
    1515 <object name="get_departments_voc" meta_type="CPS Method Vocabulary"/>
    1616 <object name="get_faculties_voc" meta_type="CPS Method Vocabulary"/>
     17 <object name="groups_voc" meta_type="CPS Method Vocabulary"/>
    1718 <object name="waeup_bed_letters" meta_type="CPS Vocabulary"/>
    1819 <object name="waeup_block_letters" meta_type="CPS Vocabulary"/>
  • WAeUP_SRP/trunk/skins/waeup_epayment/getPaymentsFolderInfo.py

    r1938 r1944  
    4848info = {}
    4949is_so = info['is_so'] = context.isSectionOfficer()
    50 info['query_url'] = "https://webpay.interswitchng.com/TransactionQuery.aspx"
     50info['query_url'] = "https://webpay.interswitchng.com/test_paydirect/services/TransactionQueryURL.aspx"
    5151info['prod_id'] = '61'
    5252#res = context.portal_catalog(portal_type='Student',id = student_id)
     
    6666    row['title'] = so.Title
    6767    url = row['url'] = "%s/%s" % (payments_path,so.getId)
    68     so_object = context.restrictedTraverse(url,default=None).getContent()
     68    so_doc = context.restrictedTraverse(url,default=None).getContent()
    6969    row['type'] = so.portal_type
    7070    review_state = row['review_state'] = so.review_state
    71     if so_object.type_description.startswith('School Fee'):
     71    if so_doc.type_description.startswith('School Fee'):
    7272        row['is_approvable'] = is_so and (review_state == "opened") and info['review_state'] == 'cleared_and_validated'
    7373    else:
    7474        row['is_approvable'] = is_so and (review_state == "opened")
    7575    row['is_requeryable'] = False
    76     if so_object.type_description.startswith('School Fee'):
    77         if (review_state == "opened") and\
    78            info['review_state'] == 'cleared_and_validated' and\
    79            not hasattr(so,'resp_code') and hasattr(so, 'order_id'):
     76    #set_trace()
     77    row['resp_desc'] = getattr(so_doc,'resp_desc','no response')
     78    row['trans_ref'] = getattr(so_doc,'order_id','')
     79    if so_doc.type_description.startswith('School Fee'):
     80        if review_state == 'opened' and hasattr(so_doc, 'order_id') and not so_doc.resp_code:
    8081            row['is_requeryable'] = True
    81             row['trans_ref'] = getattr(so,'order_id')
    82             row['callback_url'] = "%s/payments/p%s/interswitch_cb?echo=p%s" % (student.absolute_url(),
    83                                                                   so.order_id,
    84                                                                   so.order_id)
    85     if (review_state == "closed") and so_object.resp_code in ('SC','00','AP','IP',):
     82            row['callback_url'] = "%s/payments/%s/interswitch_cb" % (student.absolute_url(),
     83                                                            so.getId)
     84            href = '%(query_url)s' % info
     85            href += '?transRef=%(trans_ref)s' % row
     86            href += '&prodID=%(prod_id)s' % info
     87            href += '&redirectURL=%(callback_url)s' % row
     88            row['href'] = href
     89    if (review_state == "closed") and so_doc.resp_code in ('SC','00','AP','IP',):
    8690        row['confirmed'] = 'active'
    8791    else:
  • WAeUP_SRP/trunk/skins/waeup_epayment/interswitch_cb.py

    r1937 r1944  
    4040
    4141student = getattr(students,student_id)
    42 
    4342resp_codes = (("desc","resp_desc"),
    4443              ("resp","resp_code"),
    45               ("txnref","pay_reference"),
    46               ("payRet","resp_pay_reference"),
     44              ("txnRef","pay_reference"),
     45              ("payRef","resp_pay_reference"),
    4746              ("retRef","retRef"),
    48               ("CardNum","resp_card_num"),
     47              ("cardNum","resp_card_num"),
    4948              ("apprAmt","resp_approved_amount"),
    5049              )
    5150pd = {}
    52 #from Products.zdb import set_trace;set_trace()
    5351for rc,pdk in resp_codes:
    5452    pd[pdk] = request.get(rc,'')
     
    5755else:
    5856    pd['resp_approved_amount'] = '0'
    59 try:
    60     context.getContent().edit(mapping=pd)
    61 except UnAuthorized,E:
    62     logger.info('%s ' % student_id)
    63 
    64 #resp = pd['resp_desc']
    65 #if  resp.startswith('Appro') and resp.endswith('essful'):
     57   
     58review_state = wftool.getInfoFor(context,'review_state',None)
     59if pd['resp_code'] == '' and review_state == 'opened':
     60    logger.info('%s requeried payment %s and got empty response' % (student_id,context.getId()))
     61    wftool.doActionFor(context,'close')
     62    return request.RESPONSE.redirect("%s/waeup_document_view" % context.absolute_url())
     63context.getContent().edit(mapping = pd)
    6664resp = pd['resp_code']
    6765if  resp == '00':
  • WAeUP_SRP/trunk/skins/waeup_epayment/pay_interswitch.py

    r1937 r1944  
    134134args['pay_item_id'] = "6100"
    135135args['pay_item_name'] = "UNIBEN Tuition Payments"
    136 args['payment_params'] = 'college_split'
    137 args['xml_data'] = xmltext % info
     136args['payment_params'] = 'switch_college_split'
     137#args['xml_data'] = xmltext % info
     138args['xml_data'] = ''
    138139info['args'] = args
    139140return context.goto_interswitch_form(info=info)
    140 url = info['action'] + "?" + urlencode(args)
    141 request.RESPONSE.redirect(url)
  • WAeUP_SRP/trunk/skins/waeup_epayment/payments_view.pt

    r1937 r1944  
    3131          <tr tal:repeat="row rows"
    3232              tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
    33            
    3433            <td tal:attributes="class string:${row/confirmed}">
    3534              <a target="slip" href="" tal:attributes="href string:${context/absolute_url}/${row/id}/payment_receipt"
     
    3736                <strong tal:content="row/title" /></a>
    3837            </td>
     38          <td tal:content="row/resp_desc" />
     39          <td tal:content="row/trans_ref" />
    3940            <td>
    4041            <a tal:condition="row/is_approvable"
     
    4546            </a>             
    4647            </td>
    47             <td tal:condition="python:1">
    48             <a tal:condition="row/is_requeryable"
    49                tal:attributes="href string:${info/query_url}?transRef=${row/trans_ref}&prodID=${info/prod_id}&${row/callback_url};
    50                                onclick python:'return window.confirm(\'%s\')' %(cpsmcat('Are you sure? You will not be able to undo the approval.'), );
     48            <td tal:condition="row/is_requeryable">
     49            <a tal:condition="python:1"
     50               tal:attributes="href row/href;
     51                               onclick python:'return window.confirm(\'%s\')' %(cpsmcat('Are you sure?'), );
    5152                               ">
    5253                [requery payment]
Note: See TracChangeset for help on using the changeset viewer.