- Timestamp:
- 5 Nov 2019, 23:19:58 (5 years ago)
- Location:
- main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/applicantsbrowser.py
r15529 r15755 34 34 35 35 from kofacustom.nigeria.remita.tests import ( 36 MERCHANTID, HOST, HTTPS, API_KEY, SERVICETYPEID )36 MERCHANTID, HOST, HTTPS, API_KEY, SERVICETYPEID, GATEWAY_AMT) 37 37 38 38 grok.templatedir('browser_templates') … … 235 235 if self.context.p_state == 'paid': 236 236 return _("Payment ticket can't be re-sent to Remita.") 237 if self.context.r_company and self.context.r_company != 'remita': 238 return _("Payment ticket has been used for another payment gateway.") 237 239 now = datetime.utcnow() 238 240 if self.context.creation_date.tzinfo is not None: … … 260 262 if resp.get('statuscode') not in ('021', '025', '055'): 261 263 return 'RRR generation message from Remita: ' + resp.get('status') 262 # Already now it becomes a Remita payment263 self.context.r_company = u'remita'264 264 self.rrr = self.context.r_pay_reference = resp['RRR'].rstrip() 265 265 hashargs = self.merchantId + self.rrr + self.api_key … … 269 269 'RRR retrieved: %s, ServiceTypeId: %s' 270 270 % (self.rrr, self.serviceTypeId)) 271 272 271 return 273 272 … … 281 280 self.redirect(self.url(self.context, '@@index')) 282 281 return 283 return 282 # Already now it becomes a Remita payment. We set the net amount 283 # and add the gateway amount. 284 if not self.context.r_company: 285 self.context.net_amt = self.context.amount_auth 286 self.context.amount_auth += self.gateway_amt 287 self.context.gateway_amt = self.gateway_amt 288 self.context.r_company = u'remita' 289 self.amount_auth = int(100 * self.context.amount_auth) 290 return -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/studentsbrowser.py
r14805 r15755 34 34 35 35 from kofacustom.nigeria.remita.tests import ( 36 MERCHANTID, HOST, HTTPS, API_KEY, SERVICETYPEID )36 MERCHANTID, HOST, HTTPS, API_KEY, SERVICETYPEID, GATEWAY_AMT) 37 37 38 38 grok.templatedir('browser_templates') … … 221 221 api_key = API_KEY 222 222 serviceTypeId = SERVICETYPEID 223 gateway_amt = GATEWAY_AMT 223 224 224 225 #orderId = '3456346346' … … 243 244 if self.context.p_state == 'paid': 244 245 return _("Payment ticket can't be re-sent to Remita.") 246 if self.context.r_company and self.context.r_company != 'remita': 247 return _("Payment ticket has been used for another payment gateway.") 245 248 now = datetime.utcnow() 246 249 if self.context.creation_date.tzinfo is not None: … … 276 279 if resp.get('statuscode') not in ('021', '025', '055'): 277 280 return 'RRR generation message from Remita: ' + resp.get('status') 278 # Already now it becomes a Remita payment279 self.context.r_company = u'remita'280 281 self.rrr = self.context.r_pay_reference = resp['RRR'].rstrip() 281 282 hashargs = self.merchantId + self.rrr + self.api_key … … 296 297 self.redirect(self.url(self.context, '@@index')) 297 298 return 298 return 299 # Already now it becomes a Remita payment. We set the net amount 300 # and add the gateway amount. 301 if not self.context.r_company: 302 self.context.net_amt = self.context.amount_auth 303 self.context.amount_auth += self.gateway_amt 304 self.context.gateway_amt = self.gateway_amt 305 self.context.r_company = u'remita' 306 self.amount_auth = int(100 * self.context.amount_auth) 307 return -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/tests.py
r15468 r15755 44 44 API_KEY = '1946' 45 45 SERVICETYPEID = '4430731' 46 GATEWAY_AMT = 0.0 46 47 47 48 def external_test(func): … … 86 87 lineitems=self.lineitems) 87 88 return resp 89 90 def test_dummytest(self): 91 return 88 92 89 93 @external_test
Note: See TracChangeset for help on using the changeset viewer.