Changeset 7901


Ignore:
Timestamp:
17 Mar 2012, 10:16:07 (13 years ago)
Author:
Henrik Bettermann
Message:

Implement eTranzact payment and restructure change school fee payment.

Session 2011/2012: eTranzact and Interswitch payments only
Previous sessions: scratch card payments only

Location:
WAeUP_SRP/trunk
Files:
6 added
6 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/profiles/default/vocabularies/payment_types.xml

    r5190 r7901  
    1010    <item key="sc" msgid="">Scratch Card</item>
    1111    <item key="online" msgid="">Online</item>
     12    <item key="etranzact" msgid="">eTranzact</item>
    1213    <item key="request" msgid="">Request</item>
    1314</object>
  • WAeUP_SRP/trunk/skins/waeup_uniben/custom.css.dtml

    r7900 r7901  
    6767  white-space: nowrap;
    6868  color: #333333;
    69   text-decoration:line-through;
    7069  font-weight: bold;
    7170}
     
    7473  white-space: nowrap; 
    7574  color: #333333;
    76   text-decoration:line-through;
    7775}
    7876
     
    8078  white-space: nowrap; 
    8179  color: #333333;
    82   text-decoration:line-through;
    8380}
    8481
  • WAeUP_SRP/trunk/skins/waeup_uniben/getPaymentInfo.py

    r7900 r7901  
    3636payment = context.getContent()
    3737info['payment_doc'] = payment
     38info['is_etranzact_pmt'] = ie = payment.type == 'etranzact'
    3839info['is_online_pmt'] = io = payment.resp_code in ('0','00','AP','IP',)
    3940info['is_request_pmt'] = ir = payment.resp_code in ('RP',)
    4041info['is_scratchcard_pmt'] = isc =  payment.resp_code == 'SC'
    41 info['is_interrupted'] = ii = payment.resp_code == ''
    42 info['unknown_code'] = not (io or isc or ii or ir)
     42info['is_interrupted'] = ii = payment.resp_code == '' and not ie
     43info['unknown_code'] = not (io or isc or ii or ir or ie)
    4344info['resp_code'] = payment.resp_code
    4445info['resp_desc'] = payment.resp_desc
  • WAeUP_SRP/trunk/skins/waeup_uniben/getPaymentsFolderInfo.py

    r7900 r7901  
    4242info['student_name'] = student_record.name
    4343info['query_url'] = "https://webpay.interswitchng.com/paydirect/services/TransactionQueryURL.aspx"
     44info['query_url_tranzact'] = "http://demo.etranzact.com:8080/WebConnect/queryPayoutletTransaction.jsp"
    4445review_state = info['review_state'] = student_record.review_state
    4546parttime = student_record.mode and student_record.mode.endswith('_pt')
     
    5657# begin customization
    5758
    58 # special handling of 06 DPA students (ticket 658)
    59 if review_state == 'cleared_and_validated' and session in ('06') and student_record.course == 'DPA':
     59if session in ('11','12','13'):
     60    info['payment_method'] = "online_payment"
     61else:
    6062    info['payment_method'] = "sc_payment"
    61 # special handling of 06 payments for testing purposes     
    62 elif review_state == 'cleared_and_validated' and session in ('06'):
    63     info['payment_method'] = "online_payment"
    64 elif review_state == 'returning' and info['next_session'] == '06':
    65     info['payment_method'] = "both_payments"
    66 elif review_state == 'cleared_and_validated' and session not in ('07','08'):
    67     info['payment_method'] = "both_payments"
    68 elif review_state == 'cleared_and_validated' and session in ('07','08'):
    69     info['payment_method'] = "sc_payment"
    70 elif review_state == 'returning' and info['next_session'] != session:
    71     info['payment_method'] = "sc_payment"
    72 
    73 
    7463
    7564info['prod_id'] = '61'
     
    115104    row['sort_param'] = payment.date
    116105    url = row['url'] = "%s/p%s" % (payments_path,oid[start_pos:])
    117     row['is_requeryable'] = "%s_%s" % (payment.category,payment.session_id) not in paid_fees and payment.type == 'online' or str(member) in ('admin',)
    118     row['is_approvable'] = is_so and row['is_requeryable'] and payment.category == 'schoolfee' # does not make sense for maitenance
     106    row['is_requeryable_interswitch'] = "%s_%s" % (payment.category,payment.session_id) not in paid_fees and payment.type == 'online' #or str(member) in ('admin',)
     107    row['is_requeryable_etranzact'] = "%s_%s" % (payment.category,payment.session_id) not in paid_fees and payment.type == 'etranzact' #or str(member) in ('admin',)
     108    row['is_approvable'] = is_so and (row['is_requeryable_interswitch'] or row['is_requeryable_etranzact'])and payment.category == 'schoolfee' # does not make sense for maitenance
    119109    row['resp_desc'] = payment.resp_desc or 'Payment Process Interrupted'
    120110    row['trans_ref'] = payment.order_id
    121     if row['is_requeryable']:
    122         row['callback_url'] = "%(url)s/interswitch_cb" % row
     111    if row['is_requeryable_interswitch']:
     112        row['callback_url_inter'] = "%(url)s/interswitch_cb" % row
    123113#        if payment.category == 'schoolfee':
    124114#            row['callback_url'] = "%(url)s/interswitch_cb" % row
     
    129119        href += '?transRef=%(trans_ref)s' % row
    130120        href += '&prodID=%(prod_id)s' % info
    131         href += '&redirectURL=%(callback_url)s' % row
    132         row['href'] = href
     121        href += '&redirectURL=%(callback_url_inter)s' % row
     122        row['href_inter'] = href
     123
     124    if row['is_requeryable_etranzact']:
     125        row['callback_url_tranzact'] = "%(url)s/tranzact_cb" % row
     126#        if payment.category == 'schoolfee':
     127#            row['callback_url'] = "%(url)s/interswitch_cb" % row
     128#        elif payment.category == 'hostel_maintenance':
     129#            row['callback_url'] = "%(url)s/interswitch_acco_cb" % row
     130#        else:
     131
     132        href = 'enter_tranzact_pin'
     133        href += '?query_url=%(query_url_tranzact)s' % info
     134        href += '&redirectURL=%(callback_url_tranzact)s' % row
     135        row['href_tranzact'] = href
     136
    133137    if payment.status == 'paid':
    134138        row['confirmed'] = 'active'
  • WAeUP_SRP/trunk/skins/waeup_uniben/payment_receipt.pt

    r7900 r7901  
    88      <span tal:condition="python: info">
    99        <metal:block tal:condition="info/is_online_pmt">
    10         <h3>Online Payment Receipt</h3>
     10        <h3>Interswitch Payment Receipt</h3>
    1111        <br />
    1212        <table tal:define="student info/student">
     
    5050       
    5151       
     52        <metal:block tal:condition="info/is_etranzact_pmt">
     53        <h3>eTranzact Payment Slip</h3>
     54        <br />
     55        <table tal:define="student info/student;
     56                           pm nocall: info/payment_doc">
     57        <tr>
     58          <td width="220px">Name:</td>
     59          <td><span tal:content="student/name" /></td>
     60        </tr>
     61        <tr>
     62          <td>Student Id:</td>
     63          <td tal:content="student/id" />
     64        </tr>
     65        <tr>
     66          <td>Registration Number:</td>
     67          <td tal:content="student/jamb_reg_no" />
     68        </tr>
     69        <tr>
     70          <td>Matriculation Number:</td>
     71          <td tal:content="student/matric_no" />
     72        </tr>
     73        <tr>
     74          <td>Current Study Level:</td>
     75          <td tal:content="python:context.portal_vocabularies.student_levels.get(student['level'])" />
     76        </tr>
     77        <tr>
     78          <td>Certificate Id:</td>
     79          <td tal:content="student/course" />
     80        </tr>
     81        <tr>
     82          <td>Faculty:</td>
     83          <td tal:content="student/faculty" />
     84        </tr>
     85        <tr>
     86          <td>Department:</td>
     87          <td tal:content="student/department" />
     88        </tr>
     89
     90       <tr>
     91          <td width="220px">Payment Status:</td>
     92          <td><span tal:content="python:context.portal_vocabularies.payment_status.get(pm.status)" /></td>
     93        </tr>
     94        <tr>
     95          <td width="220px">Payment Type:</td>
     96
     97          <td><span tal:content="python:context.portal_vocabularies.payment_types.get(pm.type)" /></td>
     98        </tr>
     99        <tr>
     100          <td width="220px">Payment Category:</td>
     101          <td><span tal:content="python:context.portal_vocabularies.payment_categories.get(pm.category)" /></td>
     102        </tr>
     103        <tr>
     104          <td width="220px">Payment Item:</td>
     105          <td><span tal:content="pm/item" /></td>
     106        </tr>
     107        <tr>
     108          <td width="220px">Session:</td>
     109          <td><span tal:content="python:context.portal_vocabularies.sessions.get(pm.session_id)" /></td>
     110        </tr>
     111
     112        <tr>
     113          <td width="220px">Slip Creation Date:</td>
     114          <td><span tal:content='python:pm.date.strftime("%d/%m/%y %H:%M:%S")' /></td>
     115        </tr>
     116        <tr>
     117          <td width="220px">Amount (Naira):</td>
     118          <td><strong><span tal:content="pm/amount" /></strong></td>
     119        </tr>
     120        <tr>
     121          <td width="220px">Transaction Id:</td>
     122          <td><strong><span tal:content="pm/order_id" /></strong></td>
     123        </tr>
     124        <tr>
     125          <td width="220px">Response Code:</td>
     126          <td><span tal:content="pm/resp_code" /></td>
     127        </tr>
     128        <tr>
     129          <td width="220px">Response Description:</td>
     130          <td><span tal:content="pm/resp_desc" /></td>
     131        </tr>
     132        </table>
     133
     134        </metal:block>
    52135       
    53136       
     
    86169          <td tal:content="student/department" />
    87170        </tr>             
    88 
    89171
    90172        <tr>
  • WAeUP_SRP/trunk/skins/waeup_uniben/payments_view.pt

    r7900 r7901  
    4747            </td>
    4848            <td>
    49               <a tal:condition="row/is_requeryable"
    50                  tal:attributes="href row/href;
     49              <a tal:condition="row/is_requeryable_interswitch"
     50                 tal:attributes="href row/href_inter;
    5151                 onclick python:'return window.confirm(\'%s\')' %(cpsmcat('Are you sure?'), );"
    5252                 >
    53                 [requery]
     53                [query Interswitch]
    5454              </a>             
     55            </td>
     56            <td>
     57              <a tal:condition="row/is_requeryable_etranzact"
     58                 tal:attributes="href row/href_tranzact;"
     59                 >
     60                [query eTranzact]
     61              </a>
    5562            </td>
    5663            <td>
     
    7279                   class="context"
    7380                   value="Pay"
    74                    tal:attributes="value string:Initiate ${info/next_session_str} School Fee Payment by Cash Card"
     81                   tal:attributes="value string:Initiate ${info/next_session_str} School Fee Payment (Interswitch)"
    7582                   />
    7683          </form> 
    77           <form tal:condition="python: info.get('payment_method') in ('first_instalment',)"
    78                 tal:attributes="action string: ${context/absolute_url}/pay_interswitch" method="post" class="group">
    79             <input type="submit" name="epayment"
    80                    class="context"
     84
     85          <form tal:condition="python: info.get('payment_method') in ('online_payment','both_payments')"
     86                tal:attributes="action string: ${context/absolute_url}/pay_etranzact" method="post" class="group">
     87            <input type="submit" name="epayment"
     88                   class="context"
    8189                   value="Pay"
    82                    tal:attributes="value string:Initiate ${info/next_session_str} School Fee Payment by Cash Card (First Instalment)"
     90                   tal:attributes="value string:Initiate ${info/next_session_str} School Fee Payment (eTranzact)"
    8391                   />
    84           </form> 
    85           <form tal:condition="python: info.get('payment_method') in ('second_instalment',)"
    86                 tal:attributes="action string: ${context/absolute_url}/pay_interswitch2" method="post" class="group">
    87             <input type="submit" name="epayment"
    88                    class="context"
    89                    value="Pay"
    90                    tal:attributes="value string:Initiate School Fee Payment by Cash Card (Second Instalment)"
    91                    />
    92           </form>                       
     92          </form>
     93
    9394          <form tal:condition="python: info.get('payment_method') in ('sc_payment','both_payments')"
    9495                tal:attributes="action string: ${context/absolute_url}/pay_by_sc" method="post" class="group">
     
    99100                   class="context"
    100101                   value="Pay"
    101                    tal:attributes="value string:Initiate ${info/next_session_str} School Fee Payment by Scratch Card"
     102                   tal:attributes="value string:Initiate ${info/next_session_str} School Fee Payment (Scratch Card)"
    102103                   />
    103104          </form>   
Note: See TracChangeset for help on using the changeset viewer.