Changeset 14743 for main


Ignore:
Timestamp:
2 Aug 2017, 08:28:31 (7 years ago)
Author:
Henrik Bettermann
Message:

Add first Remita views.

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  
    6161    return parsed_json
    6262
    63 
    6463def get_payment_status_via_rrr(merchantId, api_key, RRR, host, https):
    6564    RRR = RRR.rstrip()
     
    8483        return {'error': 'No JSON response'}
    8584    return parsed_json
    86 
    8785
    8886def query_remita(payment, merchantId, api_key, RRR, host, https, verify):
     
    111109    payment.r_pay_reference = jr['RRR']
    112110    payment.r_company = u'remita'
    113     if payment.r_code != '00':
     111    if payment.r_code not in ('00', '01'):
    114112        msg = _('Unsuccessful callback: ${a}', mapping = {'a': payment.r_desc})
    115113        log = 'unsuccessful callback for %s payment %s: %s' % (
     
    141139    return True, msg, log
    142140
    143 
    144141def write_payments_log(id, payment):
    145142    payment.logger.info(
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/tests.py

    r14740 r14743  
    4646    return func
    4747
    48 
    4948class HelperTests(unittest.TestCase):
    5049
     
    8483            u'statuscode': u'055'}
    8584
    86 
    8785    @external_test
    8886    def test_payment_status_via_rrr(self):
     
    106104            u'RRR': u'320007640976'}
    107105
    108 
    109106class RemitaTestsStudents(StudentsFullSetup):
    110107    """Tests for the Remita payment gateway.
     
    123120    def setUp(self):
    124121        super(RemitaTestsStudents, self).setUp()
     122        self.app['configuration']['2004'].remita_enabled = True
    125123        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
    126124        self.browser.open(self.payments_path)
     
    141139        self.payment = self.student['payments'][self.value]
    142140
    143 
    144141    @external_test
    145142    def test_query_remita(self):
     
    159156            u'unsuccessful callback for schoolfee payment %s: Transaction Pending'
    160157            % 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.