source: main/kofacustom.dspg/trunk/src/kofacustom/dspg/interswitch/browser.py @ 16948

Last change on this file since 16948 was 16815, checked in by Henrik Bettermann, 3 years ago

Fix bank code.

  • Property svn:keywords set to Id
File size: 43.4 KB
RevLine 
[10765]1## $Id: browser.py 16815 2022-02-17 06:53:39Z henrik $
2##
3## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann
4## This program is free software; you can redistribute it and/or modify
5## it under the terms of the GNU General Public License as published by
6## the Free Software Foundation; either version 2 of the License, or
7## (at your option) any later version.
8##
9## This program is distributed in the hope that it will be useful,
10## but WITHOUT ANY WARRANTY; without even the implied warranty of
11## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12## GNU General Public License for more details.
13##
14## You should have received a copy of the GNU General Public License
15## along with this program; if not, write to the Free Software
16## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17##
18import httplib
[12479]19import hashlib
[10765]20import grok
[16418]21from waeup.kofa.interfaces import CLEARED, RETURNING
[10765]22from kofacustom.nigeria.interswitch.browser import (
23    InterswitchPaymentRequestWebservicePageApplicant,
[11638]24    InterswitchPaymentRequestWebservicePageStudent,
[13587]25    InterswitchPaymentVerifyWebservicePageApplicant,
26    InterswitchPaymentVerifyWebservicePageStudent,
[11638]27    InterswitchPageStudent, InterswitchPageApplicant,
[10765]28    )
[14716]29from kofacustom.dspg.students.interfaces import ICustomStudentOnlinePayment
30from kofacustom.dspg.applicants.interfaces import ICustomApplicantOnlinePayment
31from kofacustom.dspg.interfaces import MessageFactory as _
[16760]32from kofacustom.dspg.students.utils import (
33    MICROSOFT_FEE, DEVELOP_FEE, TECH_FEE)
[10765]34
[14726]35PRODUCT_ID = '7269' # must be provided by Interswitch
[14749]36SITE_NAME = 'dspg.waeup.org'
[14879]37PROVIDER_ACCT = '2028964403'
38PROVIDER_BANK_ID = '8'
[15248]39PROVIDER_ITEM_NAME = 'WAEAC'
[14722]40INSTITUTION_NAME = 'Delta State Polytechnic Ogwashi-Uku'
[10765]41CURRENCY = '566'
[14727]42GATEWAY_AMT = 250.0
[15021]43MAC = 'D43ED93B7A307B152C7111D04E1F384428057CD1E75428D3A4C5631C28ACB9C8C822A88CA76DEDC5F9A520CF4BFDB2824FF8B207AAFC667DF3CBB13685B66627'
[10765]44
[14726]45POST_ACTION = 'https://webpay.interswitchng.com/paydirect/pay'
46#POST_ACTION = 'https://sandbox.interswitchng.com/webpay/pay'
47HOST = 'webpay.interswitchng.com'
48#HOST = 'sandbox.interswitchng.com'
49URL = '/paydirect/api/v1/gettransaction.json'
50#URL = '/webpay/api/v1/gettransaction.json'
[14276]51
[12479]52httplib.HTTPSConnection.debuglevel = 0
53HTTPS = True
[10765]54
[14859]55SPECIAL_PAYMENT_PARAMS = {
[14864]56
[16411]57    'carryover1': ('101', 500.0, '1015220292', '117'),
58    'carryover4': ('101', 500.0, '1015220292', '117'),
59    'carryover5': ('101', 500.0, '1015220292', '117'),
60    'carryover6': ('101', 500.0, '1015220292', '117'),
61    'carryover7': ('101', 500.0, '1015220292', '117'),
62    'carryover8': ('101', 500.0, '1015220292', '117'),
63    'carryover9': ('101', 500.0, '1015220292', '117'),
64    'carryover10': ('101', 500.0, '1015220292', '117'),
65    'carryover11': ('101', 500.0, '1015220292', '117'),
66    'carryover12': ('101', 500.0, '1015220292', '117'),
67    'balance': ('101', 500.0, '1015220292', '117'),
[14864]68
[15959]69    'certificate': ('111', 500.0, '1012808851', '117'),
70    'state_result': ('112', 500.0, '1012808851', '117'),
71    'transcript_local': ('113', 500.0, '1012808851', '117'),
72    'transcript_foreign': ('114', 500.0, '1012808851', '117'),
73    'ver_result': ('115', 500.0, '1012808851', '117'),
74    'change_course': ('116', 500.0, '1012808851', '117'),
75    'change_inst': ('117', 500.0, '1012808851', '117'),
76    'jamb_reject': ('118', 500.0, '1012808851', '117'),
77    'cert_of_cert': ('119', 500.0, '1012808851', '117'),
78    'ref_let': ('120', 500.0, '1012808851', '117'),
79    'proc_cert': ('121', 500.0, '1012808851', '117'),
80    'loss_idcard': ('122', 9.0, '1012808851', '117'),
81    'loss_examcard': ('123', 4.5, '1012808851', '117'),
82    'loss_result': ('124', 500.0, '1012808851', '117'),
83    'loss_receipt': ('125', 500.0, '1012808851', '117'),
84    'loss_clearance': ('126', 500.0, '1012808851', '117'),
85    'conv_brochure': ('127', 500.0, '1012808851', '117'),
86    'hnd_certificate': ('128', 500.0, '1012808851', '117'),
87    'hnd_state_result': ('129', 500.0, '1012808851', '117'),
88    'hnd_transcript_local': ('130', 500.0, '1012808851', '117'),
89    'hnd_transcript_foreign': ('131', 500.0, '1012808851', '117'),
90    'staff_loss_idcard': ('132', 9.0, '1012808851', '117'),
91    'hnd_conv_brochure': ('133', 500.0, '1012808851', '117'),
92    'pgd_state_result': ('134', 500.0, '1012808851', '117'),
93    'pgd_conv_brochure': ('135', 500.0, '1012808851', '117'),
94    'pgd_certificate': ('136', 500.0, '1012808851', '117'),
95    'log_book': ('137', 4.5, '1012808851', '117'),
96    'pgd_transcript_foreign': ('138', 500.0, '1012808851', '117'),
97    'pgd_transcript_local': ('139', 500.0, '1012808851', '117'),
98    'jamb_regularization': ('140', 500.0, '1012808851', '117'),
99    'utme_registration': ('142', 9.0, '1012808851', '117'),
100    'utme_cbt': ('143', 9.0, '1012808851', '117'),
101    'nysc_id_card': ('144', 9.0, '1012808851', '117'),
102    'ijmb_result': ('147', 500.0, '1012808851', '117'),
103    'conv': ('151', 500.0, '1012808851', '117'),
[14859]104    }
105
[14862]106
[14875]107# Not yet readily configured. Bank account numbers are
[14862]108# contradictory. pay_item_ids are not yet assigned.
109
[11638]110class CustomInterswitchPageStudent(InterswitchPageStudent):
[10765]111    """ View which sends a POST request to the Interswitch
112    CollegePAY payment gateway.
113    """
114    grok.context(ICustomStudentOnlinePayment)
115    action = POST_ACTION
116    site_name = SITE_NAME
117    currency = CURRENCY
118    product_id = PRODUCT_ID
[15021]119    mac = MAC
[14875]120    pay_item_id = '000'
[10765]121
122    def update(self):
[12979]123        error = self.init_update()
124        if error:
125            self.flash(error, type='danger')
126            self.redirect(self.url(self.context, '@@index'))
127            return
[15764]128        self.context.r_company = u'interswitch'
[11647]129        student = self.student
130        xmldict = self.xmldict
[10765]131        # Provider data
132        xmldict['detail_ref'] = self.context.p_id
133        xmldict['provider_acct'] = PROVIDER_ACCT
134        xmldict['provider_bank_id'] = PROVIDER_BANK_ID
135        xmldict['provider_item_name'] = PROVIDER_ITEM_NAME
136        # Institution data
[14875]137        xmldict['institution_acct'] = '00000000'
138        xmldict['institution_bank_id'] = '00'
[10765]139        xmldict['institution_amt'] = '0.0'
[14875]140        provider_amt = 0.0
[14961]141        tech_fee = 0.0
[16418]142        microsoft_fee = 0.0
[16760]143        develop_fee = 0.0
[14862]144        if self.context.p_category.startswith('schoolfee'):
145            self.pay_item_id = '102'
[15764]146            if self.context.p_item != 'Balance':
147                provider_amt = 2800.0
[16760]148                tech_fee = TECH_FEE(student)
149                develop_fee = DEVELOP_FEE(student)
150                microsoft_fee = MICROSOFT_FEE(student)
[14889]151            if student.faccode == 'SPAT':
[16506]152                xmldict['institution_acct'] = '1556004203'
153                xmldict['institution_bank_id'] = '388'
[14889]154            elif student.current_mode in ('nd_ft', 'hnd_ft'):
[16356]155                xmldict['institution_acct'] = '2004145840'
156                xmldict['institution_bank_id'] = '8'
[14862]157        elif self.context.p_category == 'clearance':
158            self.pay_item_id = '103'
[15764]159            if self.context.p_item != 'Balance':
160                provider_amt = 500.0
[14889]161            if student.faccode == 'SPAT':
[15227]162                xmldict['institution_acct'] = '1015220292'
[14875]163                xmldict['institution_bank_id'] = '117'
[15179]164            elif student.current_mode in ('nd_ft', 'hnd_ft'):
[15608]165                xmldict['institution_acct'] = '0072223654'
166                xmldict['institution_bank_id'] = '121'
[14942]167        elif self.context.p_category == 'gown':
168            self.pay_item_id = '102' # We use school fee item id.
169            xmldict['institution_acct'] = '2006612782'
170            xmldict['institution_bank_id'] = '8'
[15021]171        elif self.context.p_category == 'sports':
172            self.pay_item_id = '110'
173            xmldict['institution_acct'] = '6060300688'
174            xmldict['institution_bank_id'] = '51'
175        elif self.context.p_category == 'siwes':
176            self.pay_item_id = '111'
[15466]177            xmldict['institution_acct'] = '0080527351'
178            xmldict['institution_bank_id'] = '11'
[15022]179        elif self.context.p_category == 'eed_1':
[15021]180            self.pay_item_id = '112'
181            xmldict['institution_acct'] = '0039782431'
182            xmldict['institution_bank_id'] = '11'
[15022]183        elif self.context.p_category == 'eed_2':
184            self.pay_item_id = '116'
185            xmldict['institution_acct'] = '0039782431'
186            xmldict['institution_bank_id'] = '11'
[16323]187        elif self.context.p_category == 'eed_extra':
[16335]188            self.pay_item_id = '157'
[16323]189            xmldict['institution_acct'] = '0039782431'
190            xmldict['institution_bank_id'] = '11'
[15022]191        elif self.context.p_category == 'olevel_results_1':
[15021]192            self.pay_item_id = '113'
193            xmldict['institution_acct'] = '2015327204'
194            xmldict['institution_bank_id'] = '8'
[15022]195        elif self.context.p_category == 'olevel_results_2':
196            self.pay_item_id = '115'
197            xmldict['institution_acct'] = '2015327204'
198            xmldict['institution_bank_id'] = '8'
[16309]199        elif self.context.p_category == 'gns_1':
200            self.pay_item_id = '154'
201            xmldict['institution_acct'] = '2017447652'
202            xmldict['institution_bank_id'] = '8'
203        elif self.context.p_category == 'gns_2':
204            self.pay_item_id = '155'
205            xmldict['institution_acct'] = '2017447652'
206            xmldict['institution_bank_id'] = '8'
[16750]207        #elif self.context.p_category == 'hostel_maintenance':
208        #    if self.context.p_item != 'Balance':
209        #        provider_amt = 500.0
210        #    self.pay_item_id = '117'
211        #    xmldict['institution_acct'] = '1012808851'
212        #    xmldict['institution_bank_id'] = '117'
[15350]213        elif self.context.p_category == 'lsfp_penalty':
214            self.pay_item_id = '102'
[15959]215            xmldict['institution_acct'] = '1012808851'
[15350]216            xmldict['institution_bank_id'] = '117'
[16323]217        elif self.context.p_category == 'eng_1':
218            self.pay_item_id = '118'
219            xmldict['institution_acct'] = '2024473077'
220            xmldict['institution_bank_id'] = '8'
221        elif self.context.p_category == 'eng_2':
222            self.pay_item_id = '119'
223            xmldict['institution_acct'] = '2024473077'
224            xmldict['institution_bank_id'] = '8'
225        elif self.context.p_category == 'bfn':
226            self.pay_item_id = '125'
227            xmldict['institution_acct'] = '0048039049'
228            xmldict['institution_bank_id'] = '11'
229        elif self.context.p_category == 'facilities':
[16336]230            self.pay_item_id = '156'
[16323]231            xmldict['institution_acct'] = '1012808851'
232            xmldict['institution_bank_id'] = '117'
[14862]233        elif self.context.p_category in SPECIAL_PAYMENT_PARAMS.keys():
234            self.pay_item_id = SPECIAL_PAYMENT_PARAMS[self.context.p_category][0]
235            provider_amt = SPECIAL_PAYMENT_PARAMS[self.context.p_category][1]
236            xmldict['institution_acct'] = SPECIAL_PAYMENT_PARAMS[self.context.p_category][2]
237            xmldict['institution_bank_id'] = SPECIAL_PAYMENT_PARAMS[self.context.p_category][3]
[10765]238        xmldict['provider_amt'] = 100 * provider_amt
[14961]239        xmldict['tech_fee'] = 100 * tech_fee
[16760]240        xmldict['develop_fee'] = 100 * develop_fee
[16429]241        xmldict['microsoft_fee'] = 100 * microsoft_fee
[12511]242        xmldict['institution_item_name'] = self.context.category
[10765]243        xmldict['institution_name'] = INSTITUTION_NAME
[14889]244        xmldict['institution_amt'] = institution_amt = 100 * (
[16760]245            self.context.amount_auth - provider_amt - tech_fee -
246            develop_fee - microsoft_fee - GATEWAY_AMT)
[14961]247
[10765]248        if provider_amt == 0:
249            xmltext = """<payment_item_detail>
250<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
251<item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
252</item_details>
253</payment_item_detail>""" % xmldict
[16760]254        elif tech_fee == 0:   # implies develop_fee == 0
[14961]255            xmltext = """<payment_item_detail>
256<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
257<item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
258<item_detail item_id="2" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />
259</item_details>
260</payment_item_detail>""" % xmldict
[16418]261        elif microsoft_fee == 0:
262            xmltext = """<payment_item_detail>
263<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
264<item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
265<item_detail item_id="2" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />
266<item_detail item_id="3" item_name="Technology Fee" item_amt="%(tech_fee)d" bank_id="10" acct_num="0032256360" />
[16815]267<item_detail item_id="4" item_name="Developmental Levy" item_amt="%(develop_fee)d" bank_id="117" acct_num="1012963301" />
[16418]268</item_details>
269</payment_item_detail>""" % xmldict
[10765]270        else:
271            xmltext = """<payment_item_detail>
272<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
273<item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
274<item_detail item_id="2" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />
[15323]275<item_detail item_id="3" item_name="Technology Fee" item_amt="%(tech_fee)d" bank_id="10" acct_num="0032256360" />
[16781]276<item_detail item_id="4" item_name="Developmental Levy" item_amt="%(develop_fee)d" bank_id="117" acct_num="1012963301" />
277<item_detail item_id="5" item_name="Microsoft Academy Fee" item_amt="%(microsoft_fee)d" bank_id="51" acct_num="4011256518" />
[10765]278</item_details>
279</payment_item_detail>""" % xmldict
[14889]280
281        # isouaba: All certificates in SPAT are part time thus any payments
282        # coming from those certificates (Application, Acceptance, school fees
283        # etc) 40% should be split to keystone account.
[15311]284        # abraham: Please, kindly exclude the 40% going to Keystone bank for school of part-
285        # time (SPAT) O'level Results Verification payment.
286        if student.faccode == 'SPAT' and not self.context.p_category.startswith('olevel_results'):
[14889]287            xmldict['institution_amt_2'] = 0.4 * institution_amt
288            xmldict['institution_amt_1'] = 0.6 * institution_amt
289            if provider_amt == 0:
290                xmltext = """<payment_item_detail>
291<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
292<item_detail item_id="1" item_name="%(institution_item_name)s 1" item_amt="%(institution_amt_1)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
[15707]293<item_detail item_id="2" item_name="%(institution_item_name)s 2" item_amt="%(institution_amt_2)d" bank_id="8" acct_num="2034761924" />
[14889]294</item_details>
295</payment_item_detail>""" % xmldict
[16760]296            elif tech_fee == 0: # implies develop_fee == 0
[14964]297                xmltext = """<payment_item_detail>
298<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
299<item_detail item_id="1" item_name="%(institution_item_name)s 1" item_amt="%(institution_amt_1)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
[15707]300<item_detail item_id="2" item_name="%(institution_item_name)s 2" item_amt="%(institution_amt_2)d" bank_id="8" acct_num="2034761924" />
[14964]301<item_detail item_id="3" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />
302</item_details>
303</payment_item_detail>""" % xmldict
[16760]304            elif microsoft_fee == 0:
305                xmltext = """<payment_item_detail>
306<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
307<item_detail item_id="1" item_name="%(institution_item_name)s 1" item_amt="%(institution_amt_1)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
308<item_detail item_id="2" item_name="%(institution_item_name)s 2" item_amt="%(institution_amt_2)d" bank_id="8" acct_num="2034761924" />
309<item_detail item_id="3" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />
310<item_detail item_id="4" item_name="Technology Fee" item_amt="%(tech_fee)d" bank_id="10" acct_num="0032256360" />
[16815]311<item_detail item_id="5" item_name="Developmental Levy" item_amt="%(develop_fee)d" bank_id="117" acct_num="1012963301" />
[16760]312</item_details>
313</payment_item_detail>""" % xmldict
[14889]314            else:
315                xmltext = """<payment_item_detail>
316<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
317<item_detail item_id="1" item_name="%(institution_item_name)s 1" item_amt="%(institution_amt_1)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
[15707]318<item_detail item_id="2" item_name="%(institution_item_name)s 2" item_amt="%(institution_amt_2)d" bank_id="8" acct_num="2034761924" />
[14889]319<item_detail item_id="3" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />
[15323]320<item_detail item_id="4" item_name="Technology Fee" item_amt="%(tech_fee)d" bank_id="10" acct_num="0032256360" />
[16781]321<item_detail item_id="5" item_name="Developmental Levy" item_amt="%(develop_fee)d" bank_id="117" acct_num="1012963301" />
322<item_detail item_id="6" item_name="Microsoft Academy Fee" item_amt="%(microsoft_fee)d" bank_id="51" acct_num="4011256518" />
[14889]323</item_details>
324</payment_item_detail>""" % xmldict
[15255]325
326
327        # Some payments are treated completely separately. The following lines
[14921]328        # override the configuration above.
[15255]329
[14921]330        if self.context.p_category == 'dep_sug':
331            self.pay_item_id = '102' # We use school fee item id
332            # amount_auth is being ignored. However, the sum of all split payments
333            # must coincide with the amount_auth configured in students/utils.py
[16762]334            xmldict['amt1'] = 100 * 2000
335            xmldict['amt2'] = 100 * 1000
[14921]336            xmldict['amt3'] = 100 * 900
[16762]337            xmldict['amt4'] = 100 * 1000
[14938]338
[14940]339            xmltext = """<payment_item_detail>
[14921]340<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
341<item_detail item_id="1" item_name="SUG" item_amt="%(amt1)d" bank_id="11" acct_num="0038079930" />
342<item_detail item_id="2" item_name="Students Welfare" item_amt="%(amt2)d" bank_id="11" acct_num="0037892949" />
343<item_detail item_id="3" item_name="Anti-Cult Book" item_amt="%(amt3)d" bank_id="11" acct_num="0037892949" />
[14938]344<item_detail item_id="4" item_name="NADESSTU" item_amt="%(amt4)d" bank_id="11" acct_num="0036375968" />
[14921]345</item_details>
346</payment_item_detail>""" % xmldict
[14940]347
[15255]348        if self.context.p_category == 'sbs_1':
349            self.pay_item_id = '120'
350            # amount_auth is being ignored. However, the sum of all split payments
351            # must coincide with the amount_auth configured in students/utils.py
[16794]352            xmldict['amt1'] = 100 * 1000
[15255]353            xmldict['amt2'] = 100 * 1000
[16794]354            xmldict['amt3'] = 100 * 1000
[15255]355
356            xmltext = """<payment_item_detail>
357<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
358<item_detail item_id="1" item_name="SBS Dues I" item_amt="%(amt1)d" bank_id="11" acct_num="0010772626" />
359<item_detail item_id="2" item_name="Journal fee" item_amt="%(amt2)d" bank_id="11" acct_num="0010772626" />
360<item_detail item_id="3" item_name="ABSOBS" item_amt="%(amt3)d" bank_id="8" acct_num="2008185712" />
361</item_details>
362</payment_item_detail>""" % xmldict
363
364        if self.context.p_category == 'sbs_2':
365            self.pay_item_id = '123'
366            # amount_auth is being ignored. However, the sum of all split payments
367            # must coincide with the amount_auth configured in students/utils.py
[16794]368            xmldict['amt1'] = 100 * 1000
369            xmldict['amt2'] = 100 * 1000
[15255]370            xmltext = """<payment_item_detail>
371<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
372<item_detail item_id="1" item_name="SBS Dues II" item_amt="%(amt1)d" bank_id="11" acct_num="0010772626" />
373<item_detail item_id="2" item_name="ABSOBS" item_amt="%(amt2)d" bank_id="8" acct_num="2008185712" />
374</item_details>
375</payment_item_detail>""" % xmldict
376
377        if self.context.p_category == 'mkt':
378            self.pay_item_id = '127'
379            # amount_auth is being ignored. However, the sum of all split payments
380            # must coincide with the amount_auth configured in students/utils.py
[16794]381            xmldict['amt1'] = 100 * 1000
382            xmldict['amt2'] = 100 * 1000
[15255]383            xmltext = """<payment_item_detail>
384<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
385<item_detail item_id="1" item_name="MKT Dues" item_amt="%(amt1)d" bank_id="11" acct_num="0048297823" />
386<item_detail item_id="2" item_name="NAMS" item_amt="%(amt2)d" bank_id="8" acct_num="2032309812" />
387</item_details>
388</payment_item_detail>""" % xmldict
389
390        if self.context.p_category == 'mcn':
391            self.pay_item_id = '129'
392            # amount_auth is being ignored. However, the sum of all split payments
393            # must coincide with the amount_auth configured in students/utils.py
[16794]394            xmldict['amt1'] = 100 * 1000
395            xmldict['amt2'] = 100 * 1000
[16799]396            xmldict['amt3'] = 100 * 500
[15255]397            xmltext = """<payment_item_detail>
398<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
399<item_detail item_id="1" item_name="MCN Dues" item_amt="%(amt1)d" bank_id="11" acct_num="0010789213" />
400<item_detail item_id="2" item_name="AMCOS" item_amt="%(amt2)d" bank_id="8" acct_num="3020253234" />
[16799]401<item_detail item_id="3" item_name="Lab. Maintenance Levy" item_amt="%(amt3)d" bank_id="11" acct_num="0040467901" />
[15255]402</item_details>
403</payment_item_detail>""" % xmldict
404
405        if self.context.p_category == 'otm':
406            self.pay_item_id = '131'
407            # amount_auth is being ignored. However, the sum of all split payments
408            # must coincide with the amount_auth configured in students/utils.py
[16794]409            xmldict['amt1'] = 100 * 1000
410            xmldict['amt2'] = 100 * 1000
[15255]411            xmltext = """<payment_item_detail>
412<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
413<item_detail item_id="1" item_name="OTM Dues" item_amt="%(amt1)d" bank_id="8" acct_num="3068446702" />
414<item_detail item_id="2" item_name="NAOTM" item_amt="%(amt2)d" bank_id="11" acct_num="0036652027" />
415</item_details>
416</payment_item_detail>""" % xmldict
417
418        if self.context.p_category == 'acct':
419            self.pay_item_id = '134'
420            # amount_auth is being ignored. However, the sum of all split payments
421            # must coincide with the amount_auth configured in students/utils.py
422            xmldict['amt1'] = 100 * 3000
[16794]423            xmldict['amt2'] = 100 * 1000
424            xmldict['amt3'] = 100 * 1000
[15255]425            xmltext = """<payment_item_detail>
426<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
427<item_detail item_id="1" item_name="Profession Accreditation" item_amt="%(amt1)d" bank_id="11" acct_num="0040285084" />
428<item_detail item_id="2" item_name="ACCT Dues" item_amt="%(amt2)d" bank_id="11" acct_num="0036184955" />
[15298]429<item_detail item_id="3" item_name="NAPAS" item_amt="%(amt3)d" bank_id="8" acct_num="2008498661" />
[15255]430</item_details>
431</payment_item_detail>""" % xmldict
432
433        if self.context.p_category == 'bam':
434            self.pay_item_id = '136'
435            # amount_auth is being ignored. However, the sum of all split payments
436            # must coincide with the amount_auth configured in students/utils.py
[16794]437            xmldict['amt1'] = 100 * 1000
438            xmldict['amt2'] = 100 * 1000
[15255]439            xmltext = """<payment_item_detail>
440<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
441<item_detail item_id="1" item_name="BAM Dues" item_amt="%(amt1)d" bank_id="11" acct_num="0010788058" />
442<item_detail item_id="2" item_name="NABAS" item_amt="%(amt2)d" bank_id="8" acct_num="2006936848" />
443</item_details>
444</payment_item_detail>""" % xmldict
445
446        if self.context.p_category == 'pom':
447            self.pay_item_id = '138'
448            # amount_auth is being ignored. However, the sum of all split payments
449            # must coincide with the amount_auth configured in students/utils.py
[16794]450            xmldict['amt1'] = 100 * 1000
451            xmldict['amt2'] = 100 * 1000
[15255]452            xmltext = """<payment_item_detail>
453<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
454<item_detail item_id="1" item_name="POM Dues" item_amt="%(amt1)d" bank_id="11" acct_num="0096851444" />
455<item_detail item_id="2" item_name="NAMS" item_amt="%(amt2)d" bank_id="8" acct_num="2033423003" />
456</item_details>
457</payment_item_detail>""" % xmldict
458
459        if self.context.p_category == 'hrm':
460            self.pay_item_id = '140'
461            # amount_auth is being ignored. However, the sum of all split payments
462            # must coincide with the amount_auth configured in students/utils.py
[16794]463            xmldict['amt1'] = 100 * 1000
464            xmldict['amt2'] = 100 * 1000
[15255]465            xmltext = """<payment_item_detail>
466<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
467<item_detail item_id="1" item_name="HRM Dues" item_amt="%(amt1)d" bank_id="11" acct_num="0096858546" />
468<item_detail item_id="2" item_name="NAMS" item_amt="%(amt2)d" bank_id="8" acct_num="2033423003" />
469</item_details>
470</payment_item_detail>""" % xmldict
471
[15603]472        if self.context.p_category == 'ndgrad':
473            self.pay_item_id = '152'
[15571]474            # amount_auth is being ignored. However, the sum of all split payments
475            # must coincide with the amount_auth configured in students/utils.py
476            xmldict['amt1'] = 100 * 3000
477            xmldict['amt2'] = 100 * 5000
478            xmldict['amt3'] = 100 * 1000
479            xmldict['amt4'] = 100 * 3500
480            xmltext = """<payment_item_detail>
481<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
[15959]482<item_detail item_id="1" item_name="Collection of Results" item_amt="%(amt1)d" bank_id="117" acct_num="1012808851" />
483<item_detail item_id="2" item_name="Collection of Certificate" item_amt="%(amt2)d" bank_id="117" acct_num="1012808851" />
[15571]484<item_detail item_id="3" item_name="Alumni" item_amt="%(amt3)d" bank_id="8" acct_num="2011810346" />
[15604]485<item_detail item_id="4" item_name="Convocation" item_amt="%(amt4)d" bank_id="8" acct_num="2006612782" />
[15571]486</item_details>
487</payment_item_detail>""" % xmldict
[15255]488
[15603]489        if self.context.p_category == 'hndgrad':
490            self.pay_item_id = '153'
[15571]491            # amount_auth is being ignored. However, the sum of all split payments
492            # must coincide with the amount_auth configured in students/utils.py
[15603]493            xmldict['amt1'] = 100 * 5000
[15571]494            xmldict['amt2'] = 100 * 7500
495            xmldict['amt3'] = 100 * 1000
496            xmldict['amt4'] = 100 * 3500
497            xmltext = """<payment_item_detail>
498<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
[15959]499<item_detail item_id="1" item_name="Collection of Results" item_amt="%(amt1)d" bank_id="117" acct_num="1012808851" />
500<item_detail item_id="2" item_name="Collection of Certificate" item_amt="%(amt2)d" bank_id="117" acct_num="1012808851" />
[15571]501<item_detail item_id="3" item_name="Alumni" item_amt="%(amt3)d" bank_id="8" acct_num="2011810346" />
[15604]502<item_detail item_id="4" item_name="Convocation" item_amt="%(amt4)d" bank_id="8" acct_num="2006612782" />
[15571]503</item_details>
504</payment_item_detail>""" % xmldict
505
[16367]506        if self.context.p_category == 'sas_1':
507            self.pay_item_id = '158'
508            # amount_auth is being ignored. However, the sum of all split payments
509            # must coincide with the amount_auth configured in students/utils.py
[16794]510            xmldict['amt1'] = 100 * 1000
[16367]511            xmldict['amt2'] = 100 * 500
[16794]512            xmldict['amt3'] = 100 * 1000
[16367]513            xmltext = """<payment_item_detail>
514<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
515<item_detail item_id="1" item_name="SAS Dues" item_amt="%(amt1)d" bank_id="11" acct_num="0038956822" />
516<item_detail item_id="2" item_name="Handbook Fee" item_amt="%(amt2)d" bank_id="11" acct_num="0010772626" />
517<item_detail item_id="3" item_name="Association Due" item_amt="%(amt3)d" bank_id="8" acct_num="3069091989" />
518</item_details>
519</payment_item_detail>""" % xmldict
520
521        if self.context.p_category == 'sas_2':
522            self.pay_item_id = '159'
523            # amount_auth is being ignored. However, the sum of all split payments
524            # must coincide with the amount_auth configured in students/utils.py
[16794]525            xmldict['amt1'] = 100 * 1000
526            xmldict['amt2'] = 100 * 1000
[16367]527            xmltext = """<payment_item_detail>
528<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
529<item_detail item_id="1" item_name="SAS Dues" item_amt="%(amt1)d" bank_id="11" acct_num="0038956822" />
530<item_detail item_id="2" item_name="Association Due" item_amt="%(amt2)d" bank_id="8" acct_num="3069091989" />
531</item_details>
532</payment_item_detail>""" % xmldict
533
534        if self.context.p_category == 'com':
535            self.pay_item_id = '160'
536            # amount_auth is being ignored. However, the sum of all split payments
537            # must coincide with the amount_auth configured in students/utils.py
[16794]538            xmldict['amt1'] = 100 * 1000
539            xmldict['amt2'] = 100 * 1000
[16367]540            xmltext = """<payment_item_detail>
541<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
542<item_detail item_id="1" item_name="Departmental Due" item_amt="%(amt1)d" bank_id="11" acct_num="0010787594" />
543<item_detail item_id="2" item_name="NACOS " item_amt="%(amt2)d" bank_id="8" acct_num="3047146881" />
544</item_details>
545</payment_item_detail>""" % xmldict
546
547        if self.context.p_category == 'sta':
548            self.pay_item_id = '161'
549            # amount_auth is being ignored. However, the sum of all split payments
550            # must coincide with the amount_auth configured in students/utils.py
[16794]551            xmldict['amt1'] = 100 * 1000
552            xmldict['amt2'] = 100 * 1000
[16367]553            xmltext = """<payment_item_detail>
554<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
555<item_detail item_id="1" item_name="Departmental Due" item_amt="%(amt1)d" bank_id="11" acct_num="0048794281" />
556<item_detail item_id="2" item_name="NASS " item_amt="%(amt2)d" bank_id="8" acct_num="203000173" />
557</item_details>
558</payment_item_detail>""" % xmldict
559
560        if self.context.p_category == 'slt_1':
561            self.pay_item_id = '162'
562            # amount_auth is being ignored. However, the sum of all split payments
563            # must coincide with the amount_auth configured in students/utils.py
[16794]564            xmldict['amt1'] = 100 * 1000
565            xmldict['amt2'] = 100 * 1000
[16367]566            xmldict['amt3'] = 100 * 3000
567            xmldict['amt4'] = 100 * 500
568            xmldict['amt5'] = 100 * 3000
569            xmldict['amt6'] = 100 * 2000
570            xmltext = """<payment_item_detail>
571<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
572<item_detail item_id="1" item_name="Departmental Due" item_amt="%(amt1)d" bank_id="8" acct_num="2033492885" />
573<item_detail item_id="2" item_name="Association Due" item_amt="%(amt2)d" bank_id="11" acct_num="0115800071" />
574<item_detail item_id="3" item_name="Professional Due" item_amt="%(amt3)d" bank_id="8" acct_num="2033492885" />
575<item_detail item_id="4" item_name="Prospectus" item_amt="%(amt4)d" bank_id="8" acct_num="2033492885" />
576<item_detail item_id="5" item_name="Practical Manual" item_amt="%(amt4)d" bank_id="8" acct_num="2033492885" />
577<item_detail item_id="6" item_name="Lab. Coat" item_amt="%(amt4)d" bank_id="8" acct_num="2033492885" />
578</item_details>
579</payment_item_detail>""" % xmldict
580
581        if self.context.p_category == 'slt_2':
582            self.pay_item_id = '163'
583            # amount_auth is being ignored. However, the sum of all split payments
584            # must coincide with the amount_auth configured in students/utils.py
[16794]585            xmldict['amt1'] = 100 * 1000
586            xmldict['amt2'] = 100 * 1000
[16367]587            xmldict['amt3'] = 100 * 3000
588            xmltext = """<payment_item_detail>
589<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
590<item_detail item_id="1" item_name="Departmental Due" item_amt="%(amt1)d" bank_id="8" acct_num="2033492885" />
591<item_detail item_id="2" item_name="Association Due" item_amt="%(amt2)d" bank_id="11" acct_num="0115800071" />
592<item_detail item_id="3" item_name="Practical Manual" item_amt="%(amt3)d" bank_id="8" acct_num="2033492885" />
593</item_details>
594</payment_item_detail>""" % xmldict
595
596        if self.context.p_category == 'lis':
597            self.pay_item_id = '164'
598            # amount_auth is being ignored. However, the sum of all split payments
599            # must coincide with the amount_auth configured in students/utils.py
[16794]600            xmldict['amt1'] = 100 * 1000
601            xmldict['amt2'] = 100 * 1000
[16367]602            xmltext = """<payment_item_detail>
603<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
604<item_detail item_id="1" item_name="Departmental Due" item_amt="%(amt1)d" bank_id="" acct_num="0068264131" />
605<item_detail item_id="2" item_name="Association Due" item_amt="%(amt2)d" bank_id="" acct_num="" />
606</item_details>
607</payment_item_detail>""" % xmldict
608
609        if self.context.p_category == 'htm':
610            self.pay_item_id = '165'
611            # amount_auth is being ignored. However, the sum of all split payments
612            # must coincide with the amount_auth configured in students/utils.py
[16794]613            xmldict['amt1'] = 100 * 1000
614            xmldict['amt2'] = 100 * 1000
[16367]615            xmltext = """<payment_item_detail>
616<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
617<item_detail item_id="1" item_name="Departmental Due" item_amt="%(amt1)d" bank_id="" acct_num="0068264131" />
618<item_detail item_id="2" item_name="Association Due" item_amt="%(amt2)d" bank_id="" acct_num="" />
619</item_details>
620</payment_item_detail>""" % xmldict
621
[16725]622        if self.context.p_category == 'pa':
623            self.pay_item_id = '166'
624            # amount_auth is being ignored. However, the sum of all split payments
625            # must coincide with the amount_auth configured in students/utils.py
[16794]626            xmldict['amt1'] = 100 * 1000
627            xmldict['amt2'] = 100 * 1000
[16725]628            xmltext = """<payment_item_detail>
629<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
630<item_detail item_id="1" item_name="PAD" item_amt="%(amt1)d" bank_id="11" acct_num="0160125880" />
631<item_detail item_id="2" item_name="NAPAS" item_amt="%(amt2)d" bank_id="11" acct_num="0164863395" />
632</item_details>
633</payment_item_detail>""" % xmldict
[16367]634
[16750]635        if self.context.p_category == 'hostel_maintenance':
[16753]636            provider_amt = 500.0
637            hostel_due = 2000
[16750]638            self.pay_item_id = '117'
639            xmldict['institution_acct'] = '1012808851'
640            xmldict['institution_bank_id'] = '117'
[16753]641            xmldict['provider_amt'] = 100 * provider_amt
642            xmldict['hostel_due'] = 100 * hostel_due
643            xmldict['institution_amt'] = institution_amt = 100 * (
644                self.context.amount_auth - provider_amt - hostel_due - GATEWAY_AMT)
[16750]645            xmltext = """<payment_item_detail>
646<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
647<item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
648<item_detail item_id="2" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />
[16753]649<item_detail item_id="3" item_name="Hostel Due" item_amt="%(hostel_due)d" bank_id="11" acct_num="0170897506" />
[16750]650</item_details>
651</payment_item_detail>""" % xmldict
[16725]652
[16750]653
[10765]654        self.xml_data = """<input type="hidden" name="xml_data" value='%s'  />""" % xmltext
655        self.context.provider_amt = provider_amt
656        self.context.gateway_amt = GATEWAY_AMT
[16725]657        self.context.net_amt = self.context.amount_auth - GATEWAY_AMT
[15765]658        self.amount_auth = int(100 * self.context.amount_auth)
[12479]659        hashargs = (
660            self.context.p_id +
661            PRODUCT_ID +
662            self.pay_item_id +
663            str(int(self.amount_auth)) +
664            self.site_redirect_url +
665            self.mac)
666        self.hashvalue = hashlib.sha512(hashargs).hexdigest()
[10765]667        return
668
[11638]669class CustomInterswitchPageApplicant(InterswitchPageApplicant):
[10765]670    """ View which sends a POST request to the Interswitch
671    CollegePAY payment gateway.
672    """
673    grok.context(ICustomApplicantOnlinePayment)
674    action = POST_ACTION
675    site_name = SITE_NAME
676    currency = CURRENCY
[14729]677    pay_item_id = '101' # must be provided by Interswitch
[10765]678    product_id = PRODUCT_ID
[15021]679    mac = MAC
[10765]680
681    def update(self):
[12979]682        error = self.init_update()
683        if error:
684            self.flash(error, type='danger')
685            self.redirect(self.url(self.context, '@@index'))
686            return
[15764]687        self.context.r_company = u'interswitch'
[10765]688        xmldict = {}
[14731]689        provider_amt = 500.0
[14859]690        gateway_amt = GATEWAY_AMT
[15075]691        xmldict['institution_acct'] = '00000000'
692        xmldict['institution_bank_id'] = '00'
693        if self.applicant.__parent__.application_category in ('ndft', 'hndft'):
[15474]694            xmldict['institution_acct'] = '0072223654'
695            xmldict['institution_bank_id'] = '121'
[15075]696        elif self.applicant.__parent__.application_category in (
697            'ndpt', 'hndpt', 'ndwe', 'hndwe'):
[15098]698            xmldict['institution_acct'] = '1015220292'
699            xmldict['institution_bank_id'] = '117'
[16026]700        elif self.applicant.__parent__.prefix in ('conv', 'hndfincl', 'ndfincl'):
[15959]701            xmldict['institution_acct'] = '1012808851'
[15577]702            xmldict['institution_bank_id'] = '117'
703            self.pay_item_id = '151'
[15075]704        elif self.applicant.applicant_id.startswith('special'):
[14859]705            if self.context.p_category in SPECIAL_PAYMENT_PARAMS.keys():
706                self.pay_item_id = SPECIAL_PAYMENT_PARAMS[self.context.p_category][0]
707                provider_amt = SPECIAL_PAYMENT_PARAMS[self.context.p_category][1]
708                xmldict['institution_acct'] = SPECIAL_PAYMENT_PARAMS[self.context.p_category][2]
709                xmldict['institution_bank_id'] = SPECIAL_PAYMENT_PARAMS[self.context.p_category][3]
710        if self.pay_item_id in ('122', '123', '132', '137', '141',
711                                '142', '143', '144', '146', '147',):
712                gateway_amt = round(0.015 * self.context.amount_auth, 2)
[10765]713        xmldict['detail_ref'] = self.context.p_id
714        xmldict['provider_amt'] = 100 * provider_amt
715        xmldict['provider_acct'] = PROVIDER_ACCT
716        xmldict['provider_bank_id'] = PROVIDER_BANK_ID
717        xmldict['provider_item_name'] = PROVIDER_ITEM_NAME
[14889]718        xmldict['institution_amt'] = institution_amt = 100 * (
719            self.context.amount_auth - provider_amt - gateway_amt)
[12511]720        xmldict['institution_item_name'] = self.context.category
[10765]721        xmldict['institution_name'] = INSTITUTION_NAME
722        xmltext = """<payment_item_detail>
723<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s">
724<item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
725<item_detail item_id="2" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />
726</item_details>
727</payment_item_detail>""" % xmldict
[14889]728
729        # isouaba: All certificates in SPAT are part time thus any payments
730        # coming from those certificates (Application, Acceptance, school fees
731        # etc) 40% should be split to keystone account.
732        if self.applicant.__parent__.application_category in (
733            'ndpt', 'hndpt', 'ndwe', 'hndwe'):
734            xmldict['institution_amt_2'] = 0.4 * institution_amt
735            xmldict['institution_amt_1'] = 0.6 * institution_amt
736            xmltext = """<payment_item_detail>
737<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s">
738<item_detail item_id="1" item_name="%(institution_item_name)s 1" item_amt="%(institution_amt_1)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
[15707]739<item_detail item_id="2" item_name="%(institution_item_name)s 2" item_amt="%(institution_amt_2)d" bank_id="8" acct_num="2034761924" />
[14889]740<item_detail item_id="3" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />
741</item_details>
742</payment_item_detail>""" % xmldict
743
[10765]744        self.xml_data = """<input type="hidden" name="xml_data" value='%s'  />""" % xmltext
745        self.context.provider_amt = provider_amt
746        self.context.gateway_amt = GATEWAY_AMT
[16725]747        self.context.net_amt = self.context.amount_auth - GATEWAY_AMT
[15765]748        self.amount_auth = int(100 * self.context.amount_auth)
[12479]749        hashargs = (
750            self.context.p_id +
751            PRODUCT_ID +
752            self.pay_item_id +
753            str(int(self.amount_auth)) +
754            self.site_redirect_url +
755            self.mac)
756        self.hashvalue = hashlib.sha512(hashargs).hexdigest()
[10765]757        return
758
[11638]759class CustomInterswitchPaymentRequestWebservicePageStudent(
[10765]760    InterswitchPaymentRequestWebservicePageStudent):
[13587]761    """Request webservice view for the CollegePAY gateway
[10765]762    """
763    grok.context(ICustomStudentOnlinePayment)
764    product_id = PRODUCT_ID
765    gateway_host = HOST
766    gateway_url = URL
[15021]767    mac = MAC
[10765]768
[13587]769class CustomInterswitchPaymentVerifyWebservicePageStudent(
770    InterswitchPaymentVerifyWebservicePageStudent):
771    """Payment verify view for the CollegePAY gateway
772    """
773    grok.context(ICustomStudentOnlinePayment)
774    product_id = PRODUCT_ID
775    gateway_host = HOST
776    gateway_url = URL
[15021]777    mac = MAC
[13587]778
[11638]779class CustomInterswitchPaymentRequestWebservicePageApplicant(
[10765]780    InterswitchPaymentRequestWebservicePageApplicant):
[13587]781    """Request webservice view for the CollegePAY gateway
[10765]782    """
783    grok.context(ICustomApplicantOnlinePayment)
784    product_id = PRODUCT_ID
785    gateway_host = HOST
[12479]786    gateway_url = URL
[15021]787    mac = MAC
[13587]788
789class CustomInterswitchPaymentVerifyWebservicePageApplicant(
790    InterswitchPaymentVerifyWebservicePageApplicant):
791    """Payment verify view for the CollegePAY gateway
792    """
793    grok.context(ICustomApplicantOnlinePayment)
794    product_id = PRODUCT_ID
795    gateway_host = HOST
[14722]796    gateway_url = URL
[15021]797    mac = MAC
Note: See TracBrowser for help on using the repository browser.