Changeset 4799


Ignore:
Timestamp:
12 Jan 2010, 20:03:22 (15 years ago)
Author:
Henrik Bettermann
Message:

enable college_split for Uniben (tested online with Jason)

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

Legend:

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

    r3709 r4799  
    1212          <input type="hidden" tal:attributes="name python:arg[0];value python:arg[1]" />
    1313      </span>         
     14     
     15      <span tal:replace = "structure info/xml_data" />       
     16     
    1417        <table>
    1518          <tr>
     
    3033            <td> Naira <span tal:content="info/amount" /></td>
    3134          </tr>
     35             
     36     
     37     
     38     
     39     
     40     
    3241     
    3342        </table>
     
    3645               class="standalone"
    3746               name="goto_bank"
    38                value="Proceed to Payment Gateway"
     47               value="Proceed to Interswitch Payment Gateway"
    3948               />
    4049      </form>
  • WAeUP_SRP/trunk/skins/waeup_epayment/pay_interswitch.py

    r3709 r4799  
    1 ## Script (Python) "pay_online"
     1##Script (Python) "pay_online"
    22##bind container=container
    33##bind context=context
     
    4848if not fee_dict or (not new and fulltime) or not (new or returning):
    4949    return context.interswitch_form(info=info)
    50 info['site_id'] = '61'
     50info['site_id'] = '57'
    5151info['currency_id'] = '566'
    5252if new:
     
    5555    amount = info['amount'] = fee_dict['returning']
    5656if fulltime:
    57     pay_item_id = "6100"
     57    pay_item_id = "5700"
    5858    #info['type_code'] = student_record.faculty   #type_code is redundant and will be removed soon
    5959    info['bank'] = ''
    6060else:
    61     pay_item_id = "6101"
     61    pay_item_id = "5701"
    6262    #info['type_code'] = student_record.course  #type_code is redundant and will be removed soon
    6363    info['bank'] = ''
     64info['surcharge'] = '0'  # Uniben doesn't show the surcharge on the slip
    6465info['payment_possible'] = True
    6566info['type_description'] = fee_dict['description']
     
    8586if True or context.portal_url().find('uniben-demo.waeup.org') >-1 or\
    8687   context.portal_url().find('uniben.waeup.org') >-1:
     88    #info['action'] = "https://webpay.interswitchng.com/test_paydirect/webpay/pay.aspx"
    8789    info['action'] = "https://webpay.interswitchng.com/paydirect/webpay/pay.aspx"
    8890else:
    89     #pass
    90     #return None
    9191    info['action'] = "%s/payments/%s/simulate_callback" % (student.absolute_url(),p_id)
    9292
     
    110110d = {}
    111111d.update(info)
    112 #from Products.zdb import set_trace;set_trace()
    113112payment.getContent().edit(mapping=d)
    114 #wftool.doActionFor(payment,'close')
    115 #wftool.doActionFor(student,'pay_school_fee')
    116113info['callback_url'] = "%s/payments/%s/interswitch_cb?echo=%s" % (student.absolute_url(),
    117114                                                                  p_id,
     
    132129    args[arg] = info[field]
    133130itotal = int(amount)*100
    134 wema_amount = 10000
    135 provider_amount = 35000
     131fbn_amount = 10000
     132bt_amount = 75000
    136133interswitch_amount = 15000
    137 #uniben_amount = itotal - wema_amount - provider_amount - interswitch_amount
    138 uniben_amount = itotal - interswitch_amount
     134uniben_amount = itotal - fbn_amount - bt_amount - interswitch_amount
    139135xmldict = {}
    140136xmldict['detail_ref'] = args['txn_ref']
    141137xmldict['department'] = student_record.department
    142138xmldict['faculty'] = student_record.faculty
    143 #xmldict['wema_amt'] = "%d" % wema_amount
    144 #xmldict['provider_amt'] = "%d" % provider_amount
     139xmldict['fbn_amt'] = "%d" % fbn_amount
     140xmldict['bt_amt'] = "%d" % bt_amount
    145141xmldict['uniben_amt'] = "%d" % uniben_amount
    146 ##<item_detail item_id="2" item_name="WEMA" item_amt="%(wema_amt)s" bank_id="16" acct_num="48398023902" />
    147 ##<item_detail item_id="3" item_name="Portal Provider" item_amt="%(provider_amt)s" bank_id="47" acct_num="0980938209483" />
    148 xmltext = """
    149 <payment_item_detail>
    150 <item_details detail_ref="%(detail_ref)s" college="UNIBEN" department="%(department)s"
    151 faculty="%(faculty)s">
    152 <item_detail item_id="1" item_name="UNIBEN" item_amt="%(uniben_amt)s" bank_id="16" acct_num="384950902390" />
     142#Full and Part-time students School Fees go into different Accounts
     143if student_record.mode.endswith('_ft'):
     144  xmldict['uniben_acct'] = "6162030000198"
     145  xmldict['bank_id'] = '8'
     146else:
     147    xmldict['uniben_acct'] = "6162030000277"
     148    xmldict['bank_id'] = '8'
     149
     150xmltext = """<payment_item_detail>
     151<item_details detail_ref="%(detail_ref)s" college="UNIBEN" department="%(department)s" faculty="%(faculty)s">
     152<item_detail item_id="1" item_name="UNIBEN School Fee" item_amt="%(uniben_amt)s" bank_id="%(bank_id)s" acct_num="%(uniben_acct)s" />
     153<item_detail item_id="2" item_name="BT" item_amt="%(bt_amt)s" bank_id="89" acct_num="0061001000021095" />
     154<item_detail item_id="3" item_name="FBN" item_amt="%(fbn_amt)s" bank_id="8" acct_num="6162030000286" />
    153155</item_details>
    154 </payment_item_detail>
    155 """ % xmldict
    156 #total = int(xmldict['uniben_amt'])+int(xmldict['wema_amt'])+int(xmldict['provider_amt'])
    157 total = int(xmldict['uniben_amt'])
    158 args['Amount'] = "%d" % (total + 15000)
     156</payment_item_detail>""" % xmldict
     157
     158info['xml_data'] = """<input type="hidden" name="xml_data" value='%s'  />""" % xmltext
     159
     160args['Amount'] = "%d" % (itotal)
    159161args['site_name'] = "uniben.waeup.org"
    160162args['cust_name_desc'] = "Student Name"
    161163args['pay_item_id'] = pay_item_id
    162164args['pay_item_name'] = "UNIBEN Tuition Payments"
    163 args['payment_params'] = 'switch_college_split'
    164 #args['xml_data'] = xmltext % info
    165 args['xml_data'] = ''
     165args['payment_params'] = 'college_split'
     166#args['xml_data'] = ''
     167#args['xml_data'] = xmltext   # info['xml_data']can be used instead
    166168info['args'] = args
     169
    167170return context.goto_interswitch_form(info=info)
Note: See TracChangeset for help on using the changeset viewer.