Changeset 15916 for main/kofacustom.nigeria
- Timestamp:
- 10 Jan 2020, 12:14:21 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/helpers.py
r15730 r15916 78 78 try: 79 79 h.request("GET", url, headers=headers) 80 resp = h.getresponse() 80 81 except: 81 82 return {'error': 'Socket Error: Connection to Remita gateway refused.'} 82 resp = h.getresponse()83 83 if resp.status!=200: 84 84 return {'error': 'Connection error (%s, %s)' % (resp.status, resp.reason)} … … 113 113 payment.r_desc = jr['message'] 114 114 payment.r_amount_approved = jr['amount'] 115 payment.r_pay_reference = jr['RRR'] 115 try: 116 payment.r_pay_reference = jr['RRR'] 117 except KeyError: 118 msg = _('Error: ${a}', mapping = {'a': payment.r_desc}) 119 log = 'unsuccessful response for %s payment %s: %s' % ( 120 payment.p_category, payment.p_id, payment.r_desc) 121 payment.p_state = 'failed' 122 notify(grok.ObjectModifiedEvent(payment)) 123 return False, msg, log 116 124 #payment.r_company = u'remita' 117 125 if payment.r_code not in ('00', '01'):
Note: See TracChangeset for help on using the changeset viewer.