- Timestamp:
- 6 Dec 2012, 08:42:16 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/interswitch/browser.py
r9749 r9775 19 19 import grok 20 20 from zope.component import getUtility 21 from kofacustom.nigeria.interswitch.helpers import query_interswitch 21 from kofacustom.nigeria.interswitch.helpers import ( 22 query_interswitch, write_payments_log) 22 23 from waeup.kofa.browser.layout import KofaPage, UtilityView 23 24 from waeup.kofa.interfaces import IKofaUtils … … 36 37 INSTITUTION_NAME = 'Uniben' 37 38 CURRENCY = '566' 39 GATEWAY_AMT = 150.0 38 40 #QUERY_URL = 'https://webpay.interswitchng.com/paydirect/services/TransactionQueryURL.aspx' 39 41 #QUERY_URL = 'https://testwebpay.interswitchng.com/test_paydirect/services/TransactionQueryURL.aspx' … … 156 158 xmldict['institution_amt'] = '0.0' 157 159 if self.context.p_category == 'schoolfee': 158 provider_amt = 1500 160 provider_amt = 1500.0 159 161 if student.current_mode.endswith('_ft'): 160 162 self.pay_item_id = '5700' … … 181 183 elif self.context.p_category == 'clearance': 182 184 self.pay_item_id = '5702' 183 provider_amt = 1500 185 provider_amt = 1500.0 184 186 if student.current_mode == 'pg_ft': 185 187 xmldict['institution_acct'] = '5330832799' … … 196 198 elif self.context.p_category == 'gown': 197 199 self.pay_item_id = '5704' 198 provider_amt = 0 200 provider_amt = 0.0 199 201 xmldict['institution_bank_id'] = '7' 200 202 xmldict['institution_acct'] = '1016232382' 201 203 elif self.context.p_category.startswith('hostel_maintenance'): 202 204 self.pay_item_id = '5705' 203 provider_amt = 0 205 provider_amt = 0.0 204 206 xmldict['institution_bank_id'] = '129' 205 207 xmldict['institution_acct'] = '0014414547' … … 209 211 xmldict['institution_name'] = INSTITUTION_NAME 210 212 xmldict['institution_amt'] = 100 * ( 211 self.context.amount_auth - provider_amt - 150)213 self.context.amount_auth - provider_amt - GATEWAY_AMT) 212 214 # Interswitch amount is not part of the xml data 213 215 if provider_amt == 0: … … 225 227 </payment_item_detail>""" % xmldict 226 228 self.xml_data = """<input type="hidden" name="xml_data" value='%s' />""" % xmltext 229 self.context.provider_amt = provider_amt 230 self.context.gateway_amt = GATEWAY_AMT 227 231 return 228 232 … … 262 266 self.context.creation_date, tz).strftime("%Y-%m-%d %H:%M:%S %Z") 263 267 self.site_redirect_url = self.url(self.context, 'request_webservice') 264 provider_amt = 400 268 provider_amt = 400.0 265 269 if self.applicant.applicant_id.startswith('pg'): 266 270 xmldict['institution_acct'] = '0031716030' … … 277 281 xmldict['provider_bank_id'] = PROVIDER_BANK_ID 278 282 xmldict['provider_item_name'] = PROVIDER_ITEM_NAME 279 xmldict['institution_amt'] = 100 * (self.context.amount_auth - provider_amt - 150)283 xmldict['institution_amt'] = 100 * (self.context.amount_auth - provider_amt - GATEWAY_AMT) 280 284 xmldict['institution_item_name'] = self.context.p_category 281 285 xmldict['institution_name'] = INSTITUTION_NAME … … 288 292 </payment_item_detail>""" % xmldict 289 293 self.xml_data = """<input type="hidden" name="xml_data" value='%s' />""" % xmltext 294 self.context.provider_amt = provider_amt 295 self.context.gateway_amt = GATEWAY_AMT 290 296 return 291 297 … … 368 374 self.flash(msg) 369 375 return 376 write_payments_log(student.student_id, self.context) 370 377 success, msg, log = self.context.doAfterStudentPayment() 371 378 if log is not None: … … 396 403 self.flash(msg) 397 404 return 405 write_payments_log(applicant.applicant_id, self.context) 398 406 success, msg, log = self.context.doAfterApplicantPayment() 399 407 if log is not None:
Note: See TracChangeset for help on using the changeset viewer.