Changeset 8428 for main/waeup.kofa/trunk
- Timestamp:
- 12 May 2012, 07:01:04 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
r8422 r8428 599 599 600 600 def update(self): 601 success, msg = self.context.approveApplicantPayment()602 if success:601 success, msg, log = self.context.approveApplicantPayment() 602 if log is not None: 603 603 ob_class = self.__implemented__.__name__.replace('waeup.kofa.','') 604 self.context.__parent__.loggerInfo( 605 ob_class, 'valid callback: %s' % self.context.p_id) 604 self.context.__parent__.loggerInfo(ob_class, log) 606 605 self.flash(msg) 607 606 return -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/payment.py
r8422 r8428 45 45 wf_info.fireTransition('pay') 46 46 except InvalidTransitionError: 47 return False, 'Error: %s' % sys.exc_info()[1] 48 return True, _('Valid callback received.') 47 msg = log = 'Error: %s' % sys.exc_info()[1] 48 return False, msg, log 49 log = 'successful payment: %s' % self.p_id 50 msg = _('Successful payment') 51 return False, msg, log 49 52 50 53 def approveApplicantPayment(self): … … 52 55 """ 53 56 if self.p_state == 'paid': 54 return False, _('This ticket has already been paid.') 57 return False, _('This ticket has already been paid.'), None 55 58 self.approve() 56 59 return self.doAfterApplicantPayment() -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r8420 r8428 1138 1138 1139 1139 def update(self): 1140 success, msg = self.context.approveStudentPayment()1141 if success:1142 write_log_message(self, 'valid callback: %s' % self.context.p_id)1140 success, msg, log = self.context.approveStudentPayment() 1141 if log is not None: 1142 write_log_message(self,log) 1143 1143 self.flash(msg) 1144 1144 return -
main/waeup.kofa/trunk/src/waeup/kofa/students/payments.py
r8422 r8428 69 69 'CLR',0,self.amount_auth,student.student_id) 70 70 if error: 71 return False, _('Valid callback received. ${a}', 72 mapping = {'a':error}) 71 return False, error, error 73 72 self.ac = pin 74 73 elif self.p_category == 'schoolfee': … … 77 76 'SFE',0,self.amount_auth,student.student_id) 78 77 if error: 79 return False, _('Valid callback received. ${a}', 80 mapping = {'a':error}) 78 return False, error, error 81 79 self.ac = pin 82 80 elif self.p_category == 'bed_allocation': … … 85 83 'HOS',0,self.amount_auth,student.student_id) 86 84 if error: 87 return False, _('Valid callback received. ${a}', 88 mapping = {'a':error}) 85 return False, error, error 89 86 self.ac = pin 90 return True, _('Valid callback received.') 87 log = 'successful payment: %s' % self.p_id 88 msg = _('Successful payment') 89 return True, msg, log 91 90 92 91 def approveStudentPayment(self): … … 94 93 """ 95 94 if self.p_state == 'paid': 96 return False, _('This ticket has already been paid.') 95 return False, _('This ticket has already been paid.'), None 97 96 self.approve() 98 97 return self.doAfterStudentPayment() -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r8420 r8428 1293 1293 self.browser.open(payment_url) 1294 1294 self.browser.getLink("Approve payment").click() 1295 self.assertMatches('... Valid callback received...',1295 self.assertMatches('...Successful payment...', 1296 1296 self.browser.contents) 1297 1297 … … 1344 1344 self.browser.getLink(value).click() 1345 1345 self.browser.open(self.browser.url + '/approve') 1346 self.assertMatches('... Valid callback received...',1346 self.assertMatches('...Successful payment...', 1347 1347 self.browser.contents) 1348 1348 expected = '''... … … 1383 1383 # In the base package they can 'use' a fake approval view 1384 1384 self.browser.open(payment_url + '/fake_approve') 1385 self.assertMatches('... Valid callback received...',1385 self.assertMatches('...Successful payment...', 1386 1386 self.browser.contents) 1387 1387 expected = '''... … … 1457 1457 self.assertEqual(len(self.app['accesscodes']['SFE-0']),0) 1458 1458 self.browser.open(self.browser.url + '/fake_approve') 1459 self.assertMatches('... Valid callback received...',1459 self.assertMatches('...Successful payment...', 1460 1460 self.browser.contents) 1461 1461
Note: See TracChangeset for help on using the changeset viewer.