1 | # -*- coding: utf-8 -*- |
---|
2 | ## $Id: browser.py 17081 2022-09-02 10:19:20Z henrik $ |
---|
3 | ## |
---|
4 | ## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann |
---|
5 | ## This program is free software; you can redistribute it and/or modify |
---|
6 | ## it under the terms of the GNU General Public License as published by |
---|
7 | ## the Free Software Foundation; either version 2 of the License, or |
---|
8 | ## (at your option) any later version. |
---|
9 | ## |
---|
10 | ## This program is distributed in the hope that it will be useful, |
---|
11 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
12 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
13 | ## GNU General Public License for more details. |
---|
14 | ## |
---|
15 | ## You should have received a copy of the GNU General Public License |
---|
16 | ## along with this program; if not, write to the Free Software |
---|
17 | ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
18 | ## |
---|
19 | import httplib |
---|
20 | import hashlib |
---|
21 | import grok |
---|
22 | from xml.dom import minidom |
---|
23 | from zope.interface import Interface |
---|
24 | from zope.component import queryAdapter |
---|
25 | from waeup.kofa.interfaces import CLEARED |
---|
26 | from kofacustom.nigeria.interswitch.browser import ( |
---|
27 | InterswitchPaymentRequestWebservicePageStudent, |
---|
28 | InterswitchPaymentRequestWebservicePageApplicant, |
---|
29 | InterswitchPaymentVerifyWebservicePageApplicant, |
---|
30 | InterswitchPaymentVerifyWebservicePageStudent, |
---|
31 | InterswitchPageStudent, InterswitchPageApplicant, |
---|
32 | ) |
---|
33 | from waeup.aaue.students.interfaces import ICustomStudentOnlinePayment |
---|
34 | from waeup.aaue.applicants.interfaces import ICustomApplicantOnlinePayment |
---|
35 | from waeup.aaue.interfaces import MessageFactory as _ |
---|
36 | |
---|
37 | PRODUCT_ID_PT = '5040' |
---|
38 | PRODUCT_ID_REGULAR = '5845' |
---|
39 | SITE_NAME = 'aaue.waeup.org' |
---|
40 | PROVIDER_ACCT = '5100189030' |
---|
41 | PROVIDER_BANK_ID = '307' |
---|
42 | PROVIDER_ITEM_NAME = 'WAeAC' |
---|
43 | INSTITUTION_NAME = 'AAU Ekpoma' |
---|
44 | CURRENCY = '566' |
---|
45 | GATEWAY_AMT = 200.0 |
---|
46 | POST_ACTION = 'https://webpay.interswitchng.com/paydirect/pay' |
---|
47 | |
---|
48 | HOST = 'webpay.interswitchng.com' |
---|
49 | URL = '/paydirect/api/v1/gettransaction.json' |
---|
50 | HTTPS = True |
---|
51 | MAC_REGULAR = '9718FA00B0F5070B388A9896ADCED9B2FB02D30F71E12E68BDADC63F6852A3496FF97D8A0F9DA9F753B911A49BB09BB87B55FD02046BD325C74C46C0123CF023' |
---|
52 | MAC_PT = '74424F1DFECD6058F153148255CDD55E16724B4F380ADB2C63C5D1D7A5675759010C8153DCB930AAF2D38903CBF7CE32B8A6BA2C16BBC46721DF2E3F3E4548E3' |
---|
53 | |
---|
54 | httplib.HTTPSConnection.debuglevel = 0 |
---|
55 | |
---|
56 | |
---|
57 | def gateway_net_amt(fee): |
---|
58 | if fee > GATEWAY_AMT: |
---|
59 | return fee - GATEWAY_AMT |
---|
60 | return 0.0 |
---|
61 | |
---|
62 | def contr_agreement_applicant(applicant): |
---|
63 | if applicant.__parent__.prefix in ( |
---|
64 | 'fp', |
---|
65 | 'ptee', |
---|
66 | 'dsh', |
---|
67 | 'bridge', |
---|
68 | 'ijmbe', |
---|
69 | ): |
---|
70 | return 'first' |
---|
71 | return 'second' |
---|
72 | |
---|
73 | def contr_agreement_student(student): |
---|
74 | if student.current_mode in ( |
---|
75 | 'found', |
---|
76 | 'bridge', |
---|
77 | 'ug_dsh', |
---|
78 | 'de_dsh', |
---|
79 | 'ug_pt', |
---|
80 | 'de_pt', |
---|
81 | 'dp_pt', |
---|
82 | 'ijmbe', |
---|
83 | ): |
---|
84 | return 'first' |
---|
85 | return 'second' |
---|
86 | |
---|
87 | class CustomInterswitchPageApplicant(InterswitchPageApplicant): |
---|
88 | """ View which sends a POST request to the Interswitch |
---|
89 | CollegePAY payment gateway. |
---|
90 | |
---|
91 | So far only PT application has been configured. |
---|
92 | """ |
---|
93 | grok.context(ICustomApplicantOnlinePayment) |
---|
94 | action = POST_ACTION |
---|
95 | site_name = SITE_NAME |
---|
96 | currency = CURRENCY |
---|
97 | provider_bank_id = PROVIDER_BANK_ID |
---|
98 | provider_acct = PROVIDER_ACCT |
---|
99 | institution_acct = '1010835352' |
---|
100 | institution_bank_id = '117' |
---|
101 | |
---|
102 | def update(self): |
---|
103 | |
---|
104 | error = self.init_update() |
---|
105 | if error: |
---|
106 | self.flash(error, type='danger') |
---|
107 | self.redirect(self.url(self.context, '@@index')) |
---|
108 | return |
---|
109 | self.context.r_company = u'interswitch' |
---|
110 | provider_amt = 2000.0 |
---|
111 | fedex_amt = 0.0 |
---|
112 | if contr_agreement_applicant(self.applicant) == 'first': |
---|
113 | self.product_id = PRODUCT_ID_PT |
---|
114 | self.pay_item_id = '101' |
---|
115 | self.mac = MAC_PT |
---|
116 | if self.applicant.__parent__.prefix == 'ijmbe': |
---|
117 | self.institution_bank_id = '123' |
---|
118 | self.institution_acct = '1012278272' |
---|
119 | else: |
---|
120 | self.product_id = PRODUCT_ID_REGULAR |
---|
121 | self.pay_item_id = '109' |
---|
122 | self.mac = MAC_REGULAR |
---|
123 | if self.applicant.__parent__.prefix in ('utme', 'ude'): |
---|
124 | provider_amt = 1000.0 |
---|
125 | elif self.applicant.__parent__.prefix in ('trans', 'cert'): |
---|
126 | self.institution_acct = '1010827641' |
---|
127 | self.institution_bank_id = '117' |
---|
128 | self.provider_bank_id = '10' |
---|
129 | self.provider_acct = '0427773399' |
---|
130 | if self.applicant.applicant_id[:5] in ('cert7', 'cert8'): |
---|
131 | provider_amt = 0.0 |
---|
132 | if self.applicant.applicant_id[:6] in ('trans5', 'trans6'): |
---|
133 | self.institution_acct = '5210006575' |
---|
134 | self.institution_bank_id = '51' |
---|
135 | #if self.applicant.applicant_id[:6] in ('trans1', 'trans6'): |
---|
136 | # fedex_amt = 10500.0 |
---|
137 | if self.context.p_category == 'app_balance': |
---|
138 | provider_amt = 0.0 |
---|
139 | elif self.applicant.applicant_id.startswith('bridge'): # easier to test |
---|
140 | self.institution_acct = '1014847058' |
---|
141 | self.institution_bank_id = '7' |
---|
142 | elif self.applicant.applicant_id.startswith('dsh'): # easier to test |
---|
143 | self.institution_acct = '1014847058' |
---|
144 | self.institution_bank_id = '7' |
---|
145 | elif self.applicant.__parent__.prefix in ('ver', 'send'): |
---|
146 | provider_amt = 0.0 |
---|
147 | elif self.applicant.__parent__.prefix == 'fedex': |
---|
148 | provider_amt = 0.0 |
---|
149 | self.institution_acct = '0001115694' |
---|
150 | self.institution_bank_id = '10' |
---|
151 | elif self.applicant.applicant_id.startswith('pg'): |
---|
152 | self.institution_acct = '5210006575' |
---|
153 | self.institution_bank_id = '51' |
---|
154 | |
---|
155 | xmldict = {} |
---|
156 | xmldict['detail_ref'] = self.context.p_id |
---|
157 | xmldict['provider_amt'] = 100 * provider_amt |
---|
158 | xmldict['provider_acct'] = self.provider_acct |
---|
159 | xmldict['provider_bank_id'] = self.provider_bank_id |
---|
160 | xmldict['provider_item_name'] = PROVIDER_ITEM_NAME |
---|
161 | xmldict['institution_acct'] = self.institution_acct |
---|
162 | xmldict['institution_bank_id'] = self.institution_bank_id |
---|
163 | xmldict['institution_item_name'] = self.category |
---|
164 | xmldict['institution_name'] = INSTITUTION_NAME |
---|
165 | xmldict['fedex_amt'] = 100 * fedex_amt |
---|
166 | xmldict['institution_amt'] = 100 * ( |
---|
167 | self.context.amount_auth - provider_amt - fedex_amt - GATEWAY_AMT) |
---|
168 | |
---|
169 | xmltext = """<payment_item_detail> |
---|
170 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s"> |
---|
171 | <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" /> |
---|
172 | <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" /> |
---|
173 | </item_details> |
---|
174 | </payment_item_detail>""" % xmldict |
---|
175 | |
---|
176 | if provider_amt == 0.0: |
---|
177 | xmltext = """<payment_item_detail> |
---|
178 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s"> |
---|
179 | <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" /> |
---|
180 | </item_details> |
---|
181 | </payment_item_detail>""" % xmldict |
---|
182 | |
---|
183 | if fedex_amt: |
---|
184 | xmltext = """<payment_item_detail> |
---|
185 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s"> |
---|
186 | <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" /> |
---|
187 | <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" /> |
---|
188 | <item_detail item_id="3" item_name="FedEx" item_amt="%(fedex_amt)d" bank_id="10" acct_num="0001115694" /> |
---|
189 | </item_details> |
---|
190 | </payment_item_detail>""" % xmldict |
---|
191 | |
---|
192 | if self.applicant.applicant_id.startswith('pg'): |
---|
193 | handbook_amount = 2000.0 |
---|
194 | xmldict['handbook_amount'] = 100 * handbook_amount |
---|
195 | xmldict['institution_amt'] = 100 * ( |
---|
196 | self.context.amount_auth - provider_amt - handbook_amount -GATEWAY_AMT) |
---|
197 | xmltext = """<payment_item_detail> |
---|
198 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s"> |
---|
199 | <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" /> |
---|
200 | <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" /> |
---|
201 | <item_detail item_id="3" item_name="PG Handbook" item_amt="%(handbook_amount)d" bank_id="51" acct_num="5210006575" /> |
---|
202 | </item_details> |
---|
203 | </payment_item_detail>""" % xmldict |
---|
204 | |
---|
205 | self.xml_data = """<input type="hidden" name="xml_data" value='%s' />""" % xmltext |
---|
206 | self.context.provider_amt = provider_amt |
---|
207 | self.context.gateway_amt = GATEWAY_AMT |
---|
208 | xmlitems = '' |
---|
209 | xmldoc = minidom.parseString(xmltext) |
---|
210 | itemlist = xmldoc.getElementsByTagName('item_detail') |
---|
211 | for s in itemlist: |
---|
212 | xmlitems += "%s: %s, N%s, %s (%s) " % ( |
---|
213 | s.attributes['item_id'].value, |
---|
214 | s.attributes['item_name'].value, |
---|
215 | int(s.attributes['item_amt'].value)/100, |
---|
216 | s.attributes['acct_num'].value, |
---|
217 | s.attributes['bank_id'].value, |
---|
218 | ) |
---|
219 | self.context.p_split_data = xmlitems |
---|
220 | self.amount_auth = int(100 * self.context.amount_auth) |
---|
221 | hashargs = ( |
---|
222 | self.context.p_id + |
---|
223 | self.product_id + |
---|
224 | self.pay_item_id + |
---|
225 | str(int(self.amount_auth)) + |
---|
226 | self.site_redirect_url + |
---|
227 | self.mac) |
---|
228 | self.hashvalue = hashlib.sha512(hashargs).hexdigest() |
---|
229 | |
---|
230 | return |
---|
231 | |
---|
232 | class CustomInterswitchPageStudent(InterswitchPageStudent): |
---|
233 | """ View which sends a POST request to the Interswitch |
---|
234 | CollegePAY payment gateway. |
---|
235 | """ |
---|
236 | grok.context(ICustomStudentOnlinePayment) |
---|
237 | action = POST_ACTION |
---|
238 | site_name = SITE_NAME |
---|
239 | currency = CURRENCY |
---|
240 | pay_item_id = '000' |
---|
241 | |
---|
242 | def update(self): |
---|
243 | error = self.init_update() |
---|
244 | if error: |
---|
245 | self.flash(error, type='danger') |
---|
246 | self.redirect(self.url(self.context, '@@index')) |
---|
247 | return |
---|
248 | self.context.r_company = u'interswitch' |
---|
249 | student = self.student |
---|
250 | p_session = self.context.p_session |
---|
251 | try: |
---|
252 | academic_session = grok.getSite()['configuration'][str(p_session)] |
---|
253 | except KeyError: |
---|
254 | self.flash(_(u'Session configuration object is not available.'), |
---|
255 | type='danger') |
---|
256 | self.redirect(self.url(self.context, '@@index')) |
---|
257 | return |
---|
258 | if contr_agreement_student(student) == 'first': |
---|
259 | self.product_id = PRODUCT_ID_PT |
---|
260 | self.mac = MAC_PT |
---|
261 | else: |
---|
262 | self.product_id = PRODUCT_ID_REGULAR |
---|
263 | self.mac = MAC_REGULAR |
---|
264 | |
---|
265 | # To guarantee that cleared students pay both acceptance fee |
---|
266 | # and school fees, the page can only be accessed |
---|
267 | # for school fee payments if acceptance/clearance fee has |
---|
268 | # been successfully queried/paid beforehand. This |
---|
269 | # requirement applies to students in state 'cleared' and |
---|
270 | # entry_session greater than 2012 only. |
---|
271 | if self.context.p_category.startswith('schoolfee') and \ |
---|
272 | student.state == CLEARED and \ |
---|
273 | student.entry_session > 2012: |
---|
274 | acceptance_fee_paid = False |
---|
275 | for ticket in student['payments'].values(): |
---|
276 | if ticket.p_state == 'paid' and \ |
---|
277 | ticket.p_category.startswith('clearance'): |
---|
278 | acceptance_fee_paid = True |
---|
279 | break |
---|
280 | if not acceptance_fee_paid: |
---|
281 | self.flash( |
---|
282 | _('Please pay acceptance fee first.'), type="danger") |
---|
283 | self.redirect(self.url(self.context, '@@index')) |
---|
284 | return |
---|
285 | |
---|
286 | xmldict = self.xmldict |
---|
287 | xmltext = "" |
---|
288 | xmldict['institution_acct'] = '1010827641' |
---|
289 | xmldict['institution_bank_id'] = '117' |
---|
290 | xmldict['detail_ref'] = self.context.p_id |
---|
291 | xmldict['provider_acct'] = PROVIDER_ACCT |
---|
292 | xmldict['provider_bank_id'] = PROVIDER_BANK_ID |
---|
293 | xmldict['provider_item_name'] = PROVIDER_ITEM_NAME |
---|
294 | xmldict['institution_item_name'] = self.category |
---|
295 | xmldict['institution_name'] = INSTITUTION_NAME |
---|
296 | provider_amt = 0.0 |
---|
297 | xmldict['institution_amt'] = 100 * ( |
---|
298 | gateway_net_amt(self.context.amount_auth)) |
---|
299 | |
---|
300 | # Schoolfee |
---|
301 | if self.context.p_category.startswith('schoolfee'): |
---|
302 | if contr_agreement_student(student) == 'first': |
---|
303 | # First agreement |
---|
304 | provider_amt = 1900.0 |
---|
305 | joint_venture_amt = 0.0 |
---|
306 | aaue_share_amt = 0.0 |
---|
307 | student_union_due_amt = gateway_net_amt( |
---|
308 | academic_session.union_fee) |
---|
309 | student_welfare_assurance_amt = gateway_net_amt( |
---|
310 | academic_session.welfare_fee) |
---|
311 | sports_amt = gateway_net_amt( |
---|
312 | academic_session.sports_fee) |
---|
313 | library_amt = gateway_net_amt( |
---|
314 | academic_session.library_fee) |
---|
315 | library_amt_pg = gateway_net_amt( |
---|
316 | academic_session.library_pg_fee) |
---|
317 | lms_sund_amt = gateway_net_amt( |
---|
318 | academic_session.lms_sund_fee) |
---|
319 | xmldict['student_union_bank_id'] = '31' |
---|
320 | xmldict['student_union_acct'] = '0051005007' |
---|
321 | xmldict['aaue_share_bank_id'] = '117' |
---|
322 | xmldict['aaue_share_acct'] = '1010827641' |
---|
323 | xmldict['joint_venture_bank_id'] = '117' |
---|
324 | xmldict['joint_venture_acct'] = '1010827641' |
---|
325 | xmldict['institution_acct'] = '1014847058' |
---|
326 | xmldict['institution_bank_id'] = '7' |
---|
327 | self.pay_item_id = '105' |
---|
328 | if student.current_mode == 'found': |
---|
329 | self.pay_item_id = '103' |
---|
330 | elif student.current_mode == 'ijmbe': |
---|
331 | self.pay_item_id = '103' |
---|
332 | xmldict['institution_bank_id'] = '123' |
---|
333 | xmldict['institution_acct'] = '1012278272' |
---|
334 | else: |
---|
335 | # Second agreement |
---|
336 | joint_venture_amt = 1000.0 |
---|
337 | aaue_share_amt = 1500.0 |
---|
338 | provider_amt = 1500.0 |
---|
339 | student_union_due_amt = gateway_net_amt( |
---|
340 | academic_session.union_fee) |
---|
341 | student_welfare_assurance_amt = gateway_net_amt( |
---|
342 | academic_session.welfare_fee) |
---|
343 | sports_amt = gateway_net_amt( |
---|
344 | academic_session.sports_fee) |
---|
345 | library_amt = gateway_net_amt( |
---|
346 | academic_session.library_fee) |
---|
347 | library_amt_pg = gateway_net_amt( |
---|
348 | academic_session.library_pg_fee) |
---|
349 | lms_sund_amt = gateway_net_amt( |
---|
350 | academic_session.lms_sund_fee) |
---|
351 | xmldict['student_union_bank_id'] = '7' |
---|
352 | xmldict['student_union_acct'] = '1019763348' |
---|
353 | xmldict['aaue_share_bank_id'] = '117' |
---|
354 | xmldict['aaue_share_acct'] = '1010827641' |
---|
355 | xmldict['joint_venture_bank_id'] = '117' |
---|
356 | xmldict['joint_venture_acct'] = '1010827641' |
---|
357 | self.pay_item_id = '107' |
---|
358 | if student.is_postgrad: |
---|
359 | self.pay_item_id = '111' |
---|
360 | xmldict['institution_acct'] = '5210006575' |
---|
361 | xmldict['institution_bank_id'] = '51' |
---|
362 | |
---|
363 | xmldict['provider_amt'] = 100 * provider_amt |
---|
364 | xmldict['joint_venture_amt'] = 100 * joint_venture_amt |
---|
365 | xmldict['aaue_share_amt'] = 100 * aaue_share_amt |
---|
366 | xmldict['lms_sund_amt'] = 100 * lms_sund_amt |
---|
367 | if self.context.p_item == 'Balance': |
---|
368 | xmldict['institution_amt'] = 100 * ( |
---|
369 | gateway_net_amt(self.context.amount_auth)) |
---|
370 | elif self.context.p_category == 'schoolfee_2': |
---|
371 | xmldict['institution_amt'] = 100 * gateway_net_amt( |
---|
372 | self.context.amount_auth) |
---|
373 | xmltext = """<payment_item_detail> |
---|
374 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
375 | <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" /> |
---|
376 | </item_details> |
---|
377 | </payment_item_detail>""" % xmldict |
---|
378 | elif self.context.p_category in ('schoolfee_incl', 'schoolfee_1') \ |
---|
379 | and student.current_mode != 'ijmbe': |
---|
380 | # Schoolfee including additional fees |
---|
381 | xmldict['student_union_due_amt'] = 100 * student_union_due_amt |
---|
382 | xmldict['student_welfare_assurance_amt'] = 100 * student_welfare_assurance_amt |
---|
383 | |
---|
384 | if student.entry_session >= 2018 and student.is_fresh: |
---|
385 | xmldict['sports_amt'] = 100 * sports_amt |
---|
386 | if student.is_postgrad: |
---|
387 | xmldict['library_amt'] = 100 * library_amt_pg |
---|
388 | else: |
---|
389 | xmldict['library_amt'] = 100 * library_amt |
---|
390 | xmldict['institution_amt'] = 100 * ( |
---|
391 | gateway_net_amt(self.context.amount_auth) |
---|
392 | - provider_amt |
---|
393 | - joint_venture_amt |
---|
394 | - aaue_share_amt |
---|
395 | - student_union_due_amt |
---|
396 | - student_welfare_assurance_amt |
---|
397 | - sports_amt |
---|
398 | - library_amt |
---|
399 | - lms_sund_amt) |
---|
400 | xmltext = """<payment_item_detail> |
---|
401 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
402 | <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" /> |
---|
403 | <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" /> |
---|
404 | <item_detail item_id="3" item_name="Student Union" item_amt="%(student_union_due_amt)d" bank_id="%(student_union_bank_id)s" acct_num="%(student_union_acct)s" /> |
---|
405 | <item_detail item_id="4" item_name="Student Welfare Assurance" item_amt="%(student_welfare_assurance_amt)d" bank_id="123" acct_num="1006407792" /> |
---|
406 | <item_detail item_id="5" item_name="Sports Development Fee" item_amt="%(sports_amt)d" bank_id="123" acct_num="1006407792" /> |
---|
407 | <item_detail item_id="6" item_name="Library Development Fee" item_amt="%(library_amt)d" bank_id="8" acct_num="2000122995" />""" % xmldict |
---|
408 | if contr_agreement_student(student) == 'second': |
---|
409 | xmltext += """" |
---|
410 | <item_detail item_id="7" item_name="Joint Venture" item_amt="%(joint_venture_amt)d" bank_id="%(joint_venture_bank_id)s" acct_num="%(joint_venture_acct)s" /> |
---|
411 | <item_detail item_id="8" item_name="AAUE Share" item_amt="%(aaue_share_amt)d" bank_id="%(aaue_share_bank_id)s" acct_num="%(aaue_share_acct)s" />""" % xmldict |
---|
412 | if student.entry_session >= 2021 and student.current_mode == 'ug_ft': |
---|
413 | xmltext += """" |
---|
414 | <item_detail item_id="9" item_name="LMS plus Sundry Fees" item_amt="%(lms_sund_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />""" % xmldict |
---|
415 | xmltext += """" |
---|
416 | </item_details> |
---|
417 | </payment_item_detail>""" |
---|
418 | else: |
---|
419 | xmldict['institution_amt'] = 100 * ( |
---|
420 | gateway_net_amt(self.context.amount_auth) |
---|
421 | - provider_amt |
---|
422 | - student_union_due_amt |
---|
423 | - student_welfare_assurance_amt) |
---|
424 | xmltext = """<payment_item_detail> |
---|
425 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
426 | <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" /> |
---|
427 | <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" /> |
---|
428 | <item_detail item_id="3" item_name="Student Union" item_amt="%(student_union_due_amt)d" bank_id="%(student_union_bank_id)s" acct_num="%(student_union_acct)s" /> |
---|
429 | <item_detail item_id="4" item_name="Student Welfare Assurance" item_amt="%(student_welfare_assurance_amt)d" bank_id="123" acct_num="1006407792" />""" % xmldict |
---|
430 | if contr_agreement_student(student) == 'second': |
---|
431 | xmldict['institution_amt'] = 100 * ( |
---|
432 | gateway_net_amt(self.context.amount_auth) |
---|
433 | - provider_amt |
---|
434 | - joint_venture_amt |
---|
435 | - aaue_share_amt |
---|
436 | - student_union_due_amt |
---|
437 | - student_welfare_assurance_amt) |
---|
438 | xmltext += """" |
---|
439 | <item_detail item_id="5" item_name="Joint Venture" item_amt="%(joint_venture_amt)d" bank_id="%(joint_venture_bank_id)s" acct_num="%(joint_venture_acct)s" /> |
---|
440 | <item_detail item_id="6" item_name="AAUE Share" item_amt="%(aaue_share_amt)d" bank_id="%(aaue_share_bank_id)s" acct_num="%(aaue_share_acct)s" /> |
---|
441 | </item_details> |
---|
442 | </payment_item_detail>""" % xmldict |
---|
443 | else: |
---|
444 | xmltext += """" |
---|
445 | </item_details> |
---|
446 | </payment_item_detail>""" |
---|
447 | elif contr_agreement_student(student) == 'second': |
---|
448 | # Schoolfee without Student Union Fee ands Student Welfare Assurance |
---|
449 | xmldict['institution_amt'] = 100 * ( |
---|
450 | gateway_net_amt(self.context.amount_auth) |
---|
451 | - provider_amt |
---|
452 | - joint_venture_amt |
---|
453 | - aaue_share_amt) |
---|
454 | xmltext = """<payment_item_detail> |
---|
455 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
456 | <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" /> |
---|
457 | <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" /> |
---|
458 | <item_detail item_id="3" item_name="Joint Venture" item_amt="%(joint_venture_amt)d" bank_id="%(joint_venture_bank_id)s" acct_num="%(joint_venture_acct)s" /> |
---|
459 | <item_detail item_id="4" item_name="AAUE Share" item_amt="%(aaue_share_amt)d" bank_id="%(aaue_share_bank_id)s" acct_num="%(aaue_share_acct)s" /> |
---|
460 | </item_details> |
---|
461 | </payment_item_detail>""" % xmldict |
---|
462 | else: |
---|
463 | xmldict['institution_amt'] = 100 * ( |
---|
464 | gateway_net_amt(self.context.amount_auth) |
---|
465 | - provider_amt) |
---|
466 | xmltext = """<payment_item_detail> |
---|
467 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
468 | <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" /> |
---|
469 | <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" /> |
---|
470 | </item_details> |
---|
471 | </payment_item_detail>""" % xmldict |
---|
472 | |
---|
473 | |
---|
474 | # Clearance |
---|
475 | elif self.context.p_category.startswith('clearance'): |
---|
476 | xmldict['institution_acct'] = '1010835352' |
---|
477 | provider_amt = 0.0 |
---|
478 | if contr_agreement_student(student) == 'first': |
---|
479 | # First agreement |
---|
480 | xmldict['institution_acct'] = '1014847058' |
---|
481 | xmldict['institution_bank_id'] = '7' |
---|
482 | self.pay_item_id = '104' |
---|
483 | if student.current_mode == 'found': |
---|
484 | self.pay_item_id = '102' |
---|
485 | elif student.current_mode == 'ijmbe': |
---|
486 | self.pay_item_id = '102' |
---|
487 | xmldict['institution_bank_id'] = '123' |
---|
488 | xmldict['institution_acct'] = '1012278272' |
---|
489 | else: |
---|
490 | # Second agreement |
---|
491 | self.pay_item_id = '102' |
---|
492 | if student.is_postgrad: |
---|
493 | self.pay_item_id = '110' |
---|
494 | xmldict['institution_acct'] = '5210006575' |
---|
495 | xmldict['institution_bank_id'] = '51' |
---|
496 | # ivama: Acceptance fee split is unique to "ug_ft" |
---|
497 | # The reason for split is perculiar to them only... |
---|
498 | # That amount was deducted from UTME application fee because |
---|
499 | # some regulatory body have pegged the application fee which |
---|
500 | # didn't affect another programmes. |
---|
501 | if student.current_mode == 'ug_ft': |
---|
502 | provider_amt = 1500.0 |
---|
503 | xmldict['provider_amt'] = 100 * provider_amt |
---|
504 | if self.context.p_category.endswith('_incl'): |
---|
505 | # Clearance including additional fees |
---|
506 | gown_fee_amt = gateway_net_amt(academic_session.matric_gown_fee) |
---|
507 | aaue_lf_fee_amt = gateway_net_amt(academic_session.lapel_fee) |
---|
508 | xmldict['gown_fee_amt'] = 100 * gown_fee_amt |
---|
509 | xmldict['aaue_lf_fee_amt'] = 100 * aaue_lf_fee_amt |
---|
510 | xmldict['institution_amt'] = 100 * ( |
---|
511 | gateway_net_amt(self.context.amount_auth) |
---|
512 | - gown_fee_amt |
---|
513 | - aaue_lf_fee_amt |
---|
514 | - provider_amt) |
---|
515 | xmltext = """<payment_item_detail> |
---|
516 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
517 | <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" /> |
---|
518 | <item_detail item_id="2" item_name="Matriculation Gown Fee" item_amt="%(gown_fee_amt)d" bank_id="117" acct_num="1010835352" /> |
---|
519 | <item_detail item_id="3" item_name="AAU File-Lapel Fee" item_amt="%(aaue_lf_fee_amt)d" bank_id="117" acct_num="1010835352" />""" % xmldict |
---|
520 | if provider_amt: |
---|
521 | xmltext += """" |
---|
522 | <item_detail item_id="4" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" /> |
---|
523 | </item_details> |
---|
524 | </payment_item_detail>""" % xmldict |
---|
525 | else: |
---|
526 | xmltext += """" |
---|
527 | </item_details> |
---|
528 | </payment_item_detail>""" |
---|
529 | |
---|
530 | elif student.current_mode == 'bridge': |
---|
531 | # Clearance without any surcharge |
---|
532 | xmldict['institution_amt'] = 100 * gateway_net_amt( |
---|
533 | self.context.amount_auth) |
---|
534 | xmltext = """<payment_item_detail> |
---|
535 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
536 | <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" /> |
---|
537 | </item_details> |
---|
538 | </payment_item_detail>""" % xmldict |
---|
539 | |
---|
540 | else: |
---|
541 | # Clearance without additional fees |
---|
542 | xmldict['institution_amt'] = 100 * ( |
---|
543 | gateway_net_amt(self.context.amount_auth) |
---|
544 | - provider_amt) |
---|
545 | xmltext = """<payment_item_detail> |
---|
546 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
547 | <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" />""" % xmldict |
---|
548 | if provider_amt: |
---|
549 | xmltext += """" |
---|
550 | <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" /> |
---|
551 | </item_details> |
---|
552 | </payment_item_detail>""" % xmldict |
---|
553 | else: |
---|
554 | xmltext += """" |
---|
555 | </item_details> |
---|
556 | </payment_item_detail>""" |
---|
557 | |
---|
558 | # Union Dues |
---|
559 | elif self.context.p_category == 'union': |
---|
560 | self.pay_item_id = '103' |
---|
561 | xmldict['institution_amt'] = 100 * ( |
---|
562 | gateway_net_amt(self.context.amount_auth)) |
---|
563 | if contr_agreement_student(student) == 'first': |
---|
564 | # First agreement |
---|
565 | xmldict['institution_acct'] = '0051005007' |
---|
566 | xmldict['institution_bank_id'] = '31' |
---|
567 | else: |
---|
568 | # Second agreement |
---|
569 | xmldict['institution_bank_id'] = '7' |
---|
570 | xmldict['institution_acct'] = '1019763348' |
---|
571 | |
---|
572 | # Lapel/File |
---|
573 | elif self.context.p_category == 'lapel': |
---|
574 | self.pay_item_id = '104' |
---|
575 | xmldict['institution_amt'] = 100 * ( |
---|
576 | gateway_net_amt(self.context.amount_auth)) |
---|
577 | |
---|
578 | # Welfare Assurance |
---|
579 | elif self.context.p_category == 'welfare': |
---|
580 | self.pay_item_id = '105' |
---|
581 | xmldict['institution_acct'] = '1006407792' |
---|
582 | xmldict['institution_bank_id'] = '123' |
---|
583 | xmldict['institution_amt'] = 100 * ( |
---|
584 | gateway_net_amt(self.context.amount_auth)) |
---|
585 | |
---|
586 | # ID Card |
---|
587 | elif self.context.p_category == 'id_card': |
---|
588 | self.pay_item_id = '000' |
---|
589 | xmldict['institution_amt'] = 100 * ( |
---|
590 | gateway_net_amt(self.context.amount_auth)) |
---|
591 | |
---|
592 | # Matric Gown |
---|
593 | elif self.context.p_category == 'matric_gown': |
---|
594 | self.pay_item_id = '106' |
---|
595 | xmldict['institution_amt'] = 100 * ( |
---|
596 | gateway_net_amt(self.context.amount_auth)) |
---|
597 | |
---|
598 | # Concessional |
---|
599 | elif self.context.p_category == 'concessional': |
---|
600 | self.pay_item_id = '107' |
---|
601 | xmldict['institution_amt'] = 100 * ( |
---|
602 | gateway_net_amt(self.context.amount_auth)) |
---|
603 | |
---|
604 | # Hostel Maintenance |
---|
605 | elif self.context.p_category == 'hostel_maintenance': |
---|
606 | provider_amt = 500.0 |
---|
607 | self.pay_item_id = '109' |
---|
608 | xmldict['institution_acct'] = '1006406795' |
---|
609 | xmldict['institution_bank_id'] = '123' |
---|
610 | xmldict['provider_amt'] = 100 * provider_amt |
---|
611 | xmldict['institution_amt'] = 100 * ( |
---|
612 | gateway_net_amt(self.context.amount_auth) - provider_amt) |
---|
613 | xmltext = """<payment_item_detail> |
---|
614 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
615 | <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" /> |
---|
616 | <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" /> |
---|
617 | </item_details> |
---|
618 | </payment_item_detail>""" % xmldict |
---|
619 | |
---|
620 | # GST Fees |
---|
621 | elif self.context.p_category.startswith('gst_'): |
---|
622 | if contr_agreement_student(student) == 'first': |
---|
623 | self.pay_item_id = '115' |
---|
624 | else: |
---|
625 | self.pay_item_id = '116' |
---|
626 | xmldict['institution_acct'] = '1010893123' |
---|
627 | xmldict['institution_bank_id'] = '117' |
---|
628 | xmldict['institution_amt'] = 100 * ( |
---|
629 | gateway_net_amt(self.context.amount_auth)) |
---|
630 | |
---|
631 | # ENT Fees |
---|
632 | elif self.context.p_category.startswith('ent_'): |
---|
633 | if contr_agreement_student(student) == 'first': |
---|
634 | self.pay_item_id = '114' |
---|
635 | else: |
---|
636 | self.pay_item_id = '118' |
---|
637 | xmldict['institution_acct'] = '6220029828' |
---|
638 | xmldict['institution_bank_id'] = '51' |
---|
639 | xmldict['institution_amt'] = 100 * ( |
---|
640 | gateway_net_amt(self.context.amount_auth)) |
---|
641 | |
---|
642 | # Faculty and Departmental Dues |
---|
643 | elif self.context.p_category == 'fac_dep': |
---|
644 | xmldict['institution_acct'] = '1016425386' |
---|
645 | xmldict['institution_bank_id'] = '117' |
---|
646 | self.pay_item_id = '117' |
---|
647 | xmldict['institution_amt'] = 100 * ( |
---|
648 | gateway_net_amt(self.context.amount_auth)) |
---|
649 | |
---|
650 | # Restitution Fee |
---|
651 | elif self.context.p_category == 'restitution': |
---|
652 | self.pay_item_id = '117' |
---|
653 | xmldict['institution_amt'] = 100 * ( |
---|
654 | gateway_net_amt(self.context.amount_auth)) |
---|
655 | |
---|
656 | # Faculty Laboratory Due |
---|
657 | elif self.context.p_category in ('lab_1', 'lab_2'): |
---|
658 | xmldict['institution_acct'] = '1016425386' |
---|
659 | xmldict['institution_bank_id'] = '117' |
---|
660 | self.pay_item_id = '117' |
---|
661 | xmldict['institution_amt'] = 100 * ( |
---|
662 | gateway_net_amt(self.context.amount_auth)) |
---|
663 | |
---|
664 | # Sports Fee |
---|
665 | #elif self.context.p_category == 'sports': |
---|
666 | # self.pay_item_id = '105' |
---|
667 | # xmldict['institution_amt'] = 100 * ( |
---|
668 | # gateway_net_amt(self.context.amount_auth)) |
---|
669 | |
---|
670 | # Library Fee |
---|
671 | #elif self.context.p_category == 'library': |
---|
672 | # self.pay_item_id = '105' |
---|
673 | # xmldict['institution_amt'] = 100 * ( |
---|
674 | # gateway_net_amt(self.context.amount_auth)) |
---|
675 | |
---|
676 | # Library PG Fee |
---|
677 | #elif self.context.p_category == 'library_pg': |
---|
678 | # self.pay_item_id = '105' |
---|
679 | # xmldict['institution_amt'] = 100 * ( |
---|
680 | # gateway_net_amt(self.context.amount_auth)) |
---|
681 | |
---|
682 | # Exam Fee |
---|
683 | elif self.context.p_category == 'exam': |
---|
684 | self.pay_item_id = '103' |
---|
685 | xmldict['institution_acct'] = '1012278272' |
---|
686 | xmldict['institution_bank_id'] = '123' |
---|
687 | xmldict['institution_amt'] = 100 * ( |
---|
688 | gateway_net_amt(self.context.amount_auth)) |
---|
689 | |
---|
690 | # LMS + Sundry Fees |
---|
691 | elif self.context.p_category == 'lms_sund': |
---|
692 | self.pay_item_id = '103' |
---|
693 | xmldict['institution_amt'] = 100 * ( |
---|
694 | gateway_net_amt(self.context.amount_auth)) |
---|
695 | |
---|
696 | # Sports & Library Fee temporarily in 2020 |
---|
697 | elif self.context.p_category == 'sports_library': |
---|
698 | self.pay_item_id = '105' |
---|
699 | xmldict['sports_amt'] = 100 * 3000.0 |
---|
700 | xmldict['library_amt'] = 100 * 1000.0 |
---|
701 | xmltext = """<payment_item_detail> |
---|
702 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
703 | <item_detail item_id="1" item_name="Sports Development Fee" item_amt="%(sports_amt)d" bank_id="123" acct_num="1006407792" /> |
---|
704 | <item_detail item_id="2" item_name="Library Development Fee" item_amt="%(library_amt)d" bank_id="8" acct_num="2000122995" /> |
---|
705 | </item_details> |
---|
706 | </payment_item_detail>""" % xmldict |
---|
707 | |
---|
708 | # Late Registration Fee |
---|
709 | elif self.context.p_category == 'late_registration': |
---|
710 | if contr_agreement_student(student) == 'first': |
---|
711 | self.pay_item_id = '113' |
---|
712 | else: |
---|
713 | self.pay_item_id = '123' |
---|
714 | xmldict['institution_amt'] = 100 * ( |
---|
715 | gateway_net_amt(self.context.amount_auth)) |
---|
716 | if student.is_postgrad: |
---|
717 | xmldict['institution_acct'] = '5210006575' |
---|
718 | xmldict['institution_bank_id'] = '51' |
---|
719 | if not xmltext: |
---|
720 | xmltext = """<payment_item_detail> |
---|
721 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
722 | <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" /> |
---|
723 | </item_details> |
---|
724 | </payment_item_detail>""" % xmldict |
---|
725 | self.xml_data = """<input type="hidden" name="xml_data" value='%s' />""" % xmltext |
---|
726 | self.context.provider_amt = provider_amt |
---|
727 | self.context.gateway_amt = self.context.amount_auth - gateway_net_amt( |
---|
728 | self.context.amount_auth) |
---|
729 | xmlitems = '' |
---|
730 | xmldoc = minidom.parseString(xmltext) |
---|
731 | itemlist = xmldoc.getElementsByTagName('item_detail') |
---|
732 | for s in itemlist: |
---|
733 | xmlitems += "%s: %s, %s %s, %s (%s) " % ( |
---|
734 | s.attributes['item_id'].value, |
---|
735 | s.attributes['item_name'].value, |
---|
736 | u'\u20a6', |
---|
737 | int(s.attributes['item_amt'].value)/100, |
---|
738 | s.attributes['acct_num'].value, |
---|
739 | s.attributes['bank_id'].value, |
---|
740 | ) |
---|
741 | self.context.p_split_data = xmlitems |
---|
742 | self.amount_auth = int(100 * self.context.amount_auth) |
---|
743 | hashargs = ( |
---|
744 | self.context.p_id + |
---|
745 | self.product_id + |
---|
746 | self.pay_item_id + |
---|
747 | str(int(self.amount_auth)) + |
---|
748 | self.site_redirect_url + |
---|
749 | self.mac) |
---|
750 | self.hashvalue = hashlib.sha512(hashargs).hexdigest() |
---|
751 | return |
---|
752 | |
---|
753 | |
---|
754 | class CustomInterswitchPaymentRequestWebservicePageApplicant( |
---|
755 | InterswitchPaymentRequestWebservicePageApplicant): |
---|
756 | """Request webservice view for the CollegePAY gateway |
---|
757 | """ |
---|
758 | grok.context(ICustomApplicantOnlinePayment) |
---|
759 | gateway_host = HOST |
---|
760 | gateway_url = URL |
---|
761 | https = HTTPS |
---|
762 | |
---|
763 | @property |
---|
764 | def mac(self): |
---|
765 | if contr_agreement_applicant(self.context.__parent__) == 'first': |
---|
766 | return MAC_PT |
---|
767 | return MAC_REGULAR |
---|
768 | |
---|
769 | @property |
---|
770 | def product_id(self): |
---|
771 | if contr_agreement_applicant(self.context.__parent__) == 'first': |
---|
772 | return PRODUCT_ID_PT |
---|
773 | return PRODUCT_ID_REGULAR |
---|
774 | |
---|
775 | class CustomInterswitchPaymentVerifyWebservicePageApplicant( |
---|
776 | InterswitchPaymentVerifyWebservicePageApplicant): |
---|
777 | """Payment verify view for the CollegePAY gateway |
---|
778 | """ |
---|
779 | grok.context(ICustomApplicantOnlinePayment) |
---|
780 | gateway_host = HOST |
---|
781 | gateway_url = URL |
---|
782 | https = HTTPS |
---|
783 | |
---|
784 | @property |
---|
785 | def mac(self): |
---|
786 | if contr_agreement_applicant(self.context.__parent__) == 'first': |
---|
787 | return MAC_PT |
---|
788 | return MAC_REGULAR |
---|
789 | |
---|
790 | @property |
---|
791 | def product_id(self): |
---|
792 | if contr_agreement_applicant(self.context.__parent__) == 'first': |
---|
793 | return PRODUCT_ID_PT |
---|
794 | return PRODUCT_ID_REGULAR |
---|
795 | |
---|
796 | class CustomInterswitchPaymentRequestWebservicePageStudent( |
---|
797 | InterswitchPaymentRequestWebservicePageStudent): |
---|
798 | """Request webservice view for the CollegePAY gateway |
---|
799 | """ |
---|
800 | grok.context(ICustomStudentOnlinePayment) |
---|
801 | gateway_host = HOST |
---|
802 | gateway_url = URL |
---|
803 | https = HTTPS |
---|
804 | |
---|
805 | @property |
---|
806 | def mac(self): |
---|
807 | if contr_agreement_student(self.context.student) == 'first': |
---|
808 | return MAC_PT |
---|
809 | return MAC_REGULAR |
---|
810 | |
---|
811 | @property |
---|
812 | def product_id(self): |
---|
813 | if contr_agreement_student(self.context.student) == 'first': |
---|
814 | return PRODUCT_ID_PT |
---|
815 | return PRODUCT_ID_REGULAR |
---|
816 | |
---|
817 | class CustomInterswitchPaymentVerifyWebservicePageStudent( |
---|
818 | InterswitchPaymentVerifyWebservicePageStudent): |
---|
819 | """Payment verify view for the CollegePAY gateway |
---|
820 | """ |
---|
821 | grok.context(ICustomStudentOnlinePayment) |
---|
822 | gateway_host = HOST |
---|
823 | gateway_url = URL |
---|
824 | https = HTTPS |
---|
825 | |
---|
826 | @property |
---|
827 | def mac(self): |
---|
828 | if contr_agreement_student(self.context.student) == 'first': |
---|
829 | return MAC_PT |
---|
830 | return MAC_REGULAR |
---|
831 | |
---|
832 | @property |
---|
833 | def product_id(self): |
---|
834 | if contr_agreement_student(self.context.student) == 'first': |
---|
835 | return PRODUCT_ID_PT |
---|
836 | return PRODUCT_ID_REGULAR |
---|