source: WAeUP_SRP/trunk/skins/waeup_futminna/getInterswitchParams.py @ 5599

Last change on this file since 5599 was 5599, checked in by Henrik Bettermann, 14 years ago

Send xml split data.

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