Ignore:
Timestamp:
28 Mar 2007, 02:35:25 (18 years ago)
Author:
uli
Message:

Incorporated changeset 1593:1652 of trunk into uli-branch.

Location:
WAeUP_SRP/branches/uli/skins/waeup_epayment
Files:
5 edited
4 copied

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/branches/uli/skins/waeup_epayment/epayment_cb.py

    r1593 r1653  
    1414import logging
    1515logger = logging.getLogger('Skins.epayment_cb')
     16from AccessControl import Unauthorized
    1617import DateTime
    1718if context.portal_membership.isAnonymousUser():
     
    2122students = context.portal_url.getPortalObject().campus.students
    2223wftool = context.portal_workflow
     24mtool = context.portal_membership
     25member = mtool.getAuthenticatedMember()
     26member_id = str(member)
    2327student_id = context.getStudentId()
    24 if student_id is None:
     28if student_id is None or student_id != member_id:
     29    logger.info('%s tried to access payment object of %s' % (member_id,student_id))
     30    referer = request.get('HTTP_REFERER','none')
     31    logger.info('%s:%s illegal access, referer = %s' % (member_id,student_id,referer))
     32    real_ip = request.get('HTTP_X_REAL_IP',"none")
     33    logger.info('%s:%s illegal access, real_x_ip = %s' % (member_id,student_id,real_ip))
    2534    return context.REQUEST.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url())
    2635
     
    3746for rc,pdk in resp_codes:
    3847    pd[pdk] = request.get(rc)
    39 context.getContent().edit(mapping=pd)
     48try:
     49    context.getContent().edit(mapping=pd)
     50except UnAuthorized,E:
     51    logger.info('%s ' % student_id)
     52
    4053#resp = pd['resp_desc']
    4154#if  resp.startswith('Appro') and resp.endswith('essful'):
     
    4457    wftool.doActionFor(student,'pay_school_fee')
    4558    logger.info('%s received valid callback' % student_id)
     59    referer = request.get('HTTP_REFERER','none')
     60    logger.info('%s valid callback referer = %s' % (student_id,referer))
     61    real_ip = request.get('HTTP_X_REAL_IP',"none")
     62    logger.info('%s valid callback real_ip = %s' % (student_id,real_ip))
    4663
    4764elif len(resp) < 3:
  • WAeUP_SRP/branches/uli/skins/waeup_epayment/getPaymentsFolderInfo.py

    r1593 r1653  
    5353    else:
    5454        row['is_approvable'] = is_so and (review_state == "opened")
    55     if (review_state == "closed") and so_object.resp_code in ('SC','00','AP',):
     55    if so_object.type_description.startswith('School Fee'):
     56        row['is_requeryable'] = (review_state == "opened") and info['review_state'] == 'cleared_and_validated'
     57    else:
     58        row['is_requeryable'] = is_so and (review_state == "opened")
     59    if (review_state == "closed") and so_object.resp_code in ('SC','00','AP','IP',):
    5660        row['confirmed'] = 'active'
    5761    else:
  • WAeUP_SRP/branches/uli/skins/waeup_epayment/pay_online.py

    r1593 r1653  
    9191info['callback_url'] = "%s/payments/%s/epayment_cb" % (student.absolute_url(),p_id)
    9292
    93 logger.info('%(student_id)s initiated online school fee payment' % info)
     93logger.info('%(student_id)s initiated online school fee payment with order_id %(order_id)s and callback url %(callback_url)s' % info)
    9494payment_fields = (('x_SiteID','site_id'),
    9595                  ('x_Redirect_url','callback_url'),
  • WAeUP_SRP/branches/uli/skins/waeup_epayment/payment_receipt.pt

    r1427 r1653  
    88      <span tal:condition="info">
    99     
    10         <metal:block tal:condition="python:info_doc['doc'].resp_code in ('00','AP',)">           
     10        <metal:block tal:condition="python:info_doc['doc'].resp_code in ('00','AP','IP')">           
    1111        <h3>Online Payment Receipt</h3>
    1212        <br />
     
    106106        </metal:block>
    107107       
    108         <metal:block tal:condition="python:info_doc['doc'].resp_code not in ('SC','00','AP','')">           
     108        <metal:block tal:condition="python:info_doc['doc'].resp_code not in ('SC','00','AP','IP','')">           
    109109        <h3>Response from Bank: "<span tal:content="python:info_doc['doc'].resp_desc" />"</h3>
    110110        <br />       
  • WAeUP_SRP/branches/uli/skins/waeup_epayment/payments_view.pt

    r1431 r1653  
    3434            </td>
    3535            <td>
    36             <a tal:condition="python:row['is_approvable']"
     36            <a tal:condition="row/is_approvable"
    3737               tal:attributes="href string:${context/absolute_url}/${row/id}/approve_epayment;
    3838                               onclick python:'return window.confirm(\'%s\')' %(cpsmcat('Are you sure? You will not be able to undo the approval.'), );
    3939                               ">
    4040                [approve payment]
     41            </a>             
     42            </td>
     43            <td tal:condition="nothing">
     44            <a tal:condition="row/is_requeryable"
     45               tal:attributes="href string:${context/absolute_url}/${row/id}/requery_payment;
     46                               onclick python:'return window.confirm(\'%s\')' %(cpsmcat('Are you sure? You will not be able to undo the approval.'), );
     47                               ">
     48                [requery payment]
    4149            </a>             
    4250            </td>
     
    5361                value="Initiate School Fee Online Payment"
    5462                />
     63               
     64
     65
     66               
    5567        </form> 
    5668
Note: See TracChangeset for help on using the changeset viewer.