Ignore:
Timestamp:
7 Nov 2019, 15:43:51 (5 years ago)
Author:
Henrik Bettermann
Message:

Do not show buttons of other payment gatewas if payment was already send.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/payoutletbrowser.py

    r15755 r15770  
    4444grok.templatedir('browser_templates')
    4545
    46 def module_activated(session):
     46def module_activated(session, payment):
     47    if payment.r_company and payment.r_company != 'etranzact':
     48        return False
    4749    try:
    4850        return getattr(grok.getSite()['configuration'][str(session)],
     
    6163    @property
    6264    def target_url(self):
    63         if not module_activated(self.context.__parent__.__parent__.year):
     65        if not module_activated(
     66            self.context.__parent__.__parent__.year, self.context):
    6467            return ''
    6568        if self.context.p_state in ('paid', 'waived'):
     
    7780    @property
    7881    def target_url(self):
    79         if not module_activated(self.context.student.current_session):
     82        if not module_activated(
     83            self.context.student.current_session, self.context):
    8084            return ''
    8185        if self.context.p_state in ('paid', 'waived'):
     
    98102
    99103    def update(self):
    100         if not module_activated(self.context.student.current_session):
     104        if not module_activated(
     105            self.context.student.current_session, self.context):
    101106            return
    102         if self.context.r_company and self.context.r_company != 'etranzact':
    103             return _("Payment ticket has been used for another payment gateway.")
    104107        super(EtranzactEnterPinPageStudent, self).update()
    105108        # Already now it becomes an Etranzact payment. We set the net amount
     
    129132
    130133    def update(self, confirmation_number=None):
    131         if not module_activated(self.context.student.current_session):
     134        if not module_activated(
     135            self.context.student.current_session, self.context):
    132136            return
    133137        if self.context.p_state == 'paid':
     
    163167
    164168    def update(self, confirmation_number=None):
    165         if not module_activated(self.context.__parent__.__parent__.year):
     169        if not module_activated(
     170            self.context.__parent__.__parent__.year, self.context):
    166171            return
    167172        if self.context.p_state == 'paid':
Note: See TracChangeset for help on using the changeset viewer.