Changeset 1937


Ignore:
Timestamp:
19 Jun 2007, 17:12:59 (18 years ago)
Author:
joachim
Message:

interswitch payment (in custom)

Location:
WAeUP_SRP/trunk/skins/waeup_epayment
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_epayment/goto_interswitch_form.pt

    r1885 r1937  
    3434            Bank:
    3535            </td>
    36             <td>Bank</td>
     36            <td>Wema Bank</td>
    3737          </tr>         
    3838        </table>
  • WAeUP_SRP/trunk/skins/waeup_epayment/interswitch_cb.py

    r1892 r1937  
    1212payment callback
    1313"""
     14try:
     15    from Products.zdb import set_trace
     16except:
     17    def set_trace():
     18        pass
    1419import logging
    1520logger = logging.getLogger('Skins.epayment_cb')
     
    4752#from Products.zdb import set_trace;set_trace()
    4853for rc,pdk in resp_codes:
    49     pd[pdk] = request.get(rc)
     54    pd[pdk] = request.get(rc,'')
     55if pd['resp_code'] == '00' and len(pd['resp_approved_amount']) > 4:
     56    pd['resp_approved_amount'] = pd['resp_approved_amount'][:-2]
     57else:
     58    pd['resp_approved_amount'] = '0'
    5059try:
    5160    context.getContent().edit(mapping=pd)
  • WAeUP_SRP/trunk/skins/waeup_epayment/interswitch_form.pt

    r1927 r1937  
    2929            Bank:
    3030            </td>
    31             <td>Bank</td>
     31            <td>Wema Bank</td>
    3232          </tr>         
    3333        </table>
  • WAeUP_SRP/trunk/skins/waeup_epayment/pay_interswitch.py

    r1892 r1937  
    104104for arg,field in payment_fields:
    105105    args[arg] = info[field]
     106itotal = int(amount)*100
     107wema_amount = 10000
     108provider_amount = 35000
     109interswitch_amount = 15000
     110#uniben_amount = itotal - wema_amount - provider_amount - interswitch_amount
     111uniben_amount = itotal - interswitch_amount
    106112xmldict = {}
    107113xmldict['detail_ref'] = args['txn_ref']
    108114xmldict['department'] = sbrain.department
    109115xmldict['faculty'] = sbrain.faculty
    110 xmldict['uniben_amt'] = "%s00" % amount
    111 xmldict['wema_amt'] = "10000"
    112 xmldict['provider_amt'] = "35000"
     116#xmldict['wema_amt'] = "%d" % wema_amount
     117#xmldict['provider_amt'] = "%d" % provider_amount
     118xmldict['uniben_amt'] = "%d" % uniben_amount
     119##<item_detail item_id="2" item_name="WEMA" item_amt="%(wema_amt)s" bank_id="16" acct_num="48398023902" />
     120##<item_detail item_id="3" item_name="Portal Provider" item_amt="%(provider_amt)s" bank_id="47" acct_num="0980938209483" />
    113121xmltext = """
    114122<payment_item_detail>
     
    116124faculty="%(faculty)s">
    117125<item_detail item_id="1" item_name="UNIBEN" item_amt="%(uniben_amt)s" bank_id="16" acct_num="384950902390" />
    118 <item_detail item_id="2" item_name="WEMA" item_amt="%(wema_amt)s" bank_id="16" acct_num="48398023902" />
    119 <item_detail item_id="3" item_name="Portal Provider" item_amt="%(provider_amt)s" bank_id="47" acct_num="0980938209483" />
    120126</item_details>
    121127</payment_item_detail>
    122128""" % xmldict
    123 total = int(xmldict['uniben_amt'])+int(xmldict['wema_amt'])+int(xmldict['provider_amt'])
     129#total = int(xmldict['uniben_amt'])+int(xmldict['wema_amt'])+int(xmldict['provider_amt'])
     130total = int(xmldict['uniben_amt'])
    124131args['Amount'] = "%d" % (total + 15000)
    125132args['site_name'] = "uniben.waeup.org"
  • WAeUP_SRP/trunk/skins/waeup_epayment/payments_view.pt

    r1783 r1937  
    4545            </a>             
    4646            </td>
    47             <td tal:condition="nothing">
     47            <td tal:condition="python:1">
    4848            <a tal:condition="row/is_requeryable"
    49                tal:attributes="href string:${context/absolute_url}/${row/id}/requery_payment;
     49               tal:attributes="href string:${info/query_url}?transRef=${row/trans_ref}&prodID=${info/prod_id}&${row/callback_url};
    5050                               onclick python:'return window.confirm(\'%s\')' %(cpsmcat('Are you sure? You will not be able to undo the approval.'), );
    5151                               ">
     
    5353            </a>             
    5454            </td>
    55                        
    5655          </tr>
    5756        </table>
    5857        <br />
    5958        <div>
    60        
    6159        <form tal:condition="python:review_state == 'cleared_and_validated'"
    62               tal:attributes="action string: ${context/absolute_url}/pay_online" method="post" class="group">
     60              tal:attributes="action string: ${context/absolute_url}/pay_interswitch" method="post" class="group">
    6361         <input type="submit" name="epayment"
    6462                class="context"
    6563                value="Initiate School Fee Online Payment"
    6664                />
    67                
    68                
    6965        </form> 
    70 
    7166        <form tal:condition="python:review_state == 'returning'"
    7267              tal:attributes="action string: ${context/absolute_url}/pay_by_sc" method="post" class="group">
     
    7469                tal:attributes="value info/next_session"
    7570                />
    76 
    7771         <input type="submit" name="epayment"
    7872                class="context"
     
    8276        </form>         
    8377        </div>       
    84 
    8578      </span>
    8679      </span>
Note: See TracChangeset for help on using the changeset viewer.