Changeset 8422 for main/waeup.kofa/trunk/src/waeup/kofa/applicants
- Timestamp:
- 11 May 2012, 16:32:07 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/applicants
- Files:
-
- 3 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)
Note: See TracChangeset for help on using the changeset viewer.