Changeset 5781 for WAeUP_SRP/trunk


Ignore:
Timestamp:
28 Feb 2011, 10:53:12 (14 years ago)
Author:
Henrik Bettermann
Message:

Implement online maintenance fee payment at FUTMinna.

Enable random order booking at FCEOkene.

Location:
WAeUP_SRP/trunk
Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/profiles/futminna/actions.xml

    r3763 r5781  
    88  </action>
    99 </action-provider>
     10 <action-provider name="portal_actions">
     11  <action title="My Accommodation" action_id="reserve_accommodation"
     12     category="student_navigation" condition_expr="member"
     13     url_expr="string:${portal_url}/campus/students/${member}/accommodations" visible="True"/>
     14 </action-provider>
    1015</object>
  • WAeUP_SRP/trunk/skins/waeup_accommodation/ReadMe.txt

    r5629 r5781  
    3535Profile importieren (Achtung: vorher Portalbasisdaten sichern)
    3636initialize_accommodation_catalog
    37 getStudentFolderInfo Zeile 84,58 aktivieren
     37getStudentFolderInfo Zeile 84,85 aktivieren
    3838student_view.pt: in Zeile 63 condition entfernen
    3939random Order für Okene customisieren
     
    4444Beim Löschen von Studenten accommodation-Tabelle exportieren
    4545Online Payment auf FUTMinna implementieren
     46Accommodation.AccoFolder.importReservedBeds anpassen
  • WAeUP_SRP/trunk/skins/waeup_accommodation/getAccommodationStatus.py

    r5692 r5781  
    177177info['bed'] = accommodation_record.bed
    178178info['session'] = accommodation_record.session
     179info['maintenance_paid'] = accommodation_record.reservation_status == 'maintenance_fee_paid'
    179180
    180181return info
  • WAeUP_SRP/trunk/skins/waeup_accommodation/pay_accommodation_form.pt

    r5621 r5781  
    1818        <div tal:replace="structure rendered_main" />
    1919       
    20         <p>Instructions :</p>
     20        <p tal:condition="not: maintenance_online">Instructions :</p>
    2121       
    2222        <ul tal:condition="not: maintenance_online">
  • WAeUP_SRP/trunk/skins/waeup_epayment/interswitch_cb.py

    r3964 r5781  
    4646logger.info('%s, callback referer = %s, IP = %s' % (student_id,referer,real_ip))
    4747
    48 if not 'webpay.interswitchng.com' in referer and not 'waeup.org' in referer:
     48ontest = False
     49
     50if not ontest and not 'webpay.interswitchng.com' in referer and not 'waeup.org' in referer:
    4951    logger.info('%s, wrong callback referer %s, callback rejected, IP = %s' % (student_id,referer,real_ip))
    5052    return request.RESPONSE.redirect("%s/waeup_document_view" % context.absolute_url())
     
    6365    pd[pdk] = request.get(rc,'')
    6466
    65 ## for testing purposes
    66 #pd['resp_desc'] = 'Simulated Callback'
    67 #pd['resp_pay_reference'] = 'XXXX'
    68 #pd['resp_code'] = '00'
    69 #pd['resp_card_num'] = '0000'
    70 #pd['resp_approved_amount'] = '4680000'
     67if ontest:
     68    pd['resp_desc'] = 'Simulated Callback'
     69    pd['resp_pay_reference'] = 'XXXX'
     70    pd['resp_code'] = '00'
     71    pd['resp_card_num'] = '0000'
     72    pd['resp_approved_amount'] = '4680000'
    7173
    7274if pd['resp_code'] == '00' and len(pd['resp_approved_amount']) > 4:
     
    9294        resp_approved_amount = int(pd['resp_approved_amount'])
    9395        #set_trace()
    94         if amount + surcharge != resp_approved_amount:
     96        if not ontest and amount + surcharge != resp_approved_amount:
    9597            logger.info('Warning: %s, approved amount %s and authorized amount %s are different for payment %s of %s' % (member,resp_approved_amount,amount+surcharge,context.getId(),student_id))
    9698            pd['status'] = 'failed'
     
    140142
    141143    elif pay_doc.category == 'hostel_maintenance':
    142         acco_info = context.getAccommodationInfo()
    143         d = {}
    144         d['acco_maint_date'] = pay_doc.date
    145         d['acco_maint_fee'] = pay_doc.amount
    146         d['acco_maint_pay_id'] = context.getId()
    147         try:
    148             acco_info['acco_doc'].edit(mapping=d)
    149         except:
    150             logger.info('%s requeried payment though maintenance already paid' % student_id)
    151 
    152         try:
    153             wftool.doActionFor(acco_info['acco'],'pay_maintenance_fee',dest_container=acco_info['acco'])
    154         except:
    155             logger.info('%s no workflow action pay_maintenance_fee' % student_id)
     144       
     145        ## callback function for accommodation_catalog method
     146        data={}
     147        data['acco_maint_date'] = pay_doc.date
     148        data['catkey'] =student_id + '|' + session
     149        data['acco_maint_fee'] = pay_doc.amount
     150        data['acco_maint_pay_id'] = context.getId()
     151        data['reservation_status'] = 'maintenance_fee_paid'
     152        context.accommodation_catalog.modifyRecord(**data)       
     153       
     154        ## callback function for accommodation object method (deactivated since March 2011)
     155        #acco_info = context.getAccommodationInfo()
     156        #d = {}
     157        #d['acco_maint_date'] = pay_doc.date
     158        #d['acco_maint_fee'] = pay_doc.amount
     159        #d['acco_maint_pay_id'] = context.getId()
     160        #try:
     161        #    acco_info['acco_doc'].edit(mapping=d)
     162        #except:
     163        #    logger.info('%s requeried payment though maintenance already paid' % student_id)
     164        #try:
     165        #    wftool.doActionFor(acco_info['acco'],'pay_maintenance_fee',dest_container=acco_info['acco'])
     166        #except:
     167        #    logger.info('%s no workflow action pay_maintenance_fee' % student_id)
    156168           
    157169
Note: See TracChangeset for help on using the changeset viewer.