- Timestamp:
- 15 Jun 2012, 11:09:58 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/payments.py
r8708 r8732 61 61 return None 62 62 63 def doAfterStudentPayment(self): 64 """Process student after payment was made. 65 """ 63 def _createActivationCodes(self): 66 64 student = self.getStudent() 67 65 if self.p_category == 'clearance': … … 70 68 'CLR',0,self.amount_auth,student.student_id) 71 69 if error: 72 return False, error,error70 return error 73 71 self.ac = pin 74 elif self.p_category == 'schoolfee':72 elif self.p_category in ('schoolfee', 'schoolfee_1'): 75 73 # Create SFE access code 76 74 pin, error = create_accesscode( 77 75 'SFE',0,self.amount_auth,student.student_id) 78 76 if error: 79 return False, error,error77 return error 80 78 self.ac = pin 81 79 elif self.p_category == 'bed_allocation': … … 84 82 'HOS',0,self.amount_auth,student.student_id) 85 83 if error: 86 return False, error,error84 return error 87 85 self.ac = pin 86 return None 87 88 def doAfterStudentPayment(self): 89 """Process student after payment was made. 90 """ 91 error = self._createActivationCodes() 92 if error is not None: 93 return False, error, error 88 94 log = 'successful payment: %s' % self.p_id 89 95 msg = _('Successful payment') … … 93 99 """Process student after payment was approved. 94 100 """ 95 student = self.getStudent() 96 if self.p_category == 'clearance': 97 # Create CLR access code 98 pin, error = create_accesscode( 99 'CLR',0,self.amount_auth,student.student_id) 100 if error: 101 return False, error, error 102 self.ac = pin 103 elif self.p_category == 'schoolfee': 104 # Create SFE access code 105 pin, error = create_accesscode( 106 'SFE',0,self.amount_auth,student.student_id) 107 if error: 108 return False, error, error 109 self.ac = pin 110 elif self.p_category == 'bed_allocation': 111 # Create HOS access code 112 pin, error = create_accesscode( 113 'HOS',0,self.amount_auth,student.student_id) 114 if error: 115 return False, error, error 116 self.ac = pin 101 error = self._createActivationCodes() 102 if error is not None: 103 return False, error, error 117 104 log = 'payment approved: %s' % self.p_id 118 105 msg = _('Payment approved') … … 125 112 return False, _('This ticket has already been paid.'), None 126 113 self.approve() 127 return self.doAfterStudentPayment ()114 return self.doAfterStudentPaymentApproval() 128 115 129 116 -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r8708 r8732 1312 1312 self.browser.open(payment_url) 1313 1313 self.browser.getLink("Approve payment").click() 1314 self.assertMatches('... Successful payment...',1314 self.assertMatches('...Payment approved...', 1315 1315 self.browser.contents) 1316 1316 … … 1363 1363 self.browser.getLink(value).click() 1364 1364 self.browser.open(self.browser.url + '/approve') 1365 self.assertMatches('... Successful payment...',1365 self.assertMatches('...Payment approved...', 1366 1366 self.browser.contents) 1367 1367 expected = '''... … … 1402 1402 # In the base package they can 'use' a fake approval view 1403 1403 self.browser.open(payment_url + '/fake_approve') 1404 self.assertMatches('... Successful payment...',1404 self.assertMatches('...Payment approved...', 1405 1405 self.browser.contents) 1406 1406 expected = '''... … … 1484 1484 self.assertEqual(len(self.app['accesscodes']['SFE-0']),0) 1485 1485 self.browser.open(self.browser.url + '/fake_approve') 1486 self.assertMatches('... Successful payment...',1486 self.assertMatches('...Payment approved...', 1487 1487 self.browser.contents) 1488 1488 … … 1548 1548 self.assertEqual(len(self.app['accesscodes']['SFE-0']),0) 1549 1549 self.browser.open(self.browser.url + '/fake_approve') 1550 self.assertMatches('... Successful payment...',1550 self.assertMatches('...Payment approved...', 1551 1551 self.browser.contents) 1552 1552
Note: See TracChangeset for help on using the changeset viewer.