- Timestamp:
- 5 Nov 2019, 23:19:58 (5 years ago)
- Location:
- main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/applicantsbrowser.py
r15702 r15755 33 33 34 34 from kofacustom.nigeria.etranzact.tests import ( 35 TERMINAL_ID, HOST, HTTPS, SECRET_KEY, LOGO_URL )35 TERMINAL_ID, HOST, HTTPS, SECRET_KEY, LOGO_URL, GATEWAY_AMT) 36 36 37 37 grok.templatedir('browser_templates') … … 93 93 terminal_id = TERMINAL_ID 94 94 logo_url = LOGO_URL 95 gateway_amt = GATEWAY_AMT 95 96 96 97 @property … … 101 102 102 103 def init_update(self): 104 if not module_activated(self.context.__parent__.__parent__.year): 105 return _("Etranzact payments deactivated.") 103 106 if self.context.p_state == 'paid': 104 107 return _("Payment ticket can't be re-sent to Etranzact.") … … 116 119 # which authenticates the response. 117 120 self.responseurl = self.url(self.context, 'receive_etranzact') 118 # Already now it becomes a Etranzact payment 119 self.context.r_company = u'etranzact' 120 hashargs = self.amount + self.terminal_id+self.transaction_id \ 121 self.transaction_id = self.context.p_id 122 hashargs = self.amount + self.terminal_id + self.transaction_id \ 121 123 + self.responseurl + self.secret_key 122 124 self.hashvalue = hashlib.md5(hashargs).hexdigest() … … 125 127 126 128 def update(self): 127 if not module_activated(self.context.__parent__.__parent__.year): 128 return 129 self.transaction_id = self.context.p_id 129 # Already now it becomes an Etranzact payment. We set the net amount 130 # and add the gateway amount. 131 if not self.context.r_company: 132 self.context.net_amt = self.context.amount_auth 133 self.context.amount_auth += self.gateway_amt 134 self.context.gateway_amt = self.gateway_amt 135 self.context.r_company = u'etranzact' 130 136 self.amount = "%.1f" % self.context.amount_auth 131 137 error = self.init_update() -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/helpers.py
r15734 r15755 181 181 payment.r_card_num = "%s %s" % (form.get('CARD_TYPE', None), 182 182 form.get('CARD_NO', None)) 183 payment.r_company = u'etranzact'184 183 if payment.r_code != '0': 185 184 msg = _('Unsuccessful response: ${a}', mapping = {'a': payment.r_desc}) -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/payoutletbrowser.py
r15730 r15755 39 39 from kofacustom.nigeria.students.interfaces import INigeriaStudentOnlinePayment 40 40 from kofacustom.nigeria.applicants.interfaces import INigeriaApplicantOnlinePayment 41 from kofacustom.nigeria.etranzact.tests import HOST, TERMINAL_ID, HTTPS 41 from kofacustom.nigeria.etranzact.tests import HOST, TERMINAL_ID, HTTPS, GATEWAY_AMT 42 42 from kofacustom.nigeria.etranzact.helpers import query_payoutlet 43 43 … … 84 84 85 85 class EtranzactEnterPinPageStudent(KofaPage): 86 """ 86 """Enter confirmation PIN and submit to `EtranzactQueryHistoryPageStudent` 87 87 """ 88 88 grok.context(INigeriaStudentOnlinePayment) … … 95 95 action = 'query_payoutlet_history' 96 96 placeholder = _('Confirmation Number (PIN)') 97 gateway_amt = GATEWAY_AMT 97 98 98 99 def update(self): 99 100 if not module_activated(self.context.student.current_session): 100 101 return 102 if self.context.r_company and self.context.r_company != 'etranzact': 103 return _("Payment ticket has been used for another payment gateway.") 101 104 super(EtranzactEnterPinPageStudent, self).update() 105 # Already now it becomes an Etranzact payment. We set the net amount 106 # and add the gateway amount. 107 if not self.context.r_company: 108 self.context.net_amt = self.context.amount_auth 109 self.context.amount_auth += self.gateway_amt 110 self.context.gateway_amt = self.gateway_amt 111 self.context.r_company = u'etranzact' 102 112 return 103 113 104 114 class EtranzactEnterPinPageApplicant(EtranzactEnterPinPageStudent): 105 """ 115 """Enter confirmation PIN and submit to `EtranzactQueryHistoryPageApplicant` 106 116 """ 107 117 grok.require('waeup.payApplicant') … … 155 165 if not module_activated(self.context.__parent__.__parent__.year): 156 166 return 157 ob_class = self.__implemented__.__name__158 167 if self.context.p_state == 'paid': 159 168 self.flash(_('This ticket has already been paid.')) -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/studentsbrowser.py
r15702 r15755 33 33 34 34 from kofacustom.nigeria.etranzact.tests import ( 35 TERMINAL_ID, HOST, HTTPS, SECRET_KEY, LOGO_URL )35 TERMINAL_ID, HOST, HTTPS, SECRET_KEY, LOGO_URL, GATEWAY_AMT) 36 36 37 37 grok.templatedir('browser_templates') … … 93 93 terminal_id = TERMINAL_ID 94 94 logo_url = LOGO_URL 95 gateway_amt = GATEWAY_AMT 95 96 96 97 @property … … 101 102 102 103 def init_update(self): 104 if not module_activated(self.context.student.current_session): 105 return _("Etranzact payments deactivated.") 103 106 if self.context.p_state == 'paid': 104 107 return _("Payment ticket can't be re-sent to Etranzact.") … … 116 119 # which authenticates the response. 117 120 self.responseurl = self.url(self.context, 'receive_etranzact') 118 # Already now it becomes a Etranzact payment 119 self.context.r_company = u'etranzact' 120 hashargs = self.amount + self.terminal_id+self.transaction_id \ 121 self.transaction_id = self.context.p_id 122 hashargs = self.amount + self.terminal_id + self.transaction_id \ 121 123 + self.responseurl + self.secret_key 122 124 self.hashvalue = hashlib.md5(hashargs).hexdigest() … … 125 127 126 128 def update(self): 127 if not module_activated(self.context.student.current_session): 128 return 129 self.transaction_id = self.context.p_id 129 # Already now it becomes an Etranzact payment. We set the net amount 130 # and add the gateway amount. 131 if not self.context.r_company: 132 self.context.net_amt = self.context.amount_auth 133 self.context.amount_auth += self.gateway_amt 134 self.context.gateway_amt = self.gateway_amt 135 self.context.r_company = u'etranzact' 130 136 self.amount = "%.1f" % self.context.amount_auth 131 137 error = self.init_update() -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/tests.py
r15734 r15755 41 41 # do exist really and are not bothered by being spammed by a test programme. 42 42 43 EXTERNAL_TESTS = True43 EXTERNAL_TESTS = False 44 44 45 45 TERMINAL_ID = '5003021194' … … 48 48 SECRET_KEY = 'DEMO_KEY' 49 49 LOGO_URL = 'https://iuokada.waeup.org/static_custom/iou_logo.png' 50 GATEWAY_AMT = 500.0 50 51 51 52 # Valid transaction id in Etranzact system
Note: See TracChangeset for help on using the changeset viewer.