Changeset 17456 for main/waeup.aaue/trunk/src/waeup/aaue/interswitch
- Timestamp:
- 25 Jun 2023, 21:18:49 (19 months ago)
- Location:
- main/waeup.aaue/trunk/src/waeup/aaue/interswitch
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/interswitch/browser.py
r17455 r17456 69 69 'matricgown': ('2000249757', '8'), 70 70 'lapel': ('2000249757', '8'), 71 72 'hostel_maintenance': ('1006406795', '123'), 73 'late_registration': ('5210006575', '51'), 74 'ent_combined': ('6220029828', '51'), 75 'ent_registration_0': ('6220029828', '51'), 76 'ent_registration_1': ('6220029828', '51'), 77 'ent_registration_2': ('6220029828', '51'), 78 'ent_text_book_0': ('6220029828', '51'), 79 'ent_text_book_1': ('6220029828', '51'), 80 'ent_text_book_2': ('6220029828', '51'), 81 'gst_registration_1': ('1010893123', '117'), 82 'gst_registration_2': ('1010893123', '117'), 83 'gst_text_book_0': ('1010893123', '117'), 84 'gst_text_book_1': ('1010893123', '117'), 85 'gst_text_book_2': ('1010893123', '117'), 86 'gst_text_book_3': ('1010893123', '117'), 71 87 } 72 88 … … 324 340 # Clearance (acceptance) fee 325 341 326 if category.startswith('clearance'):342 elif category.startswith('clearance'): 327 343 # collect additional fees 328 344 if self.context.p_category == 'clearance_incl': … … 354 370 355 371 # Other fees 372 elif category in BANK_ACCOUNTS.keys(): 373 bank = BANK_ACCOUNTS[category] 374 xmldict['institution_acct'] = bank[0] 375 xmldict['institution_bank_id'] = bank[1] 376 377 378 379 380 381 356 382 357 383 -
main/waeup.aaue/trunk/src/waeup/aaue/interswitch/tests.py
r17445 r17456 205 205 self.app['configuration']['2004'].interswitch_enabled = True 206 206 207 def disabled_test_interswitch_form_pt_school_fees(self): 208 self.certificate.study_mode = 'ug_pt' 209 self.student['studycourse'].entry_session = 2013 210 self.student['studycourse'].certificate.school_fee_3 = 50200.0 211 self.app['configuration']['2004'].union_fee = 1000.0 212 self.app['configuration']['2004'].welfare_fee = 500.0 207 def test_interswitch_form_regular_school_fees(self): 208 self.certificate.study_mode = 'ug_ft' 209 #self.student['studycourse'].entry_session = 2013 210 #self.student['studycourse'].certificate.school_fee_3 = 51750.0 213 211 # Manager can access InterswitchForm 214 212 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') … … 219 217 self.browser.getControl(name="form.p_category").value = ['schoolfee_incl'] 220 218 self.browser.getControl("Create ticket").click() 221 self.assertTrue('ticket created' in self.browser.contents) 222 self.assertTrue('Amount Authorized' in self.browser.contents) 223 # 50200 + 1000 + 500 - 400 224 self.assertTrue('<span>51300.0</span>' in self.browser.contents) 219 self.assertTrue('ticket created' in 220 self.browser.contents) 221 self.assertTrue('Amount Authorized' in 222 self.browser.contents) 223 self.assertTrue('<span>239500.0</span>' in self.browser.contents) 224 self.payment_url = self.browser.url 225 self.browser.getLink("Pay via Interswitch", index=0).click() 226 self.assertTrue('Total Amount Authorized:' 227 in self.browser.contents) 228 self.assertEqual(self.student.current_mode, 'ug_ft') 229 self.assertTrue( 230 '<input type="hidden" name="amount" value="24220000" />' 231 in self.browser.contents) 232 self.assertTrue( 233 'item_name="Tuition" item_amt="18400000" bank_id="7" ' 234 'acct_num="1022438743"' in self.browser.contents) 235 236 self.student['studycourse'].entry_session = 2015 237 self.browser.open(self.payments_path + '/addop') 238 self.browser.getControl(name="form.p_category").value = ['schoolfee_2'] 239 self.browser.getControl("Create ticket").click() 240 self.assertTrue('ticket created' in 241 self.browser.contents) 242 self.assertTrue('<span>92000.0</span>' in self.browser.contents) 225 243 self.payment_url = self.browser.url 226 244 self.browser.getLink("Pay via Interswitch", index=0).click() … … 232 250 self.student['payments']['xyz'] = acc_payment 233 251 self.browser.getLink("Pay via Interswitch", index=0).click() 234 self.assertTrue('Total Amount Authorized:' in self.browser.contents) 235 self.assertEqual(self.student.current_mode, 'ug_pt') 236 self.assertTrue( 237 '<input type="hidden" name="amount" value="5130000" />' 238 in self.browser.contents) 239 self.assertTrue( 240 'item_name="School Fee Plus" ' 241 'item_amt="4810000" bank_id="7" ' 242 'acct_num="1014847058"' in self.browser.contents) 243 244 def test_interswitch_form_regular_school_fees(self): 245 self.certificate.study_mode = 'ug_ft' 246 #self.student['studycourse'].entry_session = 2013 247 #self.student['studycourse'].certificate.school_fee_3 = 51750.0 248 # Manager can access InterswitchForm 249 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 250 self.browser.open(self.payments_path) 251 IWorkflowState(self.student).setState('cleared') 252 self.student.nationality = u'NG' 253 self.browser.open(self.payments_path + '/addop') 254 self.browser.getControl(name="form.p_category").value = ['schoolfee_incl'] 252 self.assertTrue( 253 '<input type="hidden" name="amount" value="9220000" />' 254 in self.browser.contents) 255 self.assertTrue( 256 'item_name="School Fees (2nd instalment)" item_amt="9200000" bank_id="7" acct_num="1022438743"' in self.browser.contents) 257 258 self.browser.open(self.payments_path + '/addop') 259 self.browser.getControl(name="form.p_category").value = ['schoolfee_1'] 255 260 self.browser.getControl("Create ticket").click() 256 261 self.assertTrue('ticket created' in 257 262 self.browser.contents) 258 self.assertTrue('Amount Authorized' in 259 self.browser.contents) 260 self.assertTrue('<span>239500.0</span>' in self.browser.contents) 261 self.payment_url = self.browser.url 262 self.browser.getLink("Pay via Interswitch", index=0).click() 263 self.assertTrue('Total Amount Authorized:' 264 in self.browser.contents) 265 self.assertEqual(self.student.current_mode, 'ug_ft') 266 self.assertTrue( 267 '<input type="hidden" name="amount" value="24220000" />' 268 in self.browser.contents) 269 self.assertTrue( 270 'item_name="Tuition" item_amt="18400000" bank_id="7" ' 271 'acct_num="1022438743"' in self.browser.contents) 272 273 self.student['studycourse'].entry_session = 2015 263 self.assertTrue('<span>147500.0</span>' in self.browser.contents) 264 self.payment_url = self.browser.url 265 self.browser.getLink("Pay via Interswitch", index=0).click() 266 self.assertTrue( 267 '<input type="hidden" name="amount" value="15020000" />' 268 in self.browser.contents) 269 self.assertTrue( 270 'item_name="Student Union Dues" item_amt="3000000" bank_id="7" acct_num="1019763348"' in self.browser.contents) 271 self.assertTrue( 272 'item_name="Tuition" item_amt="9200000" bank_id="7" acct_num="1022438743"' in self.browser.contents) 273 274 274 self.browser.open(self.payments_path + '/addop') 275 275 self.browser.getControl(name="form.p_category").value = ['schoolfee_2'] … … 281 281 self.browser.getLink("Pay via Interswitch", index=0).click() 282 282 self.assertTrue( 283 'Please pay acceptance fee first' in self.browser.contents)284 acc_payment = createObject('waeup.StudentOnlinePayment')285 acc_payment.p_state = 'paid'286 acc_payment.p_category = 'clearance'287 self.student['payments']['xyz'] = acc_payment288 self.browser.getLink("Pay via Interswitch", index=0).click()289 self.assertTrue(290 283 '<input type="hidden" name="amount" value="9220000" />' 291 284 in self.browser.contents) … … 293 286 'item_name="School Fees (2nd instalment)" item_amt="9200000" bank_id="7" acct_num="1022438743"' in self.browser.contents) 294 287 295 self.browser.open(self.payments_path + '/addop') 296 self.browser.getControl(name="form.p_category").value = ['schoolfee_1'] 297 self.browser.getControl("Create ticket").click() 298 self.assertTrue('ticket created' in 299 self.browser.contents) 300 self.assertTrue('<span>147500.0</span>' in self.browser.contents) 301 self.payment_url = self.browser.url 302 self.browser.getLink("Pay via Interswitch", index=0).click() 303 self.assertTrue( 304 '<input type="hidden" name="amount" value="15020000" />' 305 in self.browser.contents) 306 self.assertTrue( 307 'item_name="Student Union Dues" item_amt="3000000" bank_id="7" acct_num="1019763348"' in self.browser.contents) 308 self.assertTrue( 309 'item_name="Tuition" item_amt="9200000" bank_id="7" acct_num="1022438743"' in self.browser.contents) 310 311 self.browser.open(self.payments_path + '/addop') 312 self.browser.getControl(name="form.p_category").value = ['schoolfee_2'] 313 self.browser.getControl("Create ticket").click() 314 self.assertTrue('ticket created' in 315 self.browser.contents) 316 self.assertTrue('<span>92000.0</span>' in self.browser.contents) 317 self.payment_url = self.browser.url 318 self.browser.getLink("Pay via Interswitch", index=0).click() 319 self.assertTrue( 320 '<input type="hidden" name="amount" value="9220000" />' 321 in self.browser.contents) 322 self.assertTrue( 323 'item_name="School Fees (2nd instalment)" item_amt="9200000" bank_id="7" acct_num="1022438743"' in self.browser.contents) 324 325 def disabled_test_interswitch_form_pt_acceptance_fees(self): 326 self.certificate.study_mode = 'ug_pt' 327 self.app['configuration']['2004'].clearance_fee_ug_pt = 40200.0 328 self.app['configuration']['2004'].matric_gown_fee = 2000.0 329 self.app['configuration']['2004'].lapel_fee = 800.0 288 def test_interswitch_form_regular_acceptance_fees(self): 289 self.certificate.study_mode = 'ug_ft' 290 #self.app['configuration']['2004'].clearance_fee = 43050.0 330 291 # Manager can access InterswitchForm 331 292 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') … … 336 297 self.browser.getControl(name="form.p_category").value = ['clearance_incl'] 337 298 self.browser.getControl("Create ticket").click() 338 self.assertTrue('ticket created' in self.browser.contents) 339 self.assertTrue('Amount Authorized' in self.browser.contents) 340 # 40200 + 2000 + 800 - 400 341 self.assertTrue('<span>42600.0</span>' in self.browser.contents) 342 self.payment_url = self.browser.url 343 self.browser.getLink("Pay via Interswitch", index=0).click() 344 self.assertTrue('Total Amount Authorized:' in self.browser.contents) 345 self.assertTrue( 346 '<input type="hidden" name="amount" value="4260000" />' 347 in self.browser.contents) 348 self.assertTrue( 349 'item_name="Acceptance Fee Plus" ' 350 'item_amt="4000000" bank_id="7" ' 351 'acct_num="1014847058"' in self.browser.contents) 352 353 def test_interswitch_form_regular_acceptance_fees(self): 299 self.assertTrue('ticket created' in self.browser.contents) 300 self.assertTrue('Amount Authorized' in self.browser.contents) 301 self.assertTrue('<span>16800.0</span>' in self.browser.contents) 302 self.browser.getLink("Pay via Interswitch", index=0).click() 303 self.assertTrue('Total Amount Authorized:' in self.browser.contents) 304 self.assertTrue( 305 '<input type="hidden" name="amount" value="1850000" />' 306 in self.browser.contents) 307 self.assertTrue(self.student['payments'].values()[0].net_amt == 16800) 308 self.assertTrue( 309 'item_name="Acceptance Fee" item_amt="1400000" bank_id="8" ' 310 'acct_num="2000249757"' in self.browser.contents) 311 312 self.certificate.study_mode = 'bridge' 313 self.browser.open(self.payments_path + '/addop') 314 self.browser.getControl(name="form.p_category").value = ['clearance'] 315 self.browser.getControl("Create ticket").click() 316 self.assertTrue('ticket created' in self.browser.contents) 317 self.assertTrue('Amount Authorized' in self.browser.contents) 318 self.assertTrue('<span>14000.0</span>' in self.browser.contents) 319 self.browser.getLink("Pay via Interswitch", index=0).click() 320 self.assertTrue('Total Amount Authorized:' in self.browser.contents) 321 self.assertTrue( 322 '<input type="hidden" name="amount" value="1570000" />' 323 in self.browser.contents) 324 self.assertTrue(self.student['payments'].values()[1].net_amt == 14000) 325 self.assertTrue( 326 'item_name="Acceptance Fee" item_amt="1400000" bank_id="8" ' 327 'acct_num="2000249757"' in self.browser.contents) 328 329 def deactivated_test_interswitch_form_concessional_fees(self): 354 330 self.certificate.study_mode = 'ug_ft' 355 #self.app['configuration']['2004'].clearance_fee = 43050.0331 self.app['configuration']['2004'].concessional_fee = 1567.0 356 332 # Manager can access InterswitchForm 357 333 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') … … 360 336 self.student.nationality = u'NG' 361 337 self.browser.open(self.payments_path + '/addop') 362 self.browser.getControl(name="form.p_category").value = ['clearance_incl']363 self.browser.getControl("Create ticket").click()364 self.assertTrue('ticket created' in self.browser.contents)365 self.assertTrue('Amount Authorized' in self.browser.contents)366 self.assertTrue('<span>16800.0</span>' in self.browser.contents)367 self.browser.getLink("Pay via Interswitch", index=0).click()368 self.assertTrue('Total Amount Authorized:' in self.browser.contents)369 self.assertTrue(370 '<input type="hidden" name="amount" value="1850000" />'371 in self.browser.contents)372 self.assertTrue(self.student['payments'].values()[0].net_amt == 16800)373 self.assertTrue(374 'item_name="Acceptance Fee" item_amt="1400000" bank_id="8" '375 'acct_num="2000249757"' in self.browser.contents)376 377 self.certificate.study_mode = 'bridge'378 self.browser.open(self.payments_path + '/addop')379 self.browser.getControl(name="form.p_category").value = ['clearance']380 self.browser.getControl("Create ticket").click()381 self.assertTrue('ticket created' in self.browser.contents)382 self.assertTrue('Amount Authorized' in self.browser.contents)383 self.assertTrue('<span>14000.0</span>' in self.browser.contents)384 self.browser.getLink("Pay via Interswitch", index=0).click()385 self.assertTrue('Total Amount Authorized:' in self.browser.contents)386 self.assertTrue(387 '<input type="hidden" name="amount" value="1570000" />'388 in self.browser.contents)389 self.assertTrue(self.student['payments'].values()[1].net_amt == 14000)390 self.assertTrue(391 'item_name="Acceptance Fee" item_amt="1400000" bank_id="8" '392 'acct_num="2000249757"' in self.browser.contents)393 394 def deactivated_test_interswitch_form_concessional_fees(self):395 self.certificate.study_mode = 'ug_ft'396 self.app['configuration']['2004'].concessional_fee = 1567.0397 # Manager can access InterswitchForm398 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')399 self.browser.open(self.payments_path)400 IWorkflowState(self.student).setState('admitted')401 self.student.nationality = u'NG'402 self.browser.open(self.payments_path + '/addop')403 338 self.browser.getControl(name="form.p_category").value = ['concessional'] 404 339 self.browser.getControl("Create ticket").click() … … 419 354 in self.browser.contents) 420 355 421 def deactivated_test_interswitch_form_ticket_expired(self):356 def test_interswitch_form_ticket_expired(self): 422 357 self.certificate.study_mode = 'ug_pt' 423 358 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') … … 435 370 self.assertEqual(self.student.current_mode, 'ug_pt') 436 371 self.assertTrue( 437 '<input type="hidden" name="amount" value=" 87600" />'372 '<input type="hidden" name="amount" value="257600" />' 438 373 in self.browser.contents) 439 374 delta = timedelta(days=8)
Note: See TracChangeset for help on using the changeset viewer.