Changeset 16084
- Timestamp:
- 4 May 2020, 13:33:15 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/etranzact/browser.py
r15999 r16084 32 32 33 33 from kofacustom.nigeria.etranzact.tests import ( 34 HOST, HTTPS , SECRET_KEY, TERMINAL_ID)34 HOST, HTTPS) 35 35 36 36 HOST = 'www.etranzact.net' 37 37 HTTPS = True 38 #SECRET_KEY =39 TERMINAL_ID = '7007134590'40 38 GATEWAY_AMT = 500.0 41 39 LOGO_URL = 'https://iuokada.waeup.org/static_custom/iou_logo.png' 42 40 41 WEBCONNECT_STUD_PARAMS = { 42 'schoolfee': ('7007139588','QIgl9a35R30A1RGK'), 43 'schoolfee40': ('7007139589','3coU0eolOEbEUeO3'), 44 'secondinstal': ('7007139590','zGpEjy6CdPxCHqen'), 45 'transcript_local': ('7007139592','ndgxUtzJgHRkvXlB'), 46 'transcript_overseas': ('7007139592','ndgxUtzJgHRkvXlB'), 47 'registration': ('7007139599','KGHjZ2hRbaDJGBX8'), 48 'book': ('7007139600','rrKE2Ua7eu8TF0Is'), 49 'parentsconsult': ('7007139598','HsqjOlAB5xfQNDyo'), 50 'sundry': ('7007139591','0XkOFShPnWn8tY5O'), 51 } 52 53 def determine_appl_params(payment): 54 terminal_id = '' 55 secret_key = '' 56 if payment.__parent__.__parent__.prefix.startswith('pg'): 57 terminal_id = '7007139606' 58 secret_key = 'E64s3IN9cXRJeltY' 59 else: 60 terminal_id = '7007139604' 61 secret_key = 'vlEEJxvJBjC468g1' 62 return terminal_id, secret_key 63 64 def determine_stud_params(payment): 65 terminal_id = '' 66 secret_key = '' 67 for key in WEBCONNECT_STUD_PARAMS.keys(): 68 if payment.p_category == key: 69 terminal_id = WEBCONNECT_STUD_PARAMS[key][0] 70 secret_key = WEBCONNECT_STUD_PARAMS[key][1] 71 if not terminal_id: 72 terminal_id = WEBCONNECT_STUD_PARAMS['sundry'][0] 73 secret_key = WEBCONNECT_STUD_PARAMS['sundry'][1] 74 return terminal_id, secret_key 75 43 76 class CustomEtranzactPageApplicant(EtranzactPageApplicant): 44 77 45 78 host = HOST 46 79 https = HTTPS 47 secret_key = SECRET_KEY 48 terminal_id = TERMINAL_ID 49 logo_url = LOGO_URL 50 gateway_amt = GATEWAY_AMT 80 logo_url = LOGO_URL 81 gateway_amt = GATEWAY_AMT 82 83 @property 84 def terminal_id(self): 85 return determine_appl_params(self.context)[0] 86 87 @property 88 def secret_key(self): 89 return determine_appl_params(self.context)[1] 51 90 52 91 def update(self): … … 73 112 class CustomEtranzactReceiveResponseApplicant(EtranzactReceiveResponseApplicant): 74 113 75 secret_key = SECRET_KEY 76 terminal_id = TERMINAL_ID 114 @property 115 def terminal_id(self): 116 return determine_appl_params(self.context)[0] 117 118 @property 119 def secret_key(self): 120 return determine_appl_params(self.context)[1] 77 121 78 122 class CustomEtranzactRequestPaymentStatusPageApplicant( … … 81 125 host = HOST 82 126 https = HTTPS 83 secret_key = SECRET_KEY 84 terminal_id = TERMINAL_ID 85 logo_url = LOGO_URL 127 logo_url = LOGO_URL 128 129 @property 130 def terminal_id(self): 131 return determine_appl_params(self.context)[0] 132 133 @property 134 def secret_key(self): 135 return determine_appl_params(self.context)[1] 86 136 87 137 class CustomEtranzactPageStudent(EtranzactPageStudent): … … 89 139 host = HOST 90 140 https = HTTPS 91 secret_key = SECRET_KEY 92 terminal_id = TERMINAL_ID 93 logo_url = LOGO_URL 94 gateway_amt = GATEWAY_AMT 141 logo_url = LOGO_URL 142 gateway_amt = GATEWAY_AMT 143 144 @property 145 def terminal_id(self): 146 return determine_stud_params(self.context)[0] 147 148 @property 149 def secret_key(self): 150 return determine_stud_params(self.context)[1] 95 151 96 152 def update(self): … … 117 173 class CustomEtranzactReceiveResponseStudent(EtranzactReceiveResponseStudent): 118 174 119 secret_key = SECRET_KEY 120 terminal_id = TERMINAL_ID 175 @property 176 def terminal_id(self): 177 return determine_stud_params(self.context)[0] 178 179 @property 180 def secret_key(self): 181 return determine_stud_params(self.context)[1] 121 182 122 183 class CustomEtranzactRequestPaymentStatusPageStudent( … … 125 186 host = HOST 126 187 https = HTTPS 127 secret_key = SECRET_KEY 128 terminal_id = TERMINAL_ID 129 logo_url = LOGO_URL 188 logo_url = LOGO_URL 189 190 @property 191 def terminal_id(self): 192 return determine_stud_params(self.context)[0] 193 194 @property 195 def secret_key(self): 196 return determine_stud_params(self.context)[1] 197 198 199 200 130 201 131 202 # Payoutlet customizations … … 182 253 """ Query history of Etranzact payments 183 254 """ 184 terminal_id = TERMINAL_ID255 terminal_id = '7007134590' 185 256 host = HOST 186 257 https = HTTPS
Note: See TracChangeset for help on using the changeset viewer.