Changeset 14743 for main/kofacustom.nigeria/trunk
- Timestamp:
- 2 Aug 2017, 08:28:31 (7 years ago)
- Location:
- main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita
- Files:
-
- 3 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/helpers.py
r14741 r14743 61 61 return parsed_json 62 62 63 64 63 def get_payment_status_via_rrr(merchantId, api_key, RRR, host, https): 65 64 RRR = RRR.rstrip() … … 84 83 return {'error': 'No JSON response'} 85 84 return parsed_json 86 87 85 88 86 def query_remita(payment, merchantId, api_key, RRR, host, https, verify): … … 111 109 payment.r_pay_reference = jr['RRR'] 112 110 payment.r_company = u'remita' 113 if payment.r_code != '00':111 if payment.r_code not in ('00', '01'): 114 112 msg = _('Unsuccessful callback: ${a}', mapping = {'a': payment.r_desc}) 115 113 log = 'unsuccessful callback for %s payment %s: %s' % ( … … 141 139 return True, msg, log 142 140 143 144 141 def write_payments_log(id, payment): 145 142 payment.logger.info( -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/tests.py
r14740 r14743 46 46 return func 47 47 48 49 48 class HelperTests(unittest.TestCase): 50 49 … … 84 83 u'statuscode': u'055'} 85 84 86 87 85 @external_test 88 86 def test_payment_status_via_rrr(self): … … 106 104 u'RRR': u'320007640976'} 107 105 108 109 106 class RemitaTestsStudents(StudentsFullSetup): 110 107 """Tests for the Remita payment gateway. … … 123 120 def setUp(self): 124 121 super(RemitaTestsStudents, self).setUp() 122 self.app['configuration']['2004'].remita_enabled = True 125 123 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 126 124 self.browser.open(self.payments_path) … … 141 139 self.payment = self.student['payments'][self.value] 142 140 143 144 141 @external_test 145 142 def test_query_remita(self): … … 159 156 u'unsuccessful callback for schoolfee payment %s: Transaction Pending' 160 157 % self.payment.p_id) 158 159 @external_test 160 def test_remita_form(self): 161 # Manager can access InterswitchForm 162 self.browser.getLink("Pay via Remita").click() 163 # The RRR has been retrieved 164 self.assertTrue('<input name="rrr" type="hidden" value="280007640804">' 165 in self.browser.contents) 166 self.assertEqual(self.payment.r_pay_reference, '280007640804') 167 # Means of testing end here. 168 return
Note: See TracChangeset for help on using the changeset viewer.