Changeset 15772
- Timestamp:
- 7 Nov 2019, 17:00:51 (5 years ago)
- Location:
- main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/applicantsbrowser.py
r15770 r15772 31 31 from kofacustom.nigeria.applicants.interfaces import INigeriaApplicantOnlinePayment 32 32 from kofacustom.nigeria.interfaces import MessageFactory as _ 33 33 from kofacustom.nigeria.etranzact.studentsbrowser import webconnect_module_activated 34 34 from kofacustom.nigeria.etranzact.tests import ( 35 35 TERMINAL_ID, HOST, HTTPS, SECRET_KEY, LOGO_URL, GATEWAY_AMT) 36 36 37 37 grok.templatedir('browser_templates') 38 39 def module_activated(session, payment):40 if payment.r_company and payment.r_company != 'etranzact':41 return False42 try:43 return getattr(grok.getSite()['configuration'][str(session)],44 'etranzact_webconnect_enabled', False)45 except KeyError:46 return False47 38 48 39 class EtranzactActionButtonApplicant(ManageActionButton): … … 57 48 @property 58 49 def target_url(self): 59 if not module_activated(50 if not webconnect_module_activated( 60 51 self.context.__parent__.__parent__.year, self.context): 61 52 return '' … … 75 66 @property 76 67 def target_url(self): 77 if not module_activated(68 if not webconnect_module_activated( 78 69 self.context.__parent__.__parent__.year, self.context): 79 70 return '' … … 106 97 107 98 def init_update(self): 108 if not module_activated(109 self.context.__parent__.__parent__.year, self.context):110 return _("Etranzact payments deactivated.")111 99 if self.context.p_state == 'paid': 112 100 return _("Payment ticket can't be re-sent to Etranzact.") … … 134 122 # Already now it becomes an Etranzact payment. We set the net amount 135 123 # and add the gateway amount. 124 if not webconnect_module_activated( 125 self.context.__parent__.__parent__.year, self.context): 126 return _("Etranzact payments deactivated.") 136 127 if not self.context.r_company: 137 128 self.context.net_amt = self.context.amount_auth … … 157 148 def update(self): 158 149 super(EtranzactReceiveResponseApplicant, self).update() 159 if not module_activated(150 if not webconnect_module_activated( 160 151 self.context.__parent__.__parent__.year, self.context): 161 152 return … … 191 182 192 183 def update(self): 193 if not module_activated(184 if not webconnect_module_activated( 194 185 self.context.__parent__.__parent__.year, self.context): 195 186 return -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/payoutletbrowser.py
r15771 r15772 44 44 grok.templatedir('browser_templates') 45 45 46 def module_activated(session, payment):46 def payoutlet_module_activated(session, payment): 47 47 if payment.r_company and payment.r_company != 'etranzact': 48 48 return False … … 63 63 @property 64 64 def target_url(self): 65 if not module_activated(65 if not payoutlet_module_activated( 66 66 self.context.__parent__.__parent__.year, self.context): 67 67 return '' … … 80 80 @property 81 81 def target_url(self): 82 if not module_activated(82 if not payoutlet_module_activated( 83 83 self.context.student.current_session, self.context): 84 84 return '' … … 102 102 103 103 def update(self): 104 if not module_activated(104 if not payoutlet_module_activated( 105 105 self.context.student.current_session, self.context): 106 106 return … … 124 124 125 125 def update(self): 126 if not module_activated(126 if not payoutlet_module_activated( 127 127 self.context.__parent__.__parent__.year, self.context): 128 128 return … … 148 148 149 149 def update(self, confirmation_number=None): 150 if not module_activated(150 if not payoutlet_module_activated( 151 151 self.context.student.current_session, self.context): 152 152 return … … 183 183 184 184 def update(self, confirmation_number=None): 185 if not module_activated(185 if not payoutlet_module_activated( 186 186 self.context.__parent__.__parent__.year, self.context): 187 187 return -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/studentsbrowser.py
r15770 r15772 37 37 grok.templatedir('browser_templates') 38 38 39 def module_activated(session, payment):39 def webconnect_module_activated(session, payment): 40 40 if payment.r_company and payment.r_company != 'etranzact': 41 41 return False … … 57 57 @property 58 58 def target_url(self): 59 if not module_activated(59 if not webconnect_module_activated( 60 60 self.context.student.current_session, self.context): 61 61 return '' … … 75 75 @property 76 76 def target_url(self): 77 if not module_activated(77 if not webconnect_module_activated( 78 78 self.context.student.current_session, self.context): 79 79 return '' … … 106 106 107 107 def init_update(self): 108 if not module_activated(109 self.context.student.current_session, self.context):110 return _("Etranzact payments deactivated.")111 108 if self.context.p_state == 'paid': 112 109 return _("Payment ticket can't be re-sent to Etranzact.") … … 134 131 # Already now it becomes an Etranzact payment. We set the net amount 135 132 # and add the gateway amount. 133 if not webconnect_module_activated( 134 self.context.student.current_session, self.context): 135 return _("Etranzact payments deactivated.") 136 136 if not self.context.r_company: 137 137 self.context.net_amt = self.context.amount_auth … … 157 157 def update(self): 158 158 super(EtranzactReceiveResponseStudent, self).update() 159 if not module_activated(159 if not webconnect_module_activated( 160 160 self.context.student.current_session, self.context): 161 161 return … … 191 191 192 192 def update(self): 193 if not module_activated(193 if not webconnect_module_activated( 194 194 self.context.student.current_session, self.context): 195 195 return
Note: See TracChangeset for help on using the changeset viewer.