Ignore:
Timestamp:
25 Oct 2019, 09:59:20 (5 years ago)
Author:
Henrik Bettermann
Message:

Add first Payoutlet components. Not yet tested.
Rename eTranzact.

Location:
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/applicantsbrowser.py

    r15600 r15702  
    4040    try:
    4141        return getattr(grok.getSite()['configuration'][str(session)],
    42             'etranzact_enabled', False)
     42            'etranzact_webconnect_enabled', False)
    4343    except KeyError:
    4444        return False
     
    5050    grok.require('waeup.payApplicant')
    5151    icon = 'actionicon_pay.png'
    52     text = _('Pay via eTranzact')
     52    text = _('Pay via Etranzact')
    5353    target = 'goto_etranzact'
    5454
     
    6767    grok.require('waeup.payApplicant')
    6868    icon = 'actionicon_call.png'
    69     text = _('Requery eTranzact History')
     69    text = _('Requery Etranzact History')
    7070    target = 'requery_history'
    7171
     
    7979
    8080class EtranzactPageApplicant(KofaPage):
    81     """ View which sends a POST request to the eTranzact payment gateway.
     81    """ View which sends a POST request to the Etranzact payment gateway.
    8282    """
    8383    grok.context(INigeriaApplicantOnlinePayment)
     
    8585    grok.template('goto_etranzact')
    8686    grok.require('waeup.payApplicant')
    87     label = _('Pay via eTranzact')
     87    label = _('Pay via Etranzact')
    8888    submit_button = _('Pay now')
    8989
     
    102102    def init_update(self):
    103103        if self.context.p_state == 'paid':
    104             return _("Payment ticket can't be re-sent to eTranzact.")
     104            return _("Payment ticket can't be re-sent to Etranzact.")
    105105        now = datetime.utcnow()
    106106        if self.context.creation_date.tzinfo is not None:
     
    112112        # In contrast to the procedure in the Remita and Interswitch modules,
    113113        # we do not call requery_history but receive and evaluate
    114         # the response form from eTranzact directly. This is possible
    115         # because eTranzact provides the FINAL_CHECKSUM hash value
     114        # the response form from Etranzact directly. This is possible
     115        # because Etranzact provides the FINAL_CHECKSUM hash value
    116116        # which authenticates the response.
    117117        self.responseurl = self.url(self.context, 'receive_etranzact')
    118         # Already now it becomes a eTranzact payment
     118        # Already now it becomes a Etranzact payment
    119119        self.context.r_company = u'etranzact'
    120120        hashargs =      self.amount + self.terminal_id+self.transaction_id \
     
    166166
    167167class EtranzactRequestPaymentStatusPageApplicant(UtilityView, grok.View):
    168     """ Request webservice view for the eTranzact gateway.
     168    """ Request webservice view for the Etranzact gateway.
    169169    """
    170170    grok.context(INigeriaApplicantOnlinePayment)
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/helpers.py

    r15598 r15702  
    135135def process_response(payment, form, view, verify):
    136136    if not form or not form.get('SUCCESS', None):
    137         msg = _('No valid response from eTranzact.')
    138         log = 'No valid response from eTranzact for payment %s' % payment.p_id
     137        msg = _('No valid response from Etranzact.')
     138        log = 'No valid response from Etranzact for payment %s' % payment.p_id
    139139        payment.p_state = 'failed'
    140140        notify(grok.ObjectModifiedEvent(payment))
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/studentsbrowser.py

    r15600 r15702  
    4040    try:
    4141        return getattr(grok.getSite()['configuration'][str(session)],
    42             'etranzact_enabled', False)
     42            'etranzact_webconnect_enabled', False)
    4343    except KeyError:
    4444        return False
     
    5050    grok.require('waeup.payStudent')
    5151    icon = 'actionicon_pay.png'
    52     text = _('Pay via eTranzact')
     52    text = _('Pay via Etranzact')
    5353    target = 'goto_etranzact'
    5454
     
    6767    grok.require('waeup.payStudent')
    6868    icon = 'actionicon_call.png'
    69     text = _('Requery eTranzact History')
     69    text = _('Requery Etranzact History')
    7070    target = 'requery_history'
    7171
     
    7979
    8080class EtranzactPageStudent(KofaPage):
    81     """ View which sends a POST request to the eTranzact payment gateway.
     81    """ View which sends a POST request to the Etranzact payment gateway.
    8282    """
    8383    grok.context(INigeriaStudentOnlinePayment)
     
    8585    grok.template('goto_etranzact')
    8686    grok.require('waeup.payStudent')
    87     label = _('Pay via eTranzact')
     87    label = _('Pay via Etranzact')
    8888    submit_button = _('Pay now')
    8989
     
    102102    def init_update(self):
    103103        if self.context.p_state == 'paid':
    104             return _("Payment ticket can't be re-sent to eTranzact.")
     104            return _("Payment ticket can't be re-sent to Etranzact.")
    105105        now = datetime.utcnow()
    106106        if self.context.creation_date.tzinfo is not None:
     
    112112        # In contrast to the procedure in the Remita and Interswitch modules,
    113113        # we do not call requery_history but receive and evaluate
    114         # the response form from eTranzact directly. This is possible
    115         # because eTranzact provides the FINAL_CHECKSUM hash value
     114        # the response form from Etranzact directly. This is possible
     115        # because Etranzact provides the FINAL_CHECKSUM hash value
    116116        # which authenticates the response.
    117117        self.responseurl = self.url(self.context, 'receive_etranzact')
    118         # Already now it becomes a eTranzact payment
     118        # Already now it becomes a Etranzact payment
    119119        self.context.r_company = u'etranzact'
    120120        hashargs =      self.amount + self.terminal_id+self.transaction_id \
     
    166166
    167167class EtranzactRequestPaymentStatusPageStudent(UtilityView, grok.View):
    168     """ Request webservice view for the eTranzact gateway.
     168    """ Request webservice view for the Etranzact gateway.
    169169    """
    170170    grok.context(INigeriaStudentOnlinePayment)
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/tests.py

    r15600 r15702  
    4848SECRET_KEY = 'DEMO_KEY'
    4949LOGO_URL = 'https://iuokada.waeup.org/static_custom/iou_logo.png'
    50 
    51 # Valid transaction id in eTranzact system
     50PAYOUTLET_QUERY_URL = 'http://demo.etranzact.com/WebConnectPlus/query.jsp'
     51
     52# Valid transaction id in Etranzact system
    5253TID = 'p5689785145198'
    5354
     
    143144        # which seems to be valid till next restart of the demo portal.
    144145        raw, formvars = query_history(HOST, self.terminal_id, TID, HTTPS)
    145         # Now eTranzact is redirecting but the response is still useless
     146        # Now Etranzact is redirecting but the response is still useless
    146147        self.assertTrue('Redirecting...' in raw)
    147148        self.assertEqual(formvars['TRANSACTION_ID'], TID)
     
    158159        configuration = SessionConfiguration()
    159160        configuration.academic_session = datetime.now().year - 2
    160         configuration.etranzact_enabled = True
     161        configuration.etranzact_webconnect_enabled = True
     162        configuration.etranzact_payoutlet_enabled = True
    161163        self.app['configuration'].addSessionConfiguration(configuration)
    162164        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
     
    176178    @external_test
    177179    def test_applicant_views(self):
    178         # Manager can access eTranzact form
    179         self.browser.getLink("Pay via eTranzact").click()
     180        # Manager can access Etranzact form
     181        self.browser.getLink("Pay via Etranzact").click()
    180182        self.assertTrue("Pay now" in self.browser.contents)
    181183        # Means of testing end here.
     
    183185        self.payment.p_id = TID
    184186        self.browser.open(self.payment_url)
    185         self.browser.getLink("Requery eTranzact History").click()
     187        self.browser.getLink("Requery Etranzact History").click()
    186188        self.assertTrue('Wrong checksum.' in self.browser.contents)
    187189        # ... probably because responseurl of the transaction stored in the
     
    199201    def setUp(self):
    200202        super(EtranzactTestsStudents, self).setUp()
    201         self.app['configuration']['2004'].etranzact_enabled = True
     203        self.app['configuration']['2004'].etranzact_webconnect_enabled = True
     204        self.app['configuration']['2004'].etranzact_payoutlet_enabled = True
    202205        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
    203206        self.browser.open(self.payments_path)
     
    218221        self.payment = self.student['payments'][self.value]
    219222
    220 
    221223    @external_test
    222224    def test_student_views(self):
    223         # Manager can access eTranzact form
    224         self.browser.getLink("Pay via eTranzact").click()
     225        # Manager can access Etranzact form
     226        self.browser.getLink("Pay via Etranzact").click()
    225227        self.assertTrue("Pay now" in self.browser.contents)
    226228        # Means of testing end here.
     
    228230        self.payment.p_id = TID
    229231        self.browser.open(self.payment_url)
    230         self.browser.getLink("Requery eTranzact History").click()
     232        self.browser.getLink("Requery Etranzact History").click()
    231233        self.assertTrue('Wrong checksum.' in self.browser.contents)
    232234        # ... probably because responseurl and amount stored in the
     
    235237        # Means of testing end here again.
    236238        return
     239
     240    @external_test
     241    def test_student_payoutlet_views(self):
     242        self.browser.getLink("Enter Etranzact PIN").click()
     243        self.browser.getControl(name="confirmation_number").value = '1234'
     244        self.browser.getControl("Submit to Etranzact").click()
Note: See TracChangeset for help on using the changeset viewer.