Changeset 8422 for main/waeup.kofa/trunk/src
- Timestamp:
- 11 May 2012, 16:32:07 (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
r8420 r8422 599 599 600 600 def update(self): 601 self.wf_info = IWorkflowInfo(self.context.__parent__) 602 try: 603 self.wf_info.fireTransition('pay') 604 except InvalidTransitionError: 605 self.flash('Error: %s' % sys.exc_info()[1]) 606 return 607 self.context.approve() 608 ob_class = self.__implemented__.__name__.replace('waeup.kofa.','') 609 self.context.__parent__.loggerInfo( 610 ob_class, 'valid callback: %s' % self.context.p_id) 611 self.flash(_('Valid callback received.')) 601 success, msg = self.context.approveApplicantPayment() 602 if success: 603 ob_class = self.__implemented__.__name__.replace('waeup.kofa.','') 604 self.context.__parent__.loggerInfo( 605 ob_class, 'valid callback: %s' % self.context.p_id) 606 self.flash(msg) 612 607 return 613 608 -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py
r8388 r8422 517 517 518 518 """ 519 520 def doAfterApplicantPayment(): 521 """Process applicant after payment was made. 522 523 """ 524 525 def approveApplicantPayment(): 526 """Approve payment and process applicant. 527 528 """ -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/payment.py
r8260 r8422 20 20 """ 21 21 import grok 22 from hurry.workflow.interfaces import IWorkflowInfo 22 23 from zope.component.interfaces import IFactory 23 24 from zope.interface import implementedBy 25 from waeup.kofa.interfaces import MessageFactory as _ 24 26 from waeup.kofa.payments import OnlinePayment 25 27 from waeup.kofa.applicants.interfaces import IApplicantOnlinePayment … … 35 37 super(ApplicantOnlinePayment, self).__init__() 36 38 return 39 40 def doAfterApplicantPayment(self): 41 """Process applicant after payment was made. 42 """ 43 wf_info = IWorkflowInfo(self.__parent__) 44 try: 45 wf_info.fireTransition('pay') 46 except InvalidTransitionError: 47 return False, 'Error: %s' % sys.exc_info()[1] 48 return True, _('Valid callback received.') 49 50 def approveApplicantPayment(self): 51 """Approve payment and process applicant. 52 """ 53 if self.p_state == 'paid': 54 return False, _('This ticket has already been paid.') 55 self.approve() 56 return self.doAfterApplicantPayment() 37 57 38 58 ApplicantOnlinePayment = attrs_to_fields(ApplicantOnlinePayment) -
main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py
r8420 r8422 510 510 ) 511 511 512 def doAfterStudentPayment(): 513 """Process student after payment was made. 514 515 """ 516 512 517 def approveStudentPayment(): 513 """Approve payment and create respective activation codes.518 """Approve payment and process student. 514 519 515 520 """ -
main/waeup.kofa/trunk/src/waeup/kofa/students/payments.py
r8420 r8422 60 60 return None 61 61 62 def approveStudentPayment(self):63 """ Approve payment and create respective activation code.62 def doAfterStudentPayment(self): 63 """Process student after payment was made. 64 64 """ 65 if self.p_state == 'paid':66 return False, _('This ticket has already been paid.')67 65 student = self.getStudent() 68 self.approve()69 66 if self.p_category == 'clearance': 70 67 # Create CLR access code … … 93 90 return True, _('Valid callback received.') 94 91 92 def approveStudentPayment(self): 93 """Approve payment and process student. 94 """ 95 if self.p_state == 'paid': 96 return False, _('This ticket has already been paid.') 97 self.approve() 98 return self.doAfterStudentPayment() 99 100 95 101 StudentOnlinePayment = attrs_to_fields(StudentOnlinePayment) 96 102
Note: See TracChangeset for help on using the changeset viewer.