source: main/waeup.aaue/trunk/src/waeup/aaue/interswitch/browser.py @ 14947

Last change on this file since 14947 was 14945, checked in by Henrik Bettermann, 7 years ago

Use only TSA account.

  • Property svn:keywords set to Id
File size: 23.4 KB
Line 
1## $Id: browser.py 14945 2018-02-04 06:58:00Z 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
19import hashlib
20import grok
21from zope.interface import Interface
22from zope.component import queryAdapter
23from waeup.kofa.interfaces import CLEARED
24from kofacustom.nigeria.interswitch.browser import (
25    InterswitchPaymentRequestWebservicePageStudent,
26    InterswitchPaymentRequestWebservicePageApplicant,
27    InterswitchPaymentVerifyWebservicePageApplicant,
28    InterswitchPaymentVerifyWebservicePageStudent,
29    InterswitchPageStudent, InterswitchPageApplicant,
30    )
31from waeup.aaue.students.interfaces import ICustomStudentOnlinePayment
32from waeup.aaue.applicants.interfaces import ICustomApplicantOnlinePayment
33from waeup.aaue.interfaces import MessageFactory as _
34
35PRODUCT_ID_PT = '5040'
36PRODUCT_ID_REGULAR = '5845'
37SITE_NAME = 'aaue.waeup.org'
38PROVIDER_ACCT = '1014261520'
39PROVIDER_BANK_ID = '117'
40PROVIDER_ITEM_NAME = 'WAeAC'
41INSTITUTION_NAME = 'AAU Ekpoma'
42CURRENCY = '566'
43GATEWAY_AMT = 250.0
44POST_ACTION = 'https://webpay.interswitchng.com/paydirect/pay'
45
46HOST = 'webpay.interswitchng.com'
47URL = '/paydirect/api/v1/gettransaction.json'
48HTTPS = True
49MAC_REGULAR = '9718FA00B0F5070B388A9896ADCED9B2FB02D30F71E12E68BDADC63F6852A3496FF97D8A0F9DA9F753B911A49BB09BB87B55FD02046BD325C74C46C0123CF023'
50MAC_PT = '74424F1DFECD6058F153148255CDD55E16724B4F380ADB2C63C5D1D7A5675759010C8153DCB930AAF2D38903CBF7CE32B8A6BA2C16BBC46721DF2E3F3E4548E3'
51
52httplib.HTTPSConnection.debuglevel = 0
53
54
55def gateway_net_amt(fee):
56    if fee > GATEWAY_AMT:
57        return fee - GATEWAY_AMT
58    return 0.0
59
60def contr_agreement_applicant(applicant):
61    if applicant.__parent__.code[:2] in ('fp', 'pt'):
62        return 'first'
63    return 'second'
64
65def contr_agreement_student(student):
66    if student.current_mode == 'found' or student.current_mode.endswith('_pt'):
67        return 'first'
68    return 'second'
69
70class CustomInterswitchPageApplicant(InterswitchPageApplicant):
71    """ View which sends a POST request to the Interswitch
72    CollegePAY payment gateway.
73
74    So far only PT application has been configured.
75    """
76    grok.context(ICustomApplicantOnlinePayment)
77    action = POST_ACTION
78    site_name = SITE_NAME
79    currency = CURRENCY
80
81    def update(self):
82
83        error = self.init_update()
84        if error:
85            self.flash(error, type='danger')
86            self.redirect(self.url(self.context, '@@index'))
87            return
88        if contr_agreement_applicant(self.context.__parent__) == 'first':
89            self.product_id = PRODUCT_ID_PT
90            self.pay_item_id = '101'
91            self.mac = MAC_PT
92        else:
93            self.product_id = PRODUCT_ID_REGULAR
94            self.pay_item_id = '109'
95            self.mac = MAC_REGULAR
96        xmldict = {}
97        provider_amt = 4000.0
98        xmldict['institution_acct'] = '1010827641'
99        xmldict['institution_bank_id'] = '117'
100        xmldict['detail_ref'] = self.context.p_id
101        xmldict['provider_amt'] = 100 * provider_amt
102        xmldict['provider_acct'] = PROVIDER_ACCT
103        xmldict['provider_bank_id'] = PROVIDER_BANK_ID
104        xmldict['provider_item_name'] = PROVIDER_ITEM_NAME
105        xmldict['institution_item_name'] = self.category
106        xmldict['institution_name'] = INSTITUTION_NAME
107
108        if self.applicant.applicant_id.startswith('pg'):
109            handbook_amount = 2000.0
110            xmldict['handbook_amount'] = 100 * handbook_amount
111            xmldict['institution_amt'] = 100 * (
112                self.context.amount_auth - provider_amt - handbook_amount -GATEWAY_AMT)
113            xmltext = """<payment_item_detail>
114<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s">
115<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" />
116<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" />
117<item_detail item_id="3" item_name="PG Handbook" item_amt="%(handbook_amount)d" bank_id="117" acct_num="1010827641" />
118</item_details>
119</payment_item_detail>""" % xmldict
120
121        elif self.applicant.applicant_id.startswith('utme'):
122            xmldict['provider_amt'] = 100 * provider_amt
123            xmldict['institution_amt'] = 100 * (
124                self.context.amount_auth - provider_amt - GATEWAY_AMT)
125            xmltext = """<payment_item_detail>
126<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s">
127<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" />
128<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" />
129</item_details>
130</payment_item_detail>""" % xmldict
131
132        else:
133            xmldict['institution_amt'] = 100 * (
134                self.context.amount_auth - provider_amt - GATEWAY_AMT)
135            xmltext = """<payment_item_detail>
136<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s">
137<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" />
138<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" />
139</item_details>
140</payment_item_detail>""" % xmldict
141
142        self.xml_data = """<input type="hidden" name="xml_data" value='%s'  />""" % xmltext
143        self.context.provider_amt = provider_amt
144        self.context.gateway_amt = GATEWAY_AMT
145
146        hashargs = (
147            self.context.p_id +
148            self.product_id +
149            self.pay_item_id +
150            str(int(self.amount_auth)) +
151            self.site_redirect_url +
152            self.mac)
153        self.hashvalue = hashlib.sha512(hashargs).hexdigest()
154
155        return
156
157class CustomInterswitchPageStudent(InterswitchPageStudent):
158    """ View which sends a POST request to the Interswitch
159    CollegePAY payment gateway.
160    """
161    grok.context(ICustomStudentOnlinePayment)
162    action = POST_ACTION
163    site_name = SITE_NAME
164    currency = CURRENCY
165    pay_item_id = '000'
166
167    def update(self):
168        error = self.init_update()
169
170        if error:
171            self.flash(error, type='danger')
172            self.redirect(self.url(self.context, '@@index'))
173            return
174
175        student = self.student
176        p_session = self.context.p_session
177        try:
178            academic_session = grok.getSite()['configuration'][str(p_session)]
179        except KeyError:
180            self.flash(_(u'Session configuration object is not available.'),
181                       type='danger')
182            self.redirect(self.url(self.context, '@@index'))
183            return
184        if contr_agreement_student(student) == 'first':
185            self.product_id = PRODUCT_ID_PT
186            self.mac = MAC_PT
187        else:
188            self.product_id = PRODUCT_ID_REGULAR
189            self.mac = MAC_REGULAR
190
191        # To guarantee that cleared students pay both acceptance fee
192        # and school fees, the page can only be accessed
193        # for school fee payments if acceptance/clearance fee has
194        # been successfully queried/paid beforehand. This
195        # requirement applies to students in state 'cleared' and
196        # entry_session greater than 2012 only.
197        if self.context.p_category.startswith('schoolfee') and \
198            student.state == CLEARED and \
199            student.entry_session > 2012:
200            acceptance_fee_paid = False
201            for ticket in student['payments'].values():
202                if ticket.p_state == 'paid' and \
203                    ticket.p_category.startswith('clearance'):
204                    acceptance_fee_paid = True
205                    break
206            if not acceptance_fee_paid:
207                self.flash(
208                    _('Please pay acceptance fee first.'), type="danger")
209                self.redirect(self.url(self.context, '@@index'))
210                return
211
212        xmldict = self.xmldict
213        xmltext = ""
214        xmldict['institution_acct'] = '1010827641'
215        xmldict['institution_bank_id'] = '117'
216        xmldict['detail_ref'] = self.context.p_id
217        xmldict['provider_acct'] = PROVIDER_ACCT
218        xmldict['provider_bank_id'] = PROVIDER_BANK_ID
219        xmldict['provider_item_name'] = PROVIDER_ITEM_NAME
220        xmldict['institution_item_name'] = self.category
221        xmldict['institution_name'] = INSTITUTION_NAME
222        provider_amt = 0.0
223
224        # Schoolfee
225        if self.context.p_category.startswith('schoolfee'):
226            if contr_agreement_student(student) == 'first':
227                # First agreement
228                provider_amt = 1900.0
229                joint_venture_amt = 1100.0
230                aaue_share_amt = 1000.0
231                student_union_due_amt = gateway_net_amt(
232                    academic_session.union_fee)
233                student_welfare_assurance_amt = gateway_net_amt(
234                    academic_session.welfare_fee)
235                xmldict['student_union_bank_id'] = '117'
236                xmldict['student_union_acct'] = '1010827641'
237                xmldict['aaue_share_bank_id'] = '117'
238                xmldict['aaue_share_acct'] = '1010827641'
239                xmldict['joint_venture_bank_id'] = '117'
240                xmldict['joint_venture_acct'] = '1010827641'
241                if student.current_mode == 'found':
242                    self.pay_item_id = '103'
243                else:
244                    self.pay_item_id = '105'
245            else:
246                # Second agreement
247                provider_amt = 1500.0
248                joint_venture_amt = 1000.0
249                aaue_share_amt = 1500.0
250                student_union_due_amt = gateway_net_amt(
251                    academic_session.union_fee)
252                student_welfare_assurance_amt = gateway_net_amt(
253                    academic_session.welfare_fee)
254                xmldict['student_union_bank_id'] = '117'
255                xmldict['student_union_acct'] = '1010827641'
256                xmldict['aaue_share_bank_id'] = '117'
257                xmldict['aaue_share_acct'] = '1010827641'
258                xmldict['joint_venture_bank_id'] = '117'
259                xmldict['joint_venture_acct'] = '1010827641'
260                self.pay_item_id = '107'
261                if student.is_postgrad:
262                    self.pay_item_id = '111'
263                if student.current_mode == 'ijmbe':
264                    self.pay_item_id = '119'
265                    xmldict['joint_venture_bank_id'] = '117'
266                    xmldict['joint_venture_acct'] = '1010827641'
267
268            xmldict['provider_amt'] = 100 * provider_amt
269            xmldict['joint_venture_amt'] = 100 * joint_venture_amt
270            xmldict['aaue_share_amt'] = 100 * aaue_share_amt
271            if self.context.p_item == 'Balance':
272                xmldict['institution_amt'] = 100 * (
273                    gateway_net_amt(self.context.amount_auth))
274            elif self.context.p_category in ('schoolfee_incl', 'schoolfee_1'):
275                # Schoolfee including additional fees
276                xmldict['student_union_due_amt'] = 100 * student_union_due_amt
277                xmldict['student_welfare_assurance_amt'] = 100 * student_welfare_assurance_amt
278                xmldict['institution_amt'] = 100 * (
279                    gateway_net_amt(self.context.amount_auth)
280                    - provider_amt
281                    - joint_venture_amt
282                    - aaue_share_amt
283                    - student_union_due_amt
284                    - student_welfare_assurance_amt)
285                xmltext = """<payment_item_detail>
286<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
287<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" />
288<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" />
289<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" />
290<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" />
291<item_detail item_id="5" item_name="Student Union" item_amt="%(student_union_due_amt)d" bank_id="%(student_union_bank_id)s" acct_num="%(student_union_acct)s" />
292<item_detail item_id="6" item_name="Student Welfare Assurance" item_amt="%(student_welfare_assurance_amt)d" bank_id="117" acct_num="1010827641" />
293</item_details>
294</payment_item_detail>""" % xmldict
295            else:
296                # Schoolfee without additional fees
297                xmldict['institution_amt'] = 100 * (
298                    gateway_net_amt(self.context.amount_auth)
299                    - provider_amt
300                    - joint_venture_amt
301                    - aaue_share_amt)
302                xmltext = """<payment_item_detail>
303<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
304<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" />
305<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" />
306<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" />
307<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" />
308</item_details>
309</payment_item_detail>""" % xmldict
310
311
312        # Clearance
313        elif self.context.p_category.startswith('clearance'):
314            if contr_agreement_student(student) == 'first':
315                # First agreement
316                if student.current_mode == 'found':
317                    self.pay_item_id = '102'
318                else:
319                    self.pay_item_id = '104'
320            else:
321                # Second agreement
322                self.pay_item_id = '102'
323                if student.is_postgrad:
324                    self.pay_item_id = '110'
325                if student.current_mode == 'ijmbe':
326                    self.pay_item_id = '120'
327
328            if self.context.p_category.endswith('_incl'):
329                # Clearance including additional fees
330                gown_fee_amt = gateway_net_amt(academic_session.matric_gown_fee)
331                aaue_lf_fee_amt = gateway_net_amt(academic_session.lapel_fee)
332                xmldict['gown_fee_amt'] = 100 * gown_fee_amt
333                xmldict['aaue_lf_fee_amt'] = 100 * aaue_lf_fee_amt
334                xmldict['institution_amt'] = 100 * (
335                    gateway_net_amt(self.context.amount_auth)
336                    - gown_fee_amt
337                    - aaue_lf_fee_amt)
338                xmltext = """<payment_item_detail>
339<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
340<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" />
341<item_detail item_id="2" item_name="Matriculation Gown Fee" item_amt="%(gown_fee_amt)d" bank_id="117" acct_num="1010827641" />
342<item_detail item_id="3" item_name="AAU File-Lapel Fee" item_amt="%(aaue_lf_fee_amt)d" bank_id="117" acct_num="1010827641" />
343</item_details>
344</payment_item_detail>""" % xmldict
345
346            else:
347                # Clearance without additional fees
348                xmldict['institution_amt'] = 100 * (
349                    gateway_net_amt(self.context.amount_auth))
350
351        # Union Dues
352        elif self.context.p_category == 'union':
353            self.pay_item_id = '103'
354            xmldict['institution_amt'] = 100 * (
355                gateway_net_amt(self.context.amount_auth))
356
357        # Lapel/File
358        elif self.context.p_category == 'lapel':
359            self.pay_item_id = '104'
360            xmldict['institution_amt'] = 100 * (
361                gateway_net_amt(self.context.amount_auth))
362
363        # Welfare Assurance
364        elif self.context.p_category == 'welfare':
365            self.pay_item_id = '105'
366            xmldict['institution_amt'] = 100 * (
367                gateway_net_amt(self.context.amount_auth))
368
369        # ID Card
370        elif self.context.p_category == 'id_card':
371            self.pay_item_id = '000'
372            xmldict['institution_amt'] = 100 * (
373                gateway_net_amt(self.context.amount_auth))
374
375        # Matric Gown
376        elif self.context.p_category == 'matric_gown':
377            self.pay_item_id = '106'
378            xmldict['institution_amt'] = 100 * (
379                gateway_net_amt(self.context.amount_auth))
380
381        # Concessional
382        elif self.context.p_category == 'concessional':
383            self.pay_item_id = '107'
384            xmldict['institution_amt'] = 100 * (
385                gateway_net_amt(self.context.amount_auth))
386
387        # Hostel Maintenance
388        elif self.context.p_category == 'hostel_maintenance':
389            provider_amt = 500.0
390            self.pay_item_id = '109'
391            xmldict['provider_amt'] = 100 * provider_amt
392            xmldict['institution_amt'] = 100 * (
393                gateway_net_amt(self.context.amount_auth) - provider_amt)
394            xmltext = """<payment_item_detail>
395<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
396<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" />
397<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" />
398</item_details>
399</payment_item_detail>""" % xmldict
400
401        # GST Fees
402        elif self.context.p_category.startswith('gst_'):
403            if contr_agreement_student(student) == 'first':
404                self.pay_item_id = '115'
405            else:
406                self.pay_item_id = '116'
407            xmldict['institution_amt'] = 100 * (
408                gateway_net_amt(self.context.amount_auth))
409
410        # ENT Fees
411        elif self.context.p_category.startswith('ent_'):
412            if contr_agreement_student(student) == 'first':
413                self.pay_item_id = '114'
414            else:
415                self.pay_item_id = '118'
416            xmldict['institution_amt'] = 100 * (
417                gateway_net_amt(self.context.amount_auth))
418
419        # Faculty and Departmental Dues
420        elif self.context.p_category == 'fac_dep':
421            self.pay_item_id = '117'
422            xmldict['institution_amt'] = 100 * (
423                gateway_net_amt(self.context.amount_auth))
424
425        # Restitution Fee
426        elif self.context.p_category == 'restitution':
427            self.pay_item_id = '117'
428            xmldict['institution_amt'] = 100 * (
429                gateway_net_amt(self.context.amount_auth))
430
431        # Late Registration Fee
432        elif self.context.p_category == 'late_registration':
433            if contr_agreement_student(student) == 'first':
434                self.pay_item_id = '113'
435            else:
436                self.pay_item_id = '123'
437            xmldict['institution_amt'] = 100 * (
438                gateway_net_amt(self.context.amount_auth))
439
440        if not xmltext:
441            xmltext = """<payment_item_detail>
442<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
443<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" />
444</item_details>
445</payment_item_detail>""" % xmldict
446        self.xml_data = """<input type="hidden" name="xml_data" value='%s'  />""" % xmltext
447        self.context.provider_amt = provider_amt
448        self.context.gateway_amt = self.amount_auth - gateway_net_amt(
449            self.amount_auth)
450        hashargs = (
451            self.context.p_id +
452            self.product_id +
453            self.pay_item_id +
454            str(int(self.amount_auth)) +
455            self.site_redirect_url +
456            self.mac)
457        self.hashvalue = hashlib.sha512(hashargs).hexdigest()
458        return
459
460
461class CustomInterswitchPaymentRequestWebservicePageApplicant(
462    InterswitchPaymentRequestWebservicePageApplicant):
463    """Request webservice view for the CollegePAY gateway
464    """
465    grok.context(ICustomApplicantOnlinePayment)
466    gateway_host = HOST
467    gateway_url = URL
468    https = HTTPS
469
470    @property
471    def mac(self):
472        if contr_agreement_applicant(self.context.__parent__) == 'first':
473            return MAC_PT
474        return MAC_REGULAR
475
476    @property
477    def product_id(self):
478        if contr_agreement_applicant(self.context.__parent__) == 'first':
479            return PRODUCT_ID_PT
480        return PRODUCT_ID_REGULAR
481
482class CustomInterswitchPaymentVerifyWebservicePageApplicant(
483    InterswitchPaymentVerifyWebservicePageApplicant):
484    """Payment verify view for the CollegePAY gateway
485    """
486    grok.context(ICustomApplicantOnlinePayment)
487    gateway_host = HOST
488    gateway_url = URL
489    https = HTTPS
490
491    @property
492    def mac(self):
493        if contr_agreement_applicant(self.context.__parent__) == 'first':
494            return MAC_PT
495        return MAC_REGULAR
496
497    @property
498    def product_id(self):
499        if contr_agreement_applicant(self.context.__parent__) == 'first':
500            return PRODUCT_ID_PT
501        return PRODUCT_ID_REGULAR
502
503class CustomInterswitchPaymentRequestWebservicePageStudent(
504    InterswitchPaymentRequestWebservicePageStudent):
505    """Request webservice view for the CollegePAY gateway
506    """
507    grok.context(ICustomStudentOnlinePayment)
508    gateway_host = HOST
509    gateway_url = URL
510    https = HTTPS
511
512    @property
513    def mac(self):
514        if contr_agreement_student(self.context.student) == 'first':
515            return MAC_PT
516        return MAC_REGULAR
517
518    @property
519    def product_id(self):
520        if contr_agreement_student(self.context.student) == 'first':
521            return PRODUCT_ID_PT
522        return PRODUCT_ID_REGULAR
523
524class CustomInterswitchPaymentVerifyWebservicePageStudent(
525    InterswitchPaymentVerifyWebservicePageStudent):
526    """Payment verify view for the CollegePAY gateway
527    """
528    grok.context(ICustomStudentOnlinePayment)
529    gateway_host = HOST
530    gateway_url = URL
531    https = HTTPS
532
533    @property
534    def mac(self):
535        if contr_agreement_student(self.context.student) == 'first':
536            return MAC_PT
537        return MAC_REGULAR
538
539    @property
540    def product_id(self):
541        if contr_agreement_student(self.context.student) == 'first':
542            return PRODUCT_ID_PT
543        return PRODUCT_ID_REGULAR
Note: See TracBrowser for help on using the repository browser.