Changeset 16698


Ignore:
Timestamp:
4 Nov 2021, 12:40:15 (3 years ago)
Author:
Henrik Bettermann
Message:

Configure PAYDirect.

Location:
main/kofacustom.edocons/trunk/src/kofacustom/edocons
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.edocons/trunk/src/kofacustom/edocons/interfaces.py

    r16639 r16698  
    6868
    6969    interswitch_enabled = schema.Bool(
    70         title = _(u'Interswitch integration enabled'),
    71         default = False,
     70        title = _(u'Interswitch Collegepay integration enabled'),
     71        default = True,
     72        )
     73
     74    interswitch_paydirect_enabled = schema.Bool(
     75        title = _(u'Interswitch Paydirect integration enabled'),
     76        default = True,
    7277        )
    7378
  • main/kofacustom.edocons/trunk/src/kofacustom/edocons/interswitch/browser.py

    r16656 r16698  
    9393        xmldict['institution_bank_id'] = '00'
    9494        provider_amt = 0.0
    95         self.pay_item_id = '0000' # must be provided by Interswitch
     95        self.pay_item_id = 'Default_Payable_MX26002' # must be provided by Interswitch
    9696        xmldict['provider_amt'] = 100 * provider_amt
    9797        xmldict['institution_item_name'] = self.context.category
     
    242242    gateway_url = URL
    243243    mac = MAC
     244
     245# PAYDirect
     246
     247from kofacustom.nigeria.interswitch.paydirectbrowser import (
     248    PAYDirectPageStudent, PAYDirectPageApplicant,
     249    StudentRefNumberSlip, ApplicantRefNumberSlip,
     250    )
     251
     252from kofacustom.nigeria.interswitch.tests import (
     253    PAYDIRECT_URL, PAYDIRECT_HOST, MERCHANT_ID)
     254
     255#PAYDIRECT_HOST = 'orion.interswitchng.com'
     256#PAYDIRECT_URL = '/bookonhold/bookonhold.asmx'
     257#MERCHANT_ID = '0000'
     258
     259class CustomPAYDirectPageStudent(PAYDirectPageStudent):
     260    """Inform student how to proceed
     261    """
     262    grok.context(ICustomStudentOnlinePayment)
     263    gateway_amt = GATEWAY_AMT
     264    merchant_id = MERCHANT_ID
     265    gateway_url = PAYDIRECT_URL
     266    gateway_host = PAYDIRECT_HOST
     267    https = True
     268
     269class CustomPAYDirectPageApplicant(PAYDirectPageApplicant):
     270    """ Inform applicant how to proceed.
     271    """
     272    grok.context(ICustomApplicantOnlinePayment)
     273    gateway_amt = GATEWAY_AMT
     274    merchant_id = MERCHANT_ID
     275    gateway_url = PAYDIRECT_URL
     276    gateway_host = PAYDIRECT_HOST
     277    https = True
     278
     279class CustomStudentRefNumberSlip(StudentRefNumberSlip):
     280    """Deliver a PDF slip of the context.
     281    """
     282    merchant_id = MERCHANT_ID
     283
     284class CustomApplicantRefNumberSlip(ApplicantRefNumberSlip):
     285    """Deliver a PDF slip of the context.
     286    """
     287    merchant_id = MERCHANT_ID
  • main/kofacustom.edocons/trunk/src/kofacustom/edocons/interswitch/tests.py

    r16655 r16698  
    7272            '<span>40000.0</span>' in self.browser.contents)
    7373        self.payment_url = self.browser.url
    74         self.browser.getLink("Pay via Interswitch", index=0).click()
    75         self.assertTrue('<input type="hidden" name="pay_item_id" value="0000" />' in
     74        self.browser.getLink("Pay via Interswitch CollegePAY", index=0).click()
     75        self.assertMatches('...<input type="hidden" name="pay_item_id" value="Default_Payable_MX26002" />...',
    7676                           self.browser.contents)
    7777        self.assertEqual(self.student.current_mode, 'ug_ft')
     
    9393        self.student['payments']['xyz'] = acc_payment
    9494        self.browser.open(self.payments_path + '/xyz')
    95         self.browser.getLink("Pay via Interswitch", index=0).click()
    96         self.assertMatches('...<input type="hidden" name="pay_item_id" value="0000" />...',
     95        self.browser.getLink("Pay via Interswitch CollegePAY", index=0).click()
     96        self.assertMatches('...<input type="hidden" name="pay_item_id" value="Default_Payable_MX26002" />...',
    9797                           self.browser.contents)
    9898        self.assertMatches('...Total Amount Authorized:...',
Note: See TracChangeset for help on using the changeset viewer.