[5593] | 1 | ## Script (Python) "getInterswitchParams" |
---|
| 2 | ##bind container=container |
---|
| 3 | ##bind context=context |
---|
| 4 | ##bind namespace= |
---|
| 5 | ##bind script=script |
---|
| 6 | ##bind subpath=traverse_subpath |
---|
[5603] | 7 | ##parameters=paytype,student,payment_id,order_id,student_record |
---|
[5593] | 8 | ##title= |
---|
| 9 | ## |
---|
| 10 | # $Id: getInterswitchParams.py 3625 2008-08-17 07:47:00Z henrik $ |
---|
| 11 | |
---|
| 12 | |
---|
| 13 | test = "" |
---|
| 14 | d = {} |
---|
| 15 | d['payment_possible'] = True |
---|
| 16 | d['pay_ship_to'] = "Federal University of Technology Minna" |
---|
| 17 | |
---|
| 18 | d['site_id'] = '117' |
---|
| 19 | d['site_name'] = "futminna.waeup.org" |
---|
| 20 | d['currency_id'] = '566' |
---|
| 21 | d['type'] = 'online' |
---|
| 22 | d['status'] = 'started' |
---|
| 23 | d['surcharge'] = '300' |
---|
| 24 | if test == 'simulate': |
---|
| 25 | d['action'] = "%s/payments/%s/simulate_callback" % (student.absolute_url(),payment_id) #do not use simulate_callback |
---|
| 26 | elif test == 'test': |
---|
| 27 | d['action'] = "https://webpay.interswitchng.com/test_paydirect/webpay/pay.aspx" |
---|
| 28 | else: |
---|
| 29 | d['action'] = "https://webpay.interswitchng.com/paydirect/webpay/pay.aspx" |
---|
[5599] | 30 | |
---|
| 31 | |
---|
[5628] | 32 | if paytype in ('HOM','HOMH',): |
---|
[5593] | 33 | d['callback_function'] = 'interswitch_cb' |
---|
[5631] | 34 | d['pay_item_id'] = '11705' |
---|
[5593] | 35 | d['type_description'] = 'Hostel Maintenance Fee' |
---|
| 36 | d['pay_item_name'] = "FUT Minna %(type_description)s" % d |
---|
[5628] | 37 | if paytype == 'HOMH': |
---|
| 38 | d['amount'] = 15000 |
---|
| 39 | elif student_record.level in ('100','200','300','400','500') and student_record.faculty in ('EET','SET','AAT','ICT','EMT'): |
---|
[5606] | 40 | d['amount'] = 9000 |
---|
[5600] | 41 | else: |
---|
[5606] | 42 | d['amount'] = 7000 |
---|
[5593] | 43 | d['category'] = 'hostel_maintenance' |
---|
| 44 | d['item'] = paytype |
---|
[5599] | 45 | |
---|
| 46 | #Adding xml split data |
---|
| 47 | d['payment_params'] = 'college_split' |
---|
| 48 | xmldict = {} |
---|
[5603] | 49 | xmldict['detail_ref'] = order_id |
---|
[5599] | 50 | xmldict['department'] = student_record.department |
---|
| 51 | xmldict['faculty'] = student_record.faculty |
---|
[5606] | 52 | xmldict['fut_amount'] = "%d" % int(100*d['amount']) |
---|
[5599] | 53 | |
---|
| 54 | xmltext = """<payment_item_detail> |
---|
| 55 | <item_details detail_ref="%(detail_ref)s" college="Federal University of Technology Minna" department="%(department)s" faculty="%(faculty)s"> |
---|
| 56 | <item_detail item_id="1" item_name="Hostel Maintenance Fee" item_amt="%(fut_amount)s" bank_id="101" acct_num="0591301005175" /> |
---|
| 57 | </item_details> |
---|
| 58 | </payment_item_detail>""" % xmldict |
---|
| 59 | |
---|
[5601] | 60 | d['xml_data'] = """<input type="hidden" name="xml_data" value='%s' />""" % xmltext |
---|
| 61 | |
---|
[5599] | 62 | return d |
---|