[12730] | 1 | ## $Id: browser.py 15524 2019-07-28 20:54:21Z henrik $ |
---|
[11846] | 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 | ## |
---|
| 18 | import httplib |
---|
| 19 | import hashlib |
---|
| 20 | import grok |
---|
[15473] | 21 | from xml.dom import minidom |
---|
[11846] | 22 | from zope.interface import Interface |
---|
| 23 | from zope.component import queryAdapter |
---|
[12975] | 24 | from waeup.kofa.interfaces import CLEARED |
---|
[11846] | 25 | from kofacustom.nigeria.interswitch.browser import ( |
---|
| 26 | InterswitchPaymentRequestWebservicePageStudent, |
---|
| 27 | InterswitchPaymentRequestWebservicePageApplicant, |
---|
[13586] | 28 | InterswitchPaymentVerifyWebservicePageApplicant, |
---|
| 29 | InterswitchPaymentVerifyWebservicePageStudent, |
---|
[11846] | 30 | InterswitchPageStudent, InterswitchPageApplicant, |
---|
| 31 | ) |
---|
| 32 | from waeup.aaue.students.interfaces import ICustomStudentOnlinePayment |
---|
| 33 | from waeup.aaue.applicants.interfaces import ICustomApplicantOnlinePayment |
---|
| 34 | from waeup.aaue.interfaces import MessageFactory as _ |
---|
| 35 | |
---|
[13379] | 36 | PRODUCT_ID_PT = '5040' |
---|
| 37 | PRODUCT_ID_REGULAR = '5845' |
---|
[11846] | 38 | SITE_NAME = 'aaue.waeup.org' |
---|
[15480] | 39 | PROVIDER_ACCT = '0213065415' |
---|
| 40 | PROVIDER_BANK_ID = '47' |
---|
[14823] | 41 | PROVIDER_ITEM_NAME = 'WAeAC' |
---|
[11846] | 42 | INSTITUTION_NAME = 'AAU Ekpoma' |
---|
| 43 | CURRENCY = '566' |
---|
[11934] | 44 | GATEWAY_AMT = 250.0 |
---|
[11933] | 45 | POST_ACTION = 'https://webpay.interswitchng.com/paydirect/pay' |
---|
[11846] | 46 | |
---|
[11933] | 47 | HOST = 'webpay.interswitchng.com' |
---|
[13586] | 48 | URL = '/paydirect/api/v1/gettransaction.json' |
---|
[11916] | 49 | HTTPS = True |
---|
[13606] | 50 | MAC_REGULAR = '9718FA00B0F5070B388A9896ADCED9B2FB02D30F71E12E68BDADC63F6852A3496FF97D8A0F9DA9F753B911A49BB09BB87B55FD02046BD325C74C46C0123CF023' |
---|
| 51 | MAC_PT = '74424F1DFECD6058F153148255CDD55E16724B4F380ADB2C63C5D1D7A5675759010C8153DCB930AAF2D38903CBF7CE32B8A6BA2C16BBC46721DF2E3F3E4548E3' |
---|
[11846] | 52 | |
---|
[11917] | 53 | httplib.HTTPSConnection.debuglevel = 0 |
---|
[11846] | 54 | |
---|
[13379] | 55 | |
---|
[13414] | 56 | def gateway_net_amt(fee): |
---|
[13438] | 57 | if fee > GATEWAY_AMT: |
---|
[13414] | 58 | return fee - GATEWAY_AMT |
---|
[13438] | 59 | return 0.0 |
---|
[13406] | 60 | |
---|
[13532] | 61 | def contr_agreement_applicant(applicant): |
---|
[15396] | 62 | if applicant.__parent__ in ( |
---|
| 63 | 'fp', |
---|
| 64 | 'ptee', |
---|
| 65 | 'dsh', |
---|
| 66 | 'bridge', |
---|
| 67 | 'ijmbe', |
---|
| 68 | ): |
---|
[13532] | 69 | return 'first' |
---|
| 70 | return 'second' |
---|
| 71 | |
---|
| 72 | def contr_agreement_student(student): |
---|
[15382] | 73 | if student.current_mode in ( |
---|
[15387] | 74 | 'found', |
---|
| 75 | 'bridge', |
---|
| 76 | 'ug_dsh', |
---|
| 77 | 'de_dsh', |
---|
| 78 | 'ug_pt', |
---|
| 79 | 'de_pt', |
---|
[15396] | 80 | 'dp_pt', |
---|
| 81 | 'ijmbe', |
---|
| 82 | ): |
---|
[13403] | 83 | return 'first' |
---|
| 84 | return 'second' |
---|
[13379] | 85 | |
---|
[11846] | 86 | class CustomInterswitchPageApplicant(InterswitchPageApplicant): |
---|
| 87 | """ View which sends a POST request to the Interswitch |
---|
| 88 | CollegePAY payment gateway. |
---|
[13379] | 89 | |
---|
| 90 | So far only PT application has been configured. |
---|
[11846] | 91 | """ |
---|
| 92 | grok.context(ICustomApplicantOnlinePayment) |
---|
| 93 | action = POST_ACTION |
---|
| 94 | site_name = SITE_NAME |
---|
| 95 | currency = CURRENCY |
---|
[15135] | 96 | provider_bank_id = PROVIDER_BANK_ID |
---|
| 97 | provider_acct = PROVIDER_ACCT |
---|
[15224] | 98 | institution_acct = '1010835352' |
---|
| 99 | institution_bank_id = '117' |
---|
[11846] | 100 | |
---|
| 101 | def update(self): |
---|
| 102 | |
---|
[12975] | 103 | error = self.init_update() |
---|
| 104 | if error: |
---|
| 105 | self.flash(error, type='danger') |
---|
| 106 | self.redirect(self.url(self.context, '@@index')) |
---|
| 107 | return |
---|
[15260] | 108 | provider_amt = 2000.0 |
---|
[13532] | 109 | if contr_agreement_applicant(self.context.__parent__) == 'first': |
---|
| 110 | self.product_id = PRODUCT_ID_PT |
---|
| 111 | self.pay_item_id = '101' |
---|
[13606] | 112 | self.mac = MAC_PT |
---|
[13532] | 113 | else: |
---|
| 114 | self.product_id = PRODUCT_ID_REGULAR |
---|
| 115 | self.pay_item_id = '109' |
---|
[13606] | 116 | self.mac = MAC_REGULAR |
---|
[15464] | 117 | if self.applicant.__parent__.prefix in ('utme', 'ude'): |
---|
| 118 | provider_amt = 1000.0 |
---|
[15524] | 119 | elif self.applicant.__parent__.prefix in ('trans', 'cert'): |
---|
[15512] | 120 | self.institution_acct = '1010827641' |
---|
| 121 | self.institution_bank_id = '117' |
---|
[15135] | 122 | self.provider_bank_id = '10' |
---|
| 123 | self.provider_acct = '0427773399' |
---|
[15512] | 124 | if self.applicant.applicant_id[:5] in ('cert7', 'cert8'): |
---|
| 125 | provider_amt = 0.0 |
---|
| 126 | if self.applicant.applicant_id[:6] in ('trans5', 'trans6'): |
---|
| 127 | self.institution_acct = '5210006575' |
---|
[15520] | 128 | self.institution_bank_id = '51' |
---|
[15524] | 129 | elif self.applicant.applicant_id.startswith('bridge'): # easier to test |
---|
[15224] | 130 | self.institution_acct = '1014847058' |
---|
| 131 | self.institution_bank_id = '7' |
---|
[15524] | 132 | elif self.applicant.applicant_id.startswith('dsh'): # easier to test |
---|
| 133 | self.institution_acct = '1014847058' |
---|
| 134 | self.institution_bank_id = '7' |
---|
[11846] | 135 | xmldict = {} |
---|
| 136 | xmldict['detail_ref'] = self.context.p_id |
---|
| 137 | xmldict['provider_amt'] = 100 * provider_amt |
---|
[15135] | 138 | xmldict['provider_acct'] = self.provider_acct |
---|
| 139 | xmldict['provider_bank_id'] = self.provider_bank_id |
---|
[11846] | 140 | xmldict['provider_item_name'] = PROVIDER_ITEM_NAME |
---|
[15224] | 141 | xmldict['institution_acct'] = self.institution_acct |
---|
| 142 | xmldict['institution_bank_id'] = self.institution_bank_id |
---|
[13532] | 143 | xmldict['institution_item_name'] = self.category |
---|
[11846] | 144 | xmldict['institution_name'] = INSTITUTION_NAME |
---|
[15224] | 145 | xmldict['institution_amt'] = 100 * ( |
---|
| 146 | self.context.amount_auth - provider_amt - GATEWAY_AMT) |
---|
[15512] | 147 | |
---|
[15224] | 148 | xmltext = """<payment_item_detail> |
---|
| 149 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s"> |
---|
| 150 | <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" /> |
---|
| 151 | <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" /> |
---|
| 152 | </item_details> |
---|
| 153 | </payment_item_detail>""" % xmldict |
---|
[14121] | 154 | |
---|
[15512] | 155 | if provider_amt == 0.0: |
---|
| 156 | xmltext = """<payment_item_detail> |
---|
| 157 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s"> |
---|
| 158 | <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" /> |
---|
| 159 | </item_details> |
---|
| 160 | </payment_item_detail>""" % xmldict |
---|
| 161 | |
---|
[14121] | 162 | if self.applicant.applicant_id.startswith('pg'): |
---|
| 163 | handbook_amount = 2000.0 |
---|
| 164 | xmldict['handbook_amount'] = 100 * handbook_amount |
---|
| 165 | xmldict['institution_amt'] = 100 * ( |
---|
| 166 | self.context.amount_auth - provider_amt - handbook_amount -GATEWAY_AMT) |
---|
| 167 | xmltext = """<payment_item_detail> |
---|
[11846] | 168 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s"> |
---|
| 169 | <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" /> |
---|
| 170 | <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" /> |
---|
[14945] | 171 | <item_detail item_id="3" item_name="PG Handbook" item_amt="%(handbook_amount)d" bank_id="117" acct_num="1010827641" /> |
---|
[11846] | 172 | </item_details> |
---|
| 173 | </payment_item_detail>""" % xmldict |
---|
[14121] | 174 | |
---|
[11846] | 175 | self.xml_data = """<input type="hidden" name="xml_data" value='%s' />""" % xmltext |
---|
| 176 | self.context.provider_amt = provider_amt |
---|
| 177 | self.context.gateway_amt = GATEWAY_AMT |
---|
[15473] | 178 | xmlitems = '' |
---|
| 179 | xmldoc = minidom.parseString(xmltext) |
---|
| 180 | itemlist = xmldoc.getElementsByTagName('item_detail') |
---|
| 181 | for s in itemlist: |
---|
| 182 | xmlitems += "%s: %s, N%s, %s (%s) " % ( |
---|
| 183 | s.attributes['item_id'].value, |
---|
| 184 | s.attributes['item_name'].value, |
---|
| 185 | int(s.attributes['item_amt'].value)/100, |
---|
| 186 | s.attributes['acct_num'].value, |
---|
| 187 | s.attributes['bank_id'].value, |
---|
| 188 | ) |
---|
| 189 | self.context.p_split_data = xmlitems |
---|
[11846] | 190 | hashargs = ( |
---|
| 191 | self.context.p_id + |
---|
[13532] | 192 | self.product_id + |
---|
[11846] | 193 | self.pay_item_id + |
---|
| 194 | str(int(self.amount_auth)) + |
---|
| 195 | self.site_redirect_url + |
---|
| 196 | self.mac) |
---|
| 197 | self.hashvalue = hashlib.sha512(hashargs).hexdigest() |
---|
| 198 | |
---|
| 199 | return |
---|
| 200 | |
---|
[11868] | 201 | class CustomInterswitchPageStudent(InterswitchPageStudent): |
---|
| 202 | """ View which sends a POST request to the Interswitch |
---|
| 203 | CollegePAY payment gateway. |
---|
| 204 | """ |
---|
| 205 | grok.context(ICustomStudentOnlinePayment) |
---|
| 206 | action = POST_ACTION |
---|
| 207 | site_name = SITE_NAME |
---|
| 208 | currency = CURRENCY |
---|
[14248] | 209 | pay_item_id = '000' |
---|
[11846] | 210 | |
---|
[11868] | 211 | def update(self): |
---|
[12975] | 212 | error = self.init_update() |
---|
[13376] | 213 | |
---|
[12975] | 214 | if error: |
---|
| 215 | self.flash(error, type='danger') |
---|
| 216 | self.redirect(self.url(self.context, '@@index')) |
---|
| 217 | return |
---|
[13400] | 218 | |
---|
[11868] | 219 | student = self.student |
---|
[13408] | 220 | p_session = self.context.p_session |
---|
[13400] | 221 | try: |
---|
[13408] | 222 | academic_session = grok.getSite()['configuration'][str(p_session)] |
---|
[13400] | 223 | except KeyError: |
---|
[13407] | 224 | self.flash(_(u'Session configuration object is not available.'), |
---|
| 225 | type='danger') |
---|
[13400] | 226 | self.redirect(self.url(self.context, '@@index')) |
---|
| 227 | return |
---|
[13532] | 228 | if contr_agreement_student(student) == 'first': |
---|
[13382] | 229 | self.product_id = PRODUCT_ID_PT |
---|
[13606] | 230 | self.mac = MAC_PT |
---|
[13382] | 231 | else: |
---|
| 232 | self.product_id = PRODUCT_ID_REGULAR |
---|
[13606] | 233 | self.mac = MAC_REGULAR |
---|
[13382] | 234 | |
---|
[12975] | 235 | # To guarantee that cleared students pay both acceptance fee |
---|
| 236 | # and school fees, the page can only be accessed |
---|
| 237 | # for school fee payments if acceptance/clearance fee has |
---|
| 238 | # been successfully queried/paid beforehand. This |
---|
| 239 | # requirement applies to students in state 'cleared' and |
---|
[14380] | 240 | # entry_session greater than 2012 only. |
---|
[13400] | 241 | if self.context.p_category.startswith('schoolfee') and \ |
---|
[12975] | 242 | student.state == CLEARED and \ |
---|
| 243 | student.entry_session > 2012: |
---|
| 244 | acceptance_fee_paid = False |
---|
| 245 | for ticket in student['payments'].values(): |
---|
| 246 | if ticket.p_state == 'paid' and \ |
---|
[13400] | 247 | ticket.p_category.startswith('clearance'): |
---|
[12975] | 248 | acceptance_fee_paid = True |
---|
| 249 | break |
---|
| 250 | if not acceptance_fee_paid: |
---|
| 251 | self.flash( |
---|
| 252 | _('Please pay acceptance fee first.'), type="danger") |
---|
| 253 | self.redirect(self.url(self.context, '@@index')) |
---|
| 254 | return |
---|
| 255 | |
---|
[11868] | 256 | xmldict = self.xmldict |
---|
[12729] | 257 | xmltext = "" |
---|
[14945] | 258 | xmldict['institution_acct'] = '1010827641' |
---|
| 259 | xmldict['institution_bank_id'] = '117' |
---|
[11868] | 260 | xmldict['detail_ref'] = self.context.p_id |
---|
| 261 | xmldict['provider_acct'] = PROVIDER_ACCT |
---|
| 262 | xmldict['provider_bank_id'] = PROVIDER_BANK_ID |
---|
| 263 | xmldict['provider_item_name'] = PROVIDER_ITEM_NAME |
---|
| 264 | xmldict['institution_item_name'] = self.category |
---|
| 265 | xmldict['institution_name'] = INSTITUTION_NAME |
---|
[13381] | 266 | provider_amt = 0.0 |
---|
[12729] | 267 | |
---|
[13400] | 268 | # Schoolfee |
---|
| 269 | if self.context.p_category.startswith('schoolfee'): |
---|
[13532] | 270 | if contr_agreement_student(student) == 'first': |
---|
[13403] | 271 | # First agreement |
---|
[15479] | 272 | provider_amt = 1900.0 |
---|
[15387] | 273 | joint_venture_amt = 0.0 |
---|
| 274 | aaue_share_amt = 0.0 |
---|
[13414] | 275 | student_union_due_amt = gateway_net_amt( |
---|
| 276 | academic_session.union_fee) |
---|
| 277 | student_welfare_assurance_amt = gateway_net_amt( |
---|
| 278 | academic_session.welfare_fee) |
---|
[15180] | 279 | sports_amt = gateway_net_amt( |
---|
| 280 | academic_session.sports_fee) |
---|
| 281 | library_amt = gateway_net_amt( |
---|
| 282 | academic_session.library_fee) |
---|
[15181] | 283 | library_amt_pg = gateway_net_amt( |
---|
| 284 | academic_session.library_fee_pg) |
---|
[14980] | 285 | xmldict['student_union_bank_id'] = '31' |
---|
| 286 | xmldict['student_union_acct'] = '0051005007' |
---|
[15384] | 287 | xmldict['aaue_share_bank_id'] = '117' |
---|
| 288 | xmldict['aaue_share_acct'] = '1010827641' |
---|
| 289 | xmldict['joint_venture_bank_id'] = '117' |
---|
| 290 | xmldict['joint_venture_acct'] = '1010827641' |
---|
[15359] | 291 | xmldict['institution_acct'] = '1014847058' |
---|
| 292 | xmldict['institution_bank_id'] = '7' |
---|
[13379] | 293 | if student.current_mode == 'found': |
---|
| 294 | self.pay_item_id = '103' |
---|
| 295 | else: |
---|
| 296 | self.pay_item_id = '105' |
---|
[13400] | 297 | else: |
---|
[13403] | 298 | # Second agreement |
---|
[15384] | 299 | joint_venture_amt = 1000.0 |
---|
| 300 | aaue_share_amt = 1500.0 |
---|
[15479] | 301 | provider_amt = 1500.0 |
---|
[13414] | 302 | student_union_due_amt = gateway_net_amt( |
---|
| 303 | academic_session.union_fee) |
---|
| 304 | student_welfare_assurance_amt = gateway_net_amt( |
---|
| 305 | academic_session.welfare_fee) |
---|
[15180] | 306 | sports_amt = gateway_net_amt( |
---|
| 307 | academic_session.sports_fee) |
---|
| 308 | library_amt = gateway_net_amt( |
---|
| 309 | academic_session.library_fee) |
---|
[15181] | 310 | library_amt_pg = gateway_net_amt( |
---|
| 311 | academic_session.library_fee_pg) |
---|
[14980] | 312 | xmldict['student_union_bank_id'] = '7' |
---|
| 313 | xmldict['student_union_acct'] = '1019763348' |
---|
[15384] | 314 | xmldict['aaue_share_bank_id'] = '117' |
---|
| 315 | xmldict['aaue_share_acct'] = '1010827641' |
---|
| 316 | xmldict['joint_venture_bank_id'] = '117' |
---|
| 317 | xmldict['joint_venture_acct'] = '1010827641' |
---|
[13644] | 318 | self.pay_item_id = '107' |
---|
[13527] | 319 | if student.is_postgrad: |
---|
| 320 | self.pay_item_id = '111' |
---|
[15460] | 321 | xmldict['institution_acct'] = '5210006575' |
---|
| 322 | xmldict['institution_bank_id'] = '51' |
---|
[14469] | 323 | if student.current_mode == 'ijmbe': |
---|
[14523] | 324 | self.pay_item_id = '119' |
---|
[14469] | 325 | xmldict['joint_venture_bank_id'] = '117' |
---|
[14945] | 326 | xmldict['joint_venture_acct'] = '1010827641' |
---|
[13400] | 327 | |
---|
| 328 | xmldict['provider_amt'] = 100 * provider_amt |
---|
[15384] | 329 | xmldict['joint_venture_amt'] = 100 * joint_venture_amt |
---|
| 330 | xmldict['aaue_share_amt'] = 100 * aaue_share_amt |
---|
[13732] | 331 | if self.context.p_item == 'Balance': |
---|
| 332 | xmldict['institution_amt'] = 100 * ( |
---|
| 333 | gateway_net_amt(self.context.amount_auth)) |
---|
[15479] | 334 | |
---|
| 335 | |
---|
| 336 | elif self.context.p_category == 'schoolfee_2': |
---|
| 337 | xmldict['institution_amt'] = 100 * gateway_net_amt( |
---|
| 338 | self.context.amount_auth) |
---|
| 339 | xmltext = """<payment_item_detail> |
---|
| 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="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" /> |
---|
| 342 | </item_details> |
---|
| 343 | </payment_item_detail>""" % xmldict |
---|
[14987] | 344 | elif self.context.p_category in ('schoolfee_incl', 'schoolfee_1') \ |
---|
| 345 | and student.current_mode != 'ijmbe': |
---|
[13400] | 346 | # Schoolfee including additional fees |
---|
[13379] | 347 | xmldict['student_union_due_amt'] = 100 * student_union_due_amt |
---|
| 348 | xmldict['student_welfare_assurance_amt'] = 100 * student_welfare_assurance_amt |
---|
[15192] | 349 | |
---|
| 350 | if student.entry_session == 2018 and student.is_fresh: |
---|
| 351 | xmldict['sports_amt'] = 100 * sports_amt |
---|
| 352 | if student.is_postgrad: |
---|
| 353 | xmldict['library_amt'] = 100 * library_amt_pg |
---|
| 354 | else: |
---|
| 355 | xmldict['library_amt'] = 100 * library_amt |
---|
| 356 | xmldict['institution_amt'] = 100 * ( |
---|
| 357 | gateway_net_amt(self.context.amount_auth) |
---|
| 358 | - provider_amt |
---|
[15384] | 359 | - joint_venture_amt |
---|
| 360 | - aaue_share_amt |
---|
[15192] | 361 | - student_union_due_amt |
---|
| 362 | - student_welfare_assurance_amt |
---|
| 363 | - sports_amt |
---|
| 364 | - library_amt) |
---|
| 365 | xmltext = """<payment_item_detail> |
---|
[11868] | 366 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 367 | <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" /> |
---|
[12729] | 368 | <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" /> |
---|
[15387] | 369 | <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" /> |
---|
| 370 | <item_detail item_id="4" item_name="Student Welfare Assurance" item_amt="%(student_welfare_assurance_amt)d" bank_id="123" acct_num="1006407792" /> |
---|
| 371 | <item_detail item_id="5" item_name="Sports Development Fee" item_amt="%(sports_amt)d" bank_id="123" acct_num="1006407792" /> |
---|
| 372 | <item_detail item_id="6" item_name="Library Development Fee" item_amt="%(library_amt)d" bank_id="8" acct_num="2000122995" />""" % xmldict |
---|
| 373 | if contr_agreement_student(student) == 'second': |
---|
| 374 | xmltext += """" |
---|
| 375 | <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" /> |
---|
| 376 | <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" /> |
---|
[11868] | 377 | </item_details> |
---|
| 378 | </payment_item_detail>""" % xmldict |
---|
[15387] | 379 | else: |
---|
| 380 | xmltext += """" |
---|
| 381 | </item_details> |
---|
[15396] | 382 | </payment_item_detail>""" |
---|
[15192] | 383 | else: |
---|
| 384 | xmldict['institution_amt'] = 100 * ( |
---|
| 385 | gateway_net_amt(self.context.amount_auth) |
---|
| 386 | - provider_amt |
---|
[15384] | 387 | - joint_venture_amt |
---|
| 388 | - aaue_share_amt |
---|
[15192] | 389 | - student_union_due_amt |
---|
| 390 | - student_welfare_assurance_amt) |
---|
| 391 | xmltext = """<payment_item_detail> |
---|
| 392 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 393 | <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" /> |
---|
| 394 | <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" /> |
---|
[15387] | 395 | <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" /> |
---|
| 396 | <item_detail item_id="4" item_name="Student Welfare Assurance" item_amt="%(student_welfare_assurance_amt)d" bank_id="123" acct_num="1006407792" />""" % xmldict |
---|
| 397 | if contr_agreement_student(student) == 'second': |
---|
| 398 | xmltext += """" |
---|
| 399 | <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" /> |
---|
| 400 | <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" /> |
---|
[15192] | 401 | </item_details> |
---|
| 402 | </payment_item_detail>""" % xmldict |
---|
[15387] | 403 | else: |
---|
| 404 | xmltext += """" |
---|
| 405 | </item_details> |
---|
[15396] | 406 | </payment_item_detail>""" |
---|
[15387] | 407 | elif contr_agreement_student(student) == 'second': |
---|
| 408 | # Schoolfee without Student Union Fee ands Student Welfare Assurance |
---|
[15384] | 409 | xmldict['institution_amt'] = 100 * ( |
---|
| 410 | gateway_net_amt(self.context.amount_auth) |
---|
[15387] | 411 | - provider_amt |
---|
| 412 | - joint_venture_amt |
---|
| 413 | - aaue_share_amt) |
---|
[15384] | 414 | xmltext = """<payment_item_detail> |
---|
| 415 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 416 | <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" /> |
---|
| 417 | <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" /> |
---|
[15387] | 418 | <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" /> |
---|
| 419 | <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" /> |
---|
[15384] | 420 | </item_details> |
---|
| 421 | </payment_item_detail>""" % xmldict |
---|
[13400] | 422 | else: |
---|
| 423 | xmldict['institution_amt'] = 100 * ( |
---|
[13414] | 424 | gateway_net_amt(self.context.amount_auth) |
---|
[15387] | 425 | - provider_amt) |
---|
[13400] | 426 | xmltext = """<payment_item_detail> |
---|
| 427 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 428 | <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" /> |
---|
| 429 | <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" /> |
---|
| 430 | </item_details> |
---|
| 431 | </payment_item_detail>""" % xmldict |
---|
| 432 | |
---|
| 433 | |
---|
| 434 | # Clearance |
---|
| 435 | elif self.context.p_category.startswith('clearance'): |
---|
[15467] | 436 | provider_amt = 0.0 |
---|
[13532] | 437 | if contr_agreement_student(student) == 'first': |
---|
[13403] | 438 | # First agreement |
---|
[13379] | 439 | if student.current_mode == 'found': |
---|
| 440 | self.pay_item_id = '102' |
---|
| 441 | else: |
---|
| 442 | self.pay_item_id = '104' |
---|
[15359] | 443 | xmldict['institution_acct'] = '1014847058' |
---|
| 444 | xmldict['institution_bank_id'] = '7' |
---|
[13400] | 445 | else: |
---|
[13403] | 446 | # Second agreement |
---|
[13400] | 447 | self.pay_item_id = '102' |
---|
[13527] | 448 | if student.is_postgrad: |
---|
| 449 | self.pay_item_id = '110' |
---|
[15463] | 450 | xmldict['institution_acct'] = '5210006575' |
---|
| 451 | xmldict['institution_bank_id'] = '51' |
---|
[14469] | 452 | if student.current_mode == 'ijmbe': |
---|
[14523] | 453 | self.pay_item_id = '120' |
---|
[15467] | 454 | # ivama: Acceptance fee split is unique to "ug_ft" |
---|
| 455 | # The reason for split is perculiar to them only... |
---|
| 456 | # That amount was deducted from UTME application fee because |
---|
| 457 | # some regulatory body have pegged the application fee which |
---|
| 458 | # didn't affect another programmes. |
---|
| 459 | if student.current_mode == 'ug_ft': |
---|
| 460 | provider_amt = 1500.0 |
---|
| 461 | xmldict['provider_amt'] = 100 * provider_amt |
---|
[13410] | 462 | if self.context.p_category.endswith('_incl'): |
---|
[13400] | 463 | # Clearance including additional fees |
---|
[13414] | 464 | gown_fee_amt = gateway_net_amt(academic_session.matric_gown_fee) |
---|
| 465 | aaue_lf_fee_amt = gateway_net_amt(academic_session.lapel_fee) |
---|
[13379] | 466 | xmldict['gown_fee_amt'] = 100 * gown_fee_amt |
---|
[13414] | 467 | xmldict['aaue_lf_fee_amt'] = 100 * aaue_lf_fee_amt |
---|
[13379] | 468 | xmldict['institution_amt'] = 100 * ( |
---|
[13414] | 469 | gateway_net_amt(self.context.amount_auth) |
---|
[13409] | 470 | - gown_fee_amt |
---|
[15190] | 471 | - aaue_lf_fee_amt |
---|
| 472 | - provider_amt) |
---|
[13379] | 473 | xmltext = """<payment_item_detail> |
---|
[11868] | 474 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 475 | <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" /> |
---|
[14920] | 476 | <item_detail item_id="2" item_name="Matriculation Gown Fee" item_amt="%(gown_fee_amt)d" bank_id="117" acct_num="1010827641" /> |
---|
[15391] | 477 | <item_detail item_id="3" item_name="AAU File-Lapel Fee" item_amt="%(aaue_lf_fee_amt)d" bank_id="117" acct_num="1010827641" />""" % xmldict |
---|
[15467] | 478 | if provider_amt: |
---|
[15391] | 479 | xmltext += """" |
---|
[15168] | 480 | <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" /> |
---|
[11868] | 481 | </item_details> |
---|
| 482 | </payment_item_detail>""" % xmldict |
---|
[15391] | 483 | else: |
---|
| 484 | xmltext += """" |
---|
| 485 | </item_details> |
---|
[15396] | 486 | </payment_item_detail>""" |
---|
[13400] | 487 | |
---|
[15375] | 488 | elif student.current_mode == 'bridge': |
---|
| 489 | # Clearance without any surcharge |
---|
| 490 | xmldict['institution_amt'] = 100 * gateway_net_amt( |
---|
| 491 | self.context.amount_auth) |
---|
| 492 | xmltext = """<payment_item_detail> |
---|
| 493 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 494 | <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" /> |
---|
| 495 | </item_details> |
---|
| 496 | </payment_item_detail>""" % xmldict |
---|
| 497 | |
---|
[13381] | 498 | else: |
---|
[13400] | 499 | # Clearance without additional fees |
---|
[13381] | 500 | xmldict['institution_amt'] = 100 * ( |
---|
[15190] | 501 | gateway_net_amt(self.context.amount_auth) |
---|
| 502 | - provider_amt) |
---|
[15168] | 503 | xmltext = """<payment_item_detail> |
---|
| 504 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
[15396] | 505 | <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 |
---|
[15467] | 506 | if provider_amt: |
---|
[15391] | 507 | xmltext += """" |
---|
[15168] | 508 | <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" /> |
---|
| 509 | </item_details> |
---|
| 510 | </payment_item_detail>""" % xmldict |
---|
[15391] | 511 | else: |
---|
| 512 | xmltext += """" |
---|
| 513 | </item_details> |
---|
[15396] | 514 | </payment_item_detail>""" |
---|
[13379] | 515 | |
---|
[13403] | 516 | # Union Dues |
---|
[13400] | 517 | elif self.context.p_category == 'union': |
---|
| 518 | self.pay_item_id = '103' |
---|
| 519 | xmldict['institution_amt'] = 100 * ( |
---|
[13414] | 520 | gateway_net_amt(self.context.amount_auth)) |
---|
[14980] | 521 | if contr_agreement_student(student) == 'first': |
---|
| 522 | # First agreement |
---|
| 523 | xmldict['institution_acct'] = '0051005007' |
---|
| 524 | xmldict['institution_bank_id'] = '31' |
---|
| 525 | else: |
---|
| 526 | # Second agreement |
---|
| 527 | xmldict['institution_bank_id'] = '7' |
---|
| 528 | xmldict['institution_acct'] = '1019763348' |
---|
[13379] | 529 | |
---|
[13403] | 530 | # Lapel/File |
---|
[13400] | 531 | elif self.context.p_category == 'lapel': |
---|
| 532 | self.pay_item_id = '104' |
---|
| 533 | xmldict['institution_amt'] = 100 * ( |
---|
[13414] | 534 | gateway_net_amt(self.context.amount_auth)) |
---|
[13381] | 535 | |
---|
[13403] | 536 | # Welfare Assurance |
---|
[13400] | 537 | elif self.context.p_category == 'welfare': |
---|
| 538 | self.pay_item_id = '105' |
---|
[14979] | 539 | xmldict['institution_acct'] = '1006407792' |
---|
| 540 | xmldict['institution_bank_id'] = '123' |
---|
[13400] | 541 | xmldict['institution_amt'] = 100 * ( |
---|
[13414] | 542 | gateway_net_amt(self.context.amount_auth)) |
---|
[13381] | 543 | |
---|
[14234] | 544 | # ID Card |
---|
| 545 | elif self.context.p_category == 'id_card': |
---|
| 546 | self.pay_item_id = '000' |
---|
| 547 | xmldict['institution_amt'] = 100 * ( |
---|
| 548 | gateway_net_amt(self.context.amount_auth)) |
---|
| 549 | |
---|
[13400] | 550 | # Matric Gown |
---|
| 551 | elif self.context.p_category == 'matric_gown': |
---|
| 552 | self.pay_item_id = '106' |
---|
| 553 | xmldict['institution_amt'] = 100 * ( |
---|
[13414] | 554 | gateway_net_amt(self.context.amount_auth)) |
---|
[13381] | 555 | |
---|
[13400] | 556 | # Concessional |
---|
| 557 | elif self.context.p_category == 'concessional': |
---|
| 558 | self.pay_item_id = '107' |
---|
| 559 | xmldict['institution_amt'] = 100 * ( |
---|
[13414] | 560 | gateway_net_amt(self.context.amount_auth)) |
---|
[13381] | 561 | |
---|
[13400] | 562 | # Hostel Maintenance |
---|
| 563 | elif self.context.p_category == 'hostel_maintenance': |
---|
[14223] | 564 | provider_amt = 500.0 |
---|
[13400] | 565 | self.pay_item_id = '109' |
---|
[14223] | 566 | xmldict['provider_amt'] = 100 * provider_amt |
---|
[13400] | 567 | xmldict['institution_amt'] = 100 * ( |
---|
[14223] | 568 | gateway_net_amt(self.context.amount_auth) - provider_amt) |
---|
[13400] | 569 | xmltext = """<payment_item_detail> |
---|
[13383] | 570 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 571 | <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" /> |
---|
[14223] | 572 | <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" /> |
---|
[13383] | 573 | </item_details> |
---|
| 574 | </payment_item_detail>""" % xmldict |
---|
| 575 | |
---|
[14258] | 576 | # GST Fees |
---|
| 577 | elif self.context.p_category.startswith('gst_'): |
---|
[14687] | 578 | if contr_agreement_student(student) == 'first': |
---|
| 579 | self.pay_item_id = '115' |
---|
| 580 | else: |
---|
| 581 | self.pay_item_id = '116' |
---|
[14979] | 582 | xmldict['institution_acct'] = '1010893123' |
---|
| 583 | xmldict['institution_bank_id'] = '117' |
---|
[14258] | 584 | xmldict['institution_amt'] = 100 * ( |
---|
| 585 | gateway_net_amt(self.context.amount_auth)) |
---|
| 586 | |
---|
| 587 | # ENT Fees |
---|
| 588 | elif self.context.p_category.startswith('ent_'): |
---|
[14687] | 589 | if contr_agreement_student(student) == 'first': |
---|
| 590 | self.pay_item_id = '114' |
---|
| 591 | else: |
---|
| 592 | self.pay_item_id = '118' |
---|
[14979] | 593 | xmldict['institution_acct'] = '6220029828' |
---|
| 594 | xmldict['institution_bank_id'] = '51' |
---|
[14258] | 595 | xmldict['institution_amt'] = 100 * ( |
---|
| 596 | gateway_net_amt(self.context.amount_auth)) |
---|
| 597 | |
---|
| 598 | # Faculty and Departmental Dues |
---|
| 599 | elif self.context.p_category == 'fac_dep': |
---|
| 600 | self.pay_item_id = '117' |
---|
| 601 | xmldict['institution_amt'] = 100 * ( |
---|
| 602 | gateway_net_amt(self.context.amount_auth)) |
---|
| 603 | |
---|
[14376] | 604 | # Restitution Fee |
---|
| 605 | elif self.context.p_category == 'restitution': |
---|
| 606 | self.pay_item_id = '117' |
---|
| 607 | xmldict['institution_amt'] = 100 * ( |
---|
| 608 | gateway_net_amt(self.context.amount_auth)) |
---|
| 609 | |
---|
[14676] | 610 | # Late Registration Fee |
---|
| 611 | elif self.context.p_category == 'late_registration': |
---|
[14686] | 612 | if contr_agreement_student(student) == 'first': |
---|
| 613 | self.pay_item_id = '113' |
---|
| 614 | else: |
---|
| 615 | self.pay_item_id = '123' |
---|
[14676] | 616 | xmldict['institution_amt'] = 100 * ( |
---|
| 617 | gateway_net_amt(self.context.amount_auth)) |
---|
[15463] | 618 | if student.is_postgrad: |
---|
| 619 | xmldict['institution_acct'] = '5210006575' |
---|
| 620 | xmldict['institution_bank_id'] = '51' |
---|
[14945] | 621 | if not xmltext: |
---|
[14676] | 622 | xmltext = """<payment_item_detail> |
---|
| 623 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
---|
| 624 | <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" /> |
---|
| 625 | </item_details> |
---|
| 626 | </payment_item_detail>""" % xmldict |
---|
[11868] | 627 | self.xml_data = """<input type="hidden" name="xml_data" value='%s' />""" % xmltext |
---|
| 628 | self.context.provider_amt = provider_amt |
---|
[13437] | 629 | self.context.gateway_amt = self.amount_auth - gateway_net_amt( |
---|
| 630 | self.amount_auth) |
---|
[15471] | 631 | xmlitems = '' |
---|
| 632 | xmldoc = minidom.parseString(xmltext) |
---|
| 633 | itemlist = xmldoc.getElementsByTagName('item_detail') |
---|
| 634 | for s in itemlist: |
---|
| 635 | xmlitems += "%s: %s, N%s, %s (%s) " % ( |
---|
| 636 | s.attributes['item_id'].value, |
---|
| 637 | s.attributes['item_name'].value, |
---|
| 638 | int(s.attributes['item_amt'].value)/100, |
---|
| 639 | s.attributes['acct_num'].value, |
---|
| 640 | s.attributes['bank_id'].value, |
---|
| 641 | ) |
---|
| 642 | self.context.p_split_data = xmlitems |
---|
[11868] | 643 | hashargs = ( |
---|
| 644 | self.context.p_id + |
---|
[13382] | 645 | self.product_id + |
---|
[11868] | 646 | self.pay_item_id + |
---|
| 647 | str(int(self.amount_auth)) + |
---|
| 648 | self.site_redirect_url + |
---|
| 649 | self.mac) |
---|
| 650 | self.hashvalue = hashlib.sha512(hashargs).hexdigest() |
---|
| 651 | return |
---|
| 652 | |
---|
| 653 | |
---|
[11846] | 654 | class CustomInterswitchPaymentRequestWebservicePageApplicant( |
---|
| 655 | InterswitchPaymentRequestWebservicePageApplicant): |
---|
[13586] | 656 | """Request webservice view for the CollegePAY gateway |
---|
| 657 | """ |
---|
| 658 | grok.context(ICustomApplicantOnlinePayment) |
---|
| 659 | gateway_host = HOST |
---|
| 660 | gateway_url = URL |
---|
| 661 | https = HTTPS |
---|
[13379] | 662 | |
---|
[13586] | 663 | @property |
---|
[13606] | 664 | def mac(self): |
---|
| 665 | if contr_agreement_applicant(self.context.__parent__) == 'first': |
---|
| 666 | return MAC_PT |
---|
| 667 | return MAC_REGULAR |
---|
| 668 | |
---|
| 669 | @property |
---|
[13586] | 670 | def product_id(self): |
---|
| 671 | if contr_agreement_applicant(self.context.__parent__) == 'first': |
---|
| 672 | return PRODUCT_ID_PT |
---|
| 673 | return PRODUCT_ID_REGULAR |
---|
| 674 | |
---|
| 675 | class CustomInterswitchPaymentVerifyWebservicePageApplicant( |
---|
| 676 | InterswitchPaymentVerifyWebservicePageApplicant): |
---|
| 677 | """Payment verify view for the CollegePAY gateway |
---|
[11846] | 678 | """ |
---|
| 679 | grok.context(ICustomApplicantOnlinePayment) |
---|
| 680 | gateway_host = HOST |
---|
[13586] | 681 | gateway_url = URL |
---|
[11916] | 682 | https = HTTPS |
---|
[11868] | 683 | |
---|
[13532] | 684 | @property |
---|
[13606] | 685 | def mac(self): |
---|
| 686 | if contr_agreement_applicant(self.context.__parent__) == 'first': |
---|
| 687 | return MAC_PT |
---|
| 688 | return MAC_REGULAR |
---|
| 689 | |
---|
| 690 | @property |
---|
[13532] | 691 | def product_id(self): |
---|
| 692 | if contr_agreement_applicant(self.context.__parent__) == 'first': |
---|
| 693 | return PRODUCT_ID_PT |
---|
| 694 | return PRODUCT_ID_REGULAR |
---|
| 695 | |
---|
[11868] | 696 | class CustomInterswitchPaymentRequestWebservicePageStudent( |
---|
| 697 | InterswitchPaymentRequestWebservicePageStudent): |
---|
[13586] | 698 | """Request webservice view for the CollegePAY gateway |
---|
[11868] | 699 | """ |
---|
| 700 | grok.context(ICustomStudentOnlinePayment) |
---|
| 701 | gateway_host = HOST |
---|
[13586] | 702 | gateway_url = URL |
---|
[11916] | 703 | https = HTTPS |
---|
[13379] | 704 | |
---|
| 705 | @property |
---|
[13606] | 706 | def mac(self): |
---|
| 707 | if contr_agreement_student(self.context.student) == 'first': |
---|
| 708 | return MAC_PT |
---|
| 709 | return MAC_REGULAR |
---|
| 710 | |
---|
| 711 | @property |
---|
[13379] | 712 | def product_id(self): |
---|
[13532] | 713 | if contr_agreement_student(self.context.student) == 'first': |
---|
[13379] | 714 | return PRODUCT_ID_PT |
---|
| 715 | return PRODUCT_ID_REGULAR |
---|
[13586] | 716 | |
---|
| 717 | class CustomInterswitchPaymentVerifyWebservicePageStudent( |
---|
| 718 | InterswitchPaymentVerifyWebservicePageStudent): |
---|
| 719 | """Payment verify view for the CollegePAY gateway |
---|
| 720 | """ |
---|
| 721 | grok.context(ICustomStudentOnlinePayment) |
---|
| 722 | gateway_host = HOST |
---|
| 723 | gateway_url = URL |
---|
| 724 | https = HTTPS |
---|
| 725 | |
---|
| 726 | @property |
---|
[13606] | 727 | def mac(self): |
---|
| 728 | if contr_agreement_student(self.context.student) == 'first': |
---|
| 729 | return MAC_PT |
---|
| 730 | return MAC_REGULAR |
---|
| 731 | |
---|
| 732 | @property |
---|
[13586] | 733 | def product_id(self): |
---|
| 734 | if contr_agreement_student(self.context.student) == 'first': |
---|
| 735 | return PRODUCT_ID_PT |
---|
| 736 | return PRODUCT_ID_REGULAR |
---|