Changeset 10597 for main/waeup.kwarapoly
- Timestamp:
- 9 Sep 2013, 06:00:24 (11 years ago)
- Location:
- main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/browser.py
r10254 r10597 226 226 xmldict['institution_acct'] = '7000016724' 227 227 xmldict['institution_bank_id'] = '9' 228 elif self.applicant. is_nd:228 elif self.applicant.applicant_id.startswith('nd'): 229 229 xmldict['institution_acct'] = '2014191363' 230 230 xmldict['institution_bank_id'] = '8' 231 elif self.applicant.applicant_id.startswith('prejambites'): 232 xmldict['institution_acct'] = '0106259811' 233 xmldict['institution_bank_id'] = '10' 234 self.pay_item_id = '104' 235 provider_amt = 0.0 236 dalash_amt = 0.0 237 elif self.applicant.applicant_id.startswith('pre'): 238 xmldict['institution_acct'] = '2013910271' 239 xmldict['institution_bank_id'] = '8' 240 provider_amt = 0.0 241 dalash_amt = 0.0 231 242 else: 232 243 xmldict['institution_acct'] = '00000000000' … … 253 264 254 265 # Interswitch amount is not part of the xml data 255 xmltext = """<payment_item_detail> 266 267 if not self.applicant.applicant_id.startswith('pre'): 268 xmltext = """<payment_item_detail> 256 269 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s"> 257 270 <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" /> … … 260 273 </item_details> 261 274 </payment_item_detail>""" % xmldict 275 276 else: 277 xmltext = """<payment_item_detail> 278 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s"> 279 <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" /> 280 </item_details> 281 </payment_item_detail>""" % xmldict 282 262 283 self.xml_data = """<input type="hidden" name="xml_data" value='%s' />""" % xmltext 263 284 self.context.provider_amt = provider_amt -
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/tests.py
r10254 r10597 366 366 'item_amt="30000" bank_id="117" acct_num="1010764827" />' 367 367 in self.browser.contents) 368 369 # prehndft fee goes to another account 370 self.applicant.applicant_id = u'prehnd_anything' 371 self.browser.open(self.manage_path) 372 ctrl = self.browser.getControl(name='val_id') 373 value = ctrl.options[0] 374 self.browser.getLink(value).click() 375 self.browser.getLink("CollegePAY", index=0).click() 376 self.assertTrue( 377 '<item_detail item_id="1" item_name="application" ' 378 'item_amt="303300" bank_id="8" acct_num="2013910271" />' 379 in self.browser.contents) 380 # No 'commission', no provider fee 381 self.assertFalse('Dalash' in self.browser.contents) 382 self.assertFalse('BT Education' in self.browser.contents) 383 384 # prejambites fee goes to another account 385 self.applicant.applicant_id = u'prejambites_anything' 386 self.browser.open(self.manage_path) 387 ctrl = self.browser.getControl(name='val_id') 388 value = ctrl.options[0] 389 self.browser.getLink(value).click() 390 self.browser.getLink("CollegePAY", index=0).click() 391 self.assertTrue( 392 '<item_detail item_id="1" item_name="application" ' 393 'item_amt="303300" bank_id="10" acct_num="0106259811" />' 394 in self.browser.contents) 395 # No 'commission', no provider fee 396 self.assertFalse('Dalash' in self.browser.contents) 397 self.assertFalse('BT Education' in self.browser.contents)
Note: See TracChangeset for help on using the changeset viewer.