Changeset 9384 for main/waeup.uniben/trunk/src/waeup/uniben
- Timestamp:
- 22 Oct 2012, 11:56:06 (12 years ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben/interswitch
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/interswitch/browser.py
r9081 r9384 229 229 xmldict['provider_bank_id'] = PROVIDER_BANK_ID 230 230 xmldict['provider_item_name'] = PROVIDER_ITEM_NAME 231 if student.current_mode.endswith('_ft') \232 and student.state == RETURNING:233 provider_amt = 600234 else:235 provider_amt = 1500236 xmldict['provider_amt'] = 100 * provider_amt237 231 # Institution data 238 studycourse = student['studycourse']239 232 xmldict['institution_acct'] = '' 240 233 xmldict['institution_bank_id'] = '' 241 if student.current_mode.endswith('_ft'): 242 #post-grad full-time students of all faculties 243 if student.is_postgrad: 244 xmldict['institution_acct'] = '1012842833' 245 xmldict['institution_bank_id'] = '117' 246 #all other part-time students depending on faculty 247 elif student.faccode in ('SSC','LAW','MED'): 248 xmldict['institution_acct'] = '0005986938' 249 xmldict['institution_bank_id'] = '31' 250 elif student.faccode in ('ENG','PSC','PHA'): 251 xmldict['institution_acct'] = '0014413973' 252 xmldict['institution_bank_id'] = '129' 253 elif student.faccode in ('LSC','DEN','AGR'): 254 xmldict['institution_acct'] = '1012801319' 255 xmldict['institution_bank_id'] = '117' 256 elif student.faccode in ('ART','EDU','MGS','BMS'): 257 xmldict['institution_acct'] = '6220027556' 258 xmldict['institution_bank_id'] = '51' 259 elif student.current_mode.endswith('_pt'): 260 #post-grad part-time students of all faculties 261 if student.is_postgrad: 262 xmldict['institution_acct'] = '0023708207' 263 xmldict['institution_bank_id'] = '72' 264 #all other part-time students depending on faculty 265 elif student.faccode in ('ENG','LAW','MGS'): 266 xmldict['institution_acct'] = '2019006824' 267 xmldict['institution_bank_id'] = '8' 268 elif student.faccode in ('IPA','PHA','SSC','AGR','EDU'): 269 xmldict['institution_acct'] = '0122012109' 270 xmldict['institution_bank_id'] = '16' 271 xmldict['institution_amt'] = 100 * (self.context.amount_auth - provider_amt - 150) 272 xmldict['institution_item_name'] = self.context.p_category 234 xmldict['institution_amt'] = '0.0' 235 if self.context.p_category == 'schoolfee': 236 if student.current_mode.endswith('_ft') \ 237 and student.state == RETURNING: 238 provider_amt = 600 239 else: 240 provider_amt = 1500 241 #studycourse = student['studycourse'] 242 if student.current_mode.endswith('_ft'): 243 #post-grad full-time students of all faculties 244 if student.is_postgrad: 245 xmldict['institution_acct'] = '1012842833' 246 xmldict['institution_bank_id'] = '117' 247 #all other part-time students depending on faculty 248 elif student.faccode in ('SSC','LAW','MED'): 249 xmldict['institution_acct'] = '0005986938' 250 xmldict['institution_bank_id'] = '31' 251 elif student.faccode in ('ENG','PSC','PHA'): 252 xmldict['institution_acct'] = '0014413973' 253 xmldict['institution_bank_id'] = '129' 254 elif student.faccode in ('LSC','DEN','AGR'): 255 xmldict['institution_acct'] = '1012801319' 256 xmldict['institution_bank_id'] = '117' 257 elif student.faccode in ('ART','EDU','MGS','BMS'): 258 xmldict['institution_acct'] = '6220027556' 259 xmldict['institution_bank_id'] = '51' 260 elif student.current_mode.endswith('_pt'): 261 #post-grad part-time students of all faculties 262 if student.is_postgrad: 263 xmldict['institution_acct'] = '0023708207' 264 xmldict['institution_bank_id'] = '72' 265 #all other part-time students depending on faculty 266 elif student.faccode in ('ENG','LAW','MGS'): 267 xmldict['institution_acct'] = '2019006824' 268 xmldict['institution_bank_id'] = '8' 269 elif student.faccode in ('IPA','PHA','SSC','AGR','EDU'): 270 xmldict['institution_acct'] = '0122012109' 271 xmldict['institution_bank_id'] = '16' 272 elif self.context.p_category == 'clearance': 273 provider_amt = 1500 274 xmldict['institution_bank_id'] = '7' 275 xmldict['institution_acct'] = '1003475516' 276 277 xmldict['provider_amt'] = 100 * provider_amt 278 xmldict['institution_item_name'] = self.category 273 279 xmldict['institution_name'] = INSTITUTION_NAME 280 xmldict['institution_amt'] = 100 * ( 281 self.context.amount_auth - provider_amt - 150) 274 282 # Interswitch amount is not part of the xml data 275 283 xmltext = """<payment_item_detail> -
main/waeup.uniben/trunk/src/waeup/uniben/interswitch/tests.py
r9006 r9384 51 51 self.student.nationality = u'NG' 52 52 self.browser.open(self.payments_path + '/addop') 53 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 53 54 self.browser.getControl("Create ticket").click() 54 55 self.assertMatches('...ticket created...', … … 57 58 value = ctrl.options[0] 58 59 self.browser.getLink(value).click() 59 self.assertMatches('...Amount Authorized...',60 self.browser.contents)61 self.assertMatches(62 '...<span>40000.0</span>...',63 self.browser.contents)64 self.payment_url = self.browser.url65 60 66 61 … … 78 73 def test_interswitch_form(self): 79 74 75 # School fee ticket already created in setUp method 76 self.assertMatches('...Amount Authorized...', 77 self.browser.contents) 78 self.assertMatches( 79 '...<span>40000.0</span>...', 80 self.browser.contents) 81 self.payment_url = self.browser.url 80 82 # Manager can access InterswitchForm 81 83 self.browser.getLink("CollegePAY", index=0).click() … … 84 86 # The total amount to be processed by Interswitch 85 87 # has been reduced by the Interswitch fee of 150 Nairas 88 self.assertMatches('...Total Amount Authorized:...', 89 self.browser.contents) 86 90 self.assertMatches( 87 91 '...<input type="hidden" name="amount" value="4000000.0" />...', 88 92 self.browser.contents) 93 self.assertMatches( 94 '...item_name="School Fee" item_amt="3835000" bank_id="" acct_num=""...', 95 self.browser.contents) 96 self.assertMatches( 97 '...item_name="BT Education" item_amt="150000" bank_id="117" acct_num="1010764827"...', 98 self.browser.contents) 99 100 # Create clearance fee ticket 101 self.browser.open(self.payments_path + '/addop') 102 self.browser.getControl(name="form.p_category").value = ['clearance'] 103 self.browser.getControl("Create ticket").click() 104 self.assertMatches('...ticket created...', 105 self.browser.contents) 106 ctrl = self.browser.getControl(name='val_id') 107 value = ctrl.options[1] 108 self.browser.getLink(value).click() 109 self.assertMatches('...Amount Authorized...', 110 self.browser.contents) 111 self.assertMatches( 112 '...<span>45000.0</span>...', 113 self.browser.contents) 114 # Manager can access InterswitchForm 115 self.browser.getLink("CollegePAY", index=0).click() 116 self.assertMatches('...Total Amount Authorized:...', 117 self.browser.contents) 118 # The total amount to be processed by Interswitch 119 # has been reduced by the Interswitch fee of 150 Nairas 120 self.assertMatches('...Total Amount Authorized:...', 121 self.browser.contents) 122 self.assertMatches( 123 '...<input type="hidden" name="amount" value="4500000.0" />...', 124 self.browser.contents) 125 self.assertMatches( 126 '...item_name="Acceptance Fee" item_amt="4335000" bank_id="7" acct_num="1003475516"...', 127 self.browser.contents) 128 self.assertMatches( 129 '...item_name="BT Education" item_amt="150000" bank_id="117" acct_num="1010764827"...', 130 self.browser.contents) 131 89 132 90 133 # @external_test
Note: See TracChangeset for help on using the changeset viewer.