Changeset 17783
- Timestamp:
- 14 May 2024, 08:46:27 (7 months 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/credobrowser.py
r17730 r17783 138 138 gateway_amt = 0.0 # is being added by Etranzact 139 139 140 serviceCode = None 141 140 142 def init_update(self): 141 143 if self.context.p_state == 'paid': … … 176 178 def pay(self, **data): 177 179 success, url_or_message = initiate_payment( 178 self.context, self.host, self.callbackUrl, self.api_public_key) 180 self.context, self.host, self.callbackUrl, 181 self.api_public_key, self.serviceCode) 179 182 if success: 180 183 self.redirect(url_or_message, trusted=True) -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/helpers.py
r17754 r17783 289 289 # Etranzact Credo payments helper functions 290 290 291 def get_JSON_response_initialize(payment, host, callbackUrl, public_api_key): 291 def get_JSON_response_initialize(payment, host, callbackUrl, 292 public_api_key, serviceCode): 292 293 headers={ 293 294 'Content-Type':'application/JSON', … … 311 312 'customerPhoneNumber': phone, 312 313 'bearer': '0', 314 'serviceCode': serviceCode, 313 315 } 314 316 try: … … 346 348 347 349 348 def initiate_payment(payment, host, callbackUrl, public_api_key): 349 response = get_JSON_response_initialize(payment, host, callbackUrl, public_api_key) 350 def initiate_payment(payment, host, callbackUrl, public_api_key, serviceCode): 351 response = get_JSON_response_initialize( 352 payment, host, callbackUrl, public_api_key, serviceCode) 350 353 if response.get('error', None): 351 354 return False, response['error'] -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/tests.py
r17730 r17783 363 363 public_api_key = API_PUBLIC_KEY 364 364 callbackUrl = 'aa.aa.aa' 365 response = get_JSON_response_initialize(self.payment2, CREDO_HOST, callbackUrl, public_api_key )365 response = get_JSON_response_initialize(self.payment2, CREDO_HOST, callbackUrl, public_api_key, None) 366 366 367 367 ## A typical response … … 379 379 380 380 # Payment already exists 381 self.assertEqual(response, {'error': {u'reference': u'Reference must be unique'}})381 self.assertEqual(response, {'error': u'Reference must be unique. '}) 382 382 383 383 #self.assertEqual(response['status'], 200) … … 436 436 public_api_key = API_PUBLIC_KEY 437 437 callbackUrl = 'aa.aa.aa' 438 response = get_JSON_response_initialize(self.payment2, CREDO_HOST, callbackUrl, public_api_key )438 response = get_JSON_response_initialize(self.payment2, CREDO_HOST, callbackUrl, public_api_key, None) 439 439 440 440 # Payment already exists 441 self.assertEqual(response, {'error': {u'reference': u'Reference must be unique'}})441 self.assertEqual(response, {'error': u'Reference must be unique. '}) 442 442 443 443 #self.assertEqual(response['status'], 200)
Note: See TracChangeset for help on using the changeset viewer.