| 1 | ## $Id: browser.py 18353 2026-10-28 12:21:59Z 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 | ## |
|---|
| 18 | import httplib |
|---|
| 19 | import hashlib |
|---|
| 20 | import grok |
|---|
| 21 | from kofacustom.nigeria.interswitch.browser import ( |
|---|
| 22 | InterswitchPaymentRequestWebservicePageApplicant, |
|---|
| 23 | InterswitchPaymentRequestWebservicePageStudent, |
|---|
| 24 | InterswitchPaymentVerifyWebservicePageApplicant, |
|---|
| 25 | InterswitchPaymentVerifyWebservicePageStudent, |
|---|
| 26 | InterswitchPageStudent, InterswitchPageApplicant, |
|---|
| 27 | module_activated, |
|---|
| 28 | ) |
|---|
| 29 | from kofacustom.nigeria.interswitch.webcheckoutbrowser import ( |
|---|
| 30 | webcheckout_module_activated, |
|---|
| 31 | WebCheckoutPageStudent, |
|---|
| 32 | WebCheckoutPageApplicant, |
|---|
| 33 | WebCheckoutConfirmTransactionStudent, |
|---|
| 34 | WebCheckoutConfirmTransactionApplicant, |
|---|
| 35 | ) |
|---|
| 36 | from kofacustom.edopoly.students.interfaces import ICustomStudentOnlinePayment |
|---|
| 37 | from kofacustom.edopoly.applicants.interfaces import ICustomApplicantOnlinePayment |
|---|
| 38 | from kofacustom.edopoly.interfaces import MessageFactory as _ |
|---|
| 39 | |
|---|
| 40 | PRODUCT_ID = '7571' # must be provided by Interswitch |
|---|
| 41 | SITE_NAME = 'edopoly-kofa.waeup.org' |
|---|
| 42 | PROVIDER_ACCT = '0773411069' |
|---|
| 43 | PROVIDER_BANK_ID = '31' |
|---|
| 44 | PROVIDER_ITEM_NAME = 'WAeAC' |
|---|
| 45 | INSTITUTION_NAME = 'EdoPoly' |
|---|
| 46 | CURRENCY = '566' |
|---|
| 47 | GATEWAY_AMT = 250.0 |
|---|
| 48 | MAC = '672ABFB2F3755A7793DE545BDA00F44878DF59140B43A1E7DF16245D299F3108AFF65502F16D95256B3242B43CBC3F512A208EB1BA977080D65328800C49912C' |
|---|
| 49 | |
|---|
| 50 | POST_ACTION = 'https://webpay.interswitchng.com/paydirect/pay' |
|---|
| 51 | #POST_ACTION = 'https://sandbox.interswitchng.com/webpay/pay' |
|---|
| 52 | HOST = 'webpay.interswitchng.com' |
|---|
| 53 | #HOST = 'sandbox.interswitchng.com' |
|---|
| 54 | URL = '/paydirect/api/v1/gettransaction.json' |
|---|
| 55 | #URL = '/webpay/api/v1/gettransaction.json' |
|---|
| 56 | |
|---|
| 57 | httplib.HTTPSConnection.debuglevel = 0 |
|---|
| 58 | HTTPS = True |
|---|
| 59 | |
|---|
| 60 | SPECIAL_PAYMENT_PARAMS = { |
|---|
| 61 | |
|---|
| 62 | 'conv_nd': ('101', 1000.0, '0031913976', '121'), |
|---|
| 63 | 'conv_hnd': ('101', 1000.0, '0031913976', '121'), |
|---|
| 64 | } |
|---|
| 65 | |
|---|
| 66 | |
|---|
| 67 | class CustomInterswitchPageStudent(InterswitchPageStudent): |
|---|
| 68 | """ View which sends a POST request to the Interswitch |
|---|
| 69 | CollegePAY payment gateway. |
|---|
| 70 | """ |
|---|
| 71 | grok.context(ICustomStudentOnlinePayment) |
|---|
| 72 | action = POST_ACTION |
|---|
| 73 | site_name = SITE_NAME |
|---|
| 74 | currency = CURRENCY |
|---|
| 75 | product_id = PRODUCT_ID |
|---|
| 76 | mac = MAC |
|---|
| 77 | |
|---|
| 78 | def update(self): |
|---|
| 79 | if not module_activated( |
|---|
| 80 | self.context.student.current_session, self.context): |
|---|
| 81 | self.flash(_('Forbidden'), type='danger') |
|---|
| 82 | self.redirect(self.url(self.context, '@@index')) |
|---|
| 83 | return |
|---|
| 84 | error = self.init_update() |
|---|
| 85 | if error: |
|---|
| 86 | self.flash(error, type='danger') |
|---|
| 87 | self.redirect(self.url(self.context, '@@index')) |
|---|
| 88 | return |
|---|
| 89 | self.context.r_company = u'interswitch' |
|---|
| 90 | student = self.student |
|---|
| 91 | xmldict = self.xmldict |
|---|
| 92 | # Provider data |
|---|
| 93 | xmldict['detail_ref'] = self.context.p_id |
|---|
| 94 | xmldict['provider_acct'] = PROVIDER_ACCT |
|---|
| 95 | xmldict['provider_bank_id'] = PROVIDER_BANK_ID |
|---|
| 96 | xmldict['provider_item_name'] = PROVIDER_ITEM_NAME |
|---|
| 97 | provider_amt = 0.0 |
|---|
| 98 | if not self.context.p_item == 'Balance': |
|---|
| 99 | if self.context.p_category == 'ict_entre': |
|---|
| 100 | provider_amt = 3000.0 |
|---|
| 101 | if self.context.p_category == 'clearance': |
|---|
| 102 | provider_amt = 1500.0 |
|---|
| 103 | # temporarily disabled |
|---|
| 104 | #if self.context.p_category in ('transcript', 'certificate'): |
|---|
| 105 | # provider_amt = 2000.0 |
|---|
| 106 | # Institution data |
|---|
| 107 | xmldict['institution_acct'] = '0068241848' |
|---|
| 108 | xmldict['institution_bank_id'] = '121' |
|---|
| 109 | if self.context.p_category == 'union': |
|---|
| 110 | xmldict['institution_acct'] = '0066437412' |
|---|
| 111 | if self.context.p_category == 'nhis': |
|---|
| 112 | xmldict['institution_acct'] = '0075379404' |
|---|
| 113 | if self.context.p_category == 'cyber': |
|---|
| 114 | xmldict['institution_acct'] = '1220055070' |
|---|
| 115 | xmldict['institution_bank_id'] = '117' |
|---|
| 116 | if self.context.p_category == 'ispon': |
|---|
| 117 | xmldict['institution_acct'] = '1220055104' |
|---|
| 118 | xmldict['institution_bank_id'] = '117' |
|---|
| 119 | xmldict['institution_amt'] = '0.0' |
|---|
| 120 | self.pay_item_id = '101' # must be provided by Interswitch |
|---|
| 121 | xmldict['provider_amt'] = 100 * provider_amt |
|---|
| 122 | xmldict['institution_item_name'] = self.context.category |
|---|
| 123 | xmldict['institution_name'] = INSTITUTION_NAME |
|---|
| 124 | xmldict['institution_amt'] = 100 * ( |
|---|
| 125 | self.context.amount_auth - provider_amt - GATEWAY_AMT) |
|---|
| 126 | # Interswitch amount is not part of the xml data |
|---|
| 127 | if provider_amt == 0: |
|---|
| 128 | xmltext = """<payment_item_detail> |
|---|
| 129 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
|---|
| 130 | <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" /> |
|---|
| 131 | </item_details> |
|---|
| 132 | </payment_item_detail>""" % xmldict |
|---|
| 133 | else: |
|---|
| 134 | xmltext = """<payment_item_detail> |
|---|
| 135 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> |
|---|
| 136 | <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" /> |
|---|
| 137 | <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" /> |
|---|
| 138 | </item_details> |
|---|
| 139 | </payment_item_detail>""" % xmldict |
|---|
| 140 | self.xml_data = """<input type="hidden" name="xml_data" value='%s' />""" % xmltext |
|---|
| 141 | self.context.provider_amt = provider_amt |
|---|
| 142 | self.context.gateway_amt = GATEWAY_AMT |
|---|
| 143 | self.amount_auth = int(100 * self.context.amount_auth) |
|---|
| 144 | hashargs = ( |
|---|
| 145 | self.context.p_id + |
|---|
| 146 | PRODUCT_ID + |
|---|
| 147 | self.pay_item_id + |
|---|
| 148 | str(int(self.amount_auth)) + |
|---|
| 149 | self.site_redirect_url + |
|---|
| 150 | self.mac) |
|---|
| 151 | self.hashvalue = hashlib.sha512(hashargs).hexdigest() |
|---|
| 152 | return |
|---|
| 153 | |
|---|
| 154 | class CustomInterswitchPageApplicant(InterswitchPageApplicant): |
|---|
| 155 | """ View which sends a POST request to the Interswitch |
|---|
| 156 | CollegePAY payment gateway. |
|---|
| 157 | """ |
|---|
| 158 | grok.context(ICustomApplicantOnlinePayment) |
|---|
| 159 | action = POST_ACTION |
|---|
| 160 | site_name = SITE_NAME |
|---|
| 161 | currency = CURRENCY |
|---|
| 162 | pay_item_id = '101' # must be provided by Interswitch |
|---|
| 163 | product_id = PRODUCT_ID |
|---|
| 164 | mac = MAC |
|---|
| 165 | |
|---|
| 166 | def update(self): |
|---|
| 167 | if not module_activated( |
|---|
| 168 | self.context.__parent__.__parent__.year, self.context): |
|---|
| 169 | self.flash(_('Forbidden'), type='danger') |
|---|
| 170 | self.redirect(self.url(self.context, '@@index')) |
|---|
| 171 | return |
|---|
| 172 | error = self.init_update() |
|---|
| 173 | if error: |
|---|
| 174 | self.flash(error, type='danger') |
|---|
| 175 | self.redirect(self.url(self.context, '@@index')) |
|---|
| 176 | return |
|---|
| 177 | self.context.r_company = u'interswitch' |
|---|
| 178 | xmldict = {} |
|---|
| 179 | provider_amt = 1000.0 |
|---|
| 180 | if self.context.p_category != 'application': |
|---|
| 181 | provider_amt = 0.0 |
|---|
| 182 | xmldict['institution_acct'] = '0068241848' |
|---|
| 183 | xmldict['institution_bank_id'] = '121' |
|---|
| 184 | xmldict['detail_ref'] = self.context.p_id |
|---|
| 185 | xmldict['provider_amt'] = 100 * provider_amt |
|---|
| 186 | xmldict['provider_acct'] = PROVIDER_ACCT |
|---|
| 187 | xmldict['provider_bank_id'] = PROVIDER_BANK_ID |
|---|
| 188 | xmldict['provider_item_name'] = PROVIDER_ITEM_NAME |
|---|
| 189 | xmldict['institution_amt'] = 100 * ( |
|---|
| 190 | self.context.amount_auth - provider_amt - GATEWAY_AMT) |
|---|
| 191 | xmldict['institution_item_name'] = self.context.category |
|---|
| 192 | xmldict['institution_name'] = INSTITUTION_NAME |
|---|
| 193 | if self.context.p_category in SPECIAL_PAYMENT_PARAMS.keys(): |
|---|
| 194 | self.pay_item_id = SPECIAL_PAYMENT_PARAMS[self.context.p_category][0] |
|---|
| 195 | xmldict['institution_acct'] = SPECIAL_PAYMENT_PARAMS[ |
|---|
| 196 | self.context.p_category][2] |
|---|
| 197 | xmldict['institution_bank_id'] = SPECIAL_PAYMENT_PARAMS[ |
|---|
| 198 | self.context.p_category][3] |
|---|
| 199 | provider_amt = SPECIAL_PAYMENT_PARAMS[self.context.p_category][1] |
|---|
| 200 | xmldict['institution_amt'] = 100 * ( |
|---|
| 201 | self.context.amount_auth - provider_amt - GATEWAY_AMT) |
|---|
| 202 | xmldict['provider_amt'] = 100 * provider_amt |
|---|
| 203 | # Interswitch amount is not part of the xml data |
|---|
| 204 | if provider_amt == 0: |
|---|
| 205 | xmltext = """<payment_item_detail> |
|---|
| 206 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s"> |
|---|
| 207 | <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" /> |
|---|
| 208 | </item_details> |
|---|
| 209 | </payment_item_detail>""" % xmldict |
|---|
| 210 | else: |
|---|
| 211 | xmltext = """<payment_item_detail> |
|---|
| 212 | <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s"> |
|---|
| 213 | <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" /> |
|---|
| 214 | <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" /> |
|---|
| 215 | </item_details> |
|---|
| 216 | </payment_item_detail>""" % xmldict |
|---|
| 217 | |
|---|
| 218 | self.xml_data = """<input type="hidden" name="xml_data" value='%s' />""" % xmltext |
|---|
| 219 | self.context.provider_amt = provider_amt |
|---|
| 220 | self.context.gateway_amt = GATEWAY_AMT |
|---|
| 221 | self.amount_auth = int(100 * self.context.amount_auth) |
|---|
| 222 | hashargs = ( |
|---|
| 223 | self.context.p_id + |
|---|
| 224 | PRODUCT_ID + |
|---|
| 225 | self.pay_item_id + |
|---|
| 226 | str(int(self.amount_auth)) + |
|---|
| 227 | self.site_redirect_url + |
|---|
| 228 | self.mac) |
|---|
| 229 | self.hashvalue = hashlib.sha512(hashargs).hexdigest() |
|---|
| 230 | return |
|---|
| 231 | |
|---|
| 232 | class CustomInterswitchPaymentRequestWebservicePageStudent( |
|---|
| 233 | InterswitchPaymentRequestWebservicePageStudent): |
|---|
| 234 | """Request webservice view for the CollegePAY gateway |
|---|
| 235 | """ |
|---|
| 236 | grok.context(ICustomStudentOnlinePayment) |
|---|
| 237 | product_id = PRODUCT_ID |
|---|
| 238 | gateway_host = HOST |
|---|
| 239 | gateway_url = URL |
|---|
| 240 | mac = MAC |
|---|
| 241 | |
|---|
| 242 | class CustomInterswitchPaymentVerifyWebservicePageStudent( |
|---|
| 243 | InterswitchPaymentVerifyWebservicePageStudent): |
|---|
| 244 | """Payment verify view for the CollegePAY gateway |
|---|
| 245 | """ |
|---|
| 246 | grok.context(ICustomStudentOnlinePayment) |
|---|
| 247 | product_id = PRODUCT_ID |
|---|
| 248 | gateway_host = HOST |
|---|
| 249 | gateway_url = URL |
|---|
| 250 | mac = MAC |
|---|
| 251 | |
|---|
| 252 | class CustomInterswitchPaymentRequestWebservicePageApplicant( |
|---|
| 253 | InterswitchPaymentRequestWebservicePageApplicant): |
|---|
| 254 | """Request webservice view for the CollegePAY gateway |
|---|
| 255 | """ |
|---|
| 256 | grok.context(ICustomApplicantOnlinePayment) |
|---|
| 257 | product_id = PRODUCT_ID |
|---|
| 258 | gateway_host = HOST |
|---|
| 259 | gateway_url = URL |
|---|
| 260 | mac = MAC |
|---|
| 261 | |
|---|
| 262 | class CustomInterswitchPaymentVerifyWebservicePageApplicant( |
|---|
| 263 | InterswitchPaymentVerifyWebservicePageApplicant): |
|---|
| 264 | """Payment verify view for the CollegePAY gateway |
|---|
| 265 | """ |
|---|
| 266 | grok.context(ICustomApplicantOnlinePayment) |
|---|
| 267 | product_id = PRODUCT_ID |
|---|
| 268 | gateway_host = HOST |
|---|
| 269 | gateway_url = URL |
|---|
| 270 | mac = MAC |
|---|
| 271 | |
|---|
| 272 | # WebCheckout customizations |
|---|
| 273 | |
|---|
| 274 | MERCHANT_CODE = 'MX104253' |
|---|
| 275 | PAY_ITEM_ID = 'Default_Payable_MX104253' |
|---|
| 276 | |
|---|
| 277 | SPLIT_ACCOUNT = { |
|---|
| 278 | 'schoolfee': [{"alias":"ESPU SCHOOL FEES ACCOUNT","percentage":"100","description":"Tuition Exams Fee","isPrimary":"true"},], |
|---|
| 279 | 'clearance': [{"alias":"ESPU SCHOOL FEES ACCOUNT","percentage":"85","description":"Acceptance Fee","isPrimary":"true"}, |
|---|
| 280 | {"alias":"WEST AFRICA EACADEMY PROJECT LTD ","percentage":"15","description":"provider_amt"},], |
|---|
| 281 | #'bed_allocation': 'Accommodation Booking Fee', |
|---|
| 282 | 'hostel_maintenance': [{"alias":"ESPU SCHOOL FEES ACCOUNT","description":"Hostel Maintenance Fee","isPrimary":"true"},], |
|---|
| 283 | #'application': 'Application Fee', |
|---|
| 284 | 'ict_entre': [{"alias":"ESPU SCHOOL FEES ACCOUNT","percentage":"70","description":"ICT and Entrepreneur Fee","isPrimary":"true"}, |
|---|
| 285 | {"alias":"WEST AFRICA EACADEMY PROJECT LTD ","percentage":"30","description":"provider_amt"},], |
|---|
| 286 | 'logbook_combo': [{"alias":"ESPU SCHOOL FEES ACCOUNT","percentage":"100","description":"Logbook Fee","isPrimary":"true"},], |
|---|
| 287 | 'siwess_combo': [{"alias":"ESPU SCHOOL FEES ACCOUNT","description":"SIWES Fee","percentage":"100","isPrimary":"true"},], |
|---|
| 288 | 'transcript': [{"alias":"ESPU SCHOOL FEES ACCOUNT","percentage":"100","description":"Transcript Fee","isPrimary":"true"},], |
|---|
| 289 | #'certificate': 'Certificate Fee', |
|---|
| 290 | 'certificate_confirm': [{"alias":"ESPU SCHOOL FEES ACCOUNT","percentage":"100","description":"Certificate Confirmation Fee","isPrimary":"true"},], |
|---|
| 291 | 'late_registration': [{"alias":"ESPU SCHOOL FEES ACCOUNT","percentage":"100","description":"Late Course Registration Fee","isPrimary":"true"},], |
|---|
| 292 | 'final_clearance': [{"alias":"ESPU SCHOOL FEES ACCOUNT","percentage":"100","description":"Final Clearance Fee","isPrimary":"true"},], |
|---|
| 293 | 'union': [{"alias":"EDO STATE POLYTECHNIC SUG ","percentage":"100","description":"Student Union Dues","isPrimary":"true"},], |
|---|
| 294 | 'admission_checking': [{"alias":"ESPU SCHOOL FEES ACCOUNT","percentage":"100","description":"Admission Checking Fee,","isPrimary":"true"},], |
|---|
| 295 | 'medical': [{"alias":"ESPU SCHOOL FEES ACCOUNT","percentage":"100","description":"Medical Lab. Test Fee","isPrimary":"true"},], |
|---|
| 296 | 'conv_nd': [{"alias":"ESPU SCHOOL FEES ACCOUNT","percentage":"100","description":"ND Convocation Fee","isPrimary":"true"},], |
|---|
| 297 | 'conv_hnd': [{"alias":"ESPU SCHOOL FEES ACCOUNT","percentage":"100","description":"HND Convocation Fee","isPrimary":"true"},], |
|---|
| 298 | 'nhis': [{"alias":"EDO STATE POLYTECHNIC NHIS","percentage":"100","description":"Tiship Fee","isPrimary":"true"},], |
|---|
| 299 | 'coc': [{"alias":"ESPU SCHOOL FEES ACCOUNT","percentage":"100","description":"Change of Course Fee","isPrimary":"true"},], |
|---|
| 300 | 'damages': [{"alias":"ESPU SCHOOL FEES ACCOUNT","percentage":"100","description":"Damages Fee","isPrimary":"true"},], |
|---|
| 301 | 'project_bind': [{"alias":"ESPU SCHOOL FEES ACCOUNT","percentage":"100","description":"Project Binding Fee","isPrimary":"true"},], |
|---|
| 302 | 'maintenance': [{"alias":"ESPU SCHOOL FEES ACCOUNT","percentage":"100","description":"Maintenance & Utility Fee","isPrimary":"true"},], |
|---|
| 303 | #'cyber': 'Cyber Security', |
|---|
| 304 | 'ispon': [{"alias":"EDO STATE POLY/ISPON SAFETY PROGRAM","percentage":"100","description":"ISPON Safety Fee","isPrimary":"true"},], |
|---|
| 305 | 'indigene': [{"alias":"ESPU SCHOOL FEES ACCOUNT","percentage":"100","description":"Non-State Indigene Fee","isPrimary":"true"},], |
|---|
| 306 | 'develop': [{"alias":"ESPU SCHOOL FEES ACCOUNT","percentage":"100","description":"Development Fee","isPrimary":"true"},], |
|---|
| 307 | 'sport': [{"alias":"ESPU SCHOOL FEES ACCOUNT","percentage":"100","description":"Sport Development Fee","isPrimary":"true"},], |
|---|
| 308 | 'gown': [{"alias":"ESPU SCHOOL FEES ACCOUNT","percentage":"100","description":"Matriculation Gown Fee","isPrimary":"true"},], |
|---|
| 309 | 'global_practics': [{"alias":"ESPU SCHOOL FEES ACCOUNT","percentage":"100","description":"Global Practice Fee","isPrimary":"true"},], |
|---|
| 310 | } |
|---|
| 311 | |
|---|
| 312 | |
|---|
| 313 | class CustomWebCheckoutPageStudent(WebCheckoutPageStudent): |
|---|
| 314 | """ View which sends a POST request to the Interswitch |
|---|
| 315 | WebCheckout payment gateway. |
|---|
| 316 | """ |
|---|
| 317 | action = 'https://newwebpay.interswitchng.com/collections/w/pay' |
|---|
| 318 | #action = 'https://newwebpay.qa.interswitchng.com/collections/w/pay' |
|---|
| 319 | currency = '566' |
|---|
| 320 | pay_item_id = PAY_ITEM_ID |
|---|
| 321 | merchant_code = MERCHANT_CODE |
|---|
| 322 | gateway_amt = 0.0 |
|---|
| 323 | product_id = PRODUCT_ID |
|---|
| 324 | |
|---|
| 325 | @property |
|---|
| 326 | def split_account(self): |
|---|
| 327 | sa = SPLIT_ACCOUNT.get(self.context.p_category, None) |
|---|
| 328 | return str(sa) |
|---|
| 329 | |
|---|
| 330 | class CustomWebCheckoutPageApplicant(WebCheckoutPageApplicant): |
|---|
| 331 | """ View which sends a POST request to the Interswitch |
|---|
| 332 | WebCheckout payment gateway. |
|---|
| 333 | """ |
|---|
| 334 | |
|---|
| 335 | action = 'https://newwebpay.interswitchng.com/collections/w/pay' |
|---|
| 336 | currency = '566' |
|---|
| 337 | pay_item_id = PAY_ITEM_ID |
|---|
| 338 | merchant_code = MERCHANT_CODE |
|---|
| 339 | |
|---|
| 340 | @property |
|---|
| 341 | def split_account(self): |
|---|
| 342 | sa = [{"alias": "espu school fees account","percentage":"100","description":"Application Fee","isPrimary":"true"},] |
|---|
| 343 | return str(sa) |
|---|
| 344 | |
|---|
| 345 | class CustomWebCheckoutConfirmTransactionStudent(WebCheckoutConfirmTransactionStudent): |
|---|
| 346 | """ Request webservice view for the WebCheckout gateway |
|---|
| 347 | """ |
|---|
| 348 | merchant_code = MERCHANT_CODE |
|---|
| 349 | gateway_host = 'webpay.interswitchng.com' |
|---|
| 350 | gateway_url = '/collections/api/v1/gettransaction.json' |
|---|
| 351 | https = True |
|---|
| 352 | |
|---|
| 353 | class CustomWebCheckoutConfirmTransactionApplicant(WebCheckoutConfirmTransactionApplicant): |
|---|
| 354 | """ Request webservice view for the WebCheckout gateway |
|---|
| 355 | """ |
|---|
| 356 | merchant_code = MERCHANT_CODE |
|---|
| 357 | gateway_host = 'webpay.interswitchng.com' |
|---|
| 358 | gateway_url = '/collections/api/v1/gettransaction.json' |
|---|
| 359 | https = True |
|---|
| 360 | |
|---|
| 361 | |
|---|