Changeset 17927 for main


Ignore:
Timestamp:
13 Sep 2024, 10:45:39 (7 days ago)
Author:
Henrik Bettermann
Message:

Implement WebCheckout?.

Location:
main/kofacustom.edopoly/trunk/src/kofacustom/edopoly
Files:
4 edited

Legend:

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

    r17635 r17927  
    6565        default = 0.0,
    6666        required = False,
     67        )
     68
     69    interswitch_enabled = schema.Bool(
     70        title = _(u'Interswitch Collegepay integration enabled'),
     71        default = True,
     72        )
     73
     74    interswitch_webcheckout_enabled = schema.Bool(
     75        title = _(u'Interswitch WebCheckout integration enabled'),
     76        default = False,
    6777        )
    6878
  • main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/interswitch/browser.py

    r16820 r17927  
    2525    InterswitchPaymentVerifyWebservicePageStudent,
    2626    InterswitchPageStudent, InterswitchPageApplicant,
     27    module_activated,
     28    )
     29from kofacustom.nigeria.interswitch.webcheckoutbrowser import (
     30    webcheckout_module_activated,
     31    WebCheckoutPageStudent,
     32    WebCheckoutPageApplicant,
     33    WebCheckoutConfirmTransactionStudent,
     34    WebCheckoutConfirmTransactionApplicant,
    2735    )
    2836from kofacustom.edopoly.students.interfaces import ICustomStudentOnlinePayment
     
    6977
    7078    def update(self):
     79        if not module_activated(
     80            self.context.student.current_session, self.context):
     81            self.flash(_('Forbidden'), type='danger')
     82            self.redirect(self.url(self.context, '@@index'))
     83            return
    7184        error = self.init_update()
    7285        if error:
     
    152165
    153166    def update(self):
     167        if not module_activated(
     168            self.context.__parent__.__parent__.year, self.context):
     169            self.flash(_('Forbidden'), type='danger')
     170            self.redirect(self.url(self.context, '@@index'))
     171            return
    154172        error = self.init_update()
    155173        if error:
     
    251269    gateway_url = URL
    252270    mac = MAC
     271
     272# WebCheckout customizations
     273
     274MERCHANT_CODE = 'MX176634'
     275PAY_ITEM_ID = '102'
     276
     277class CustomWebCheckoutPageStudent(WebCheckoutPageStudent):
     278    """ View which sends a POST request to the Interswitch
     279    WebCheckout payment gateway.
     280    """
     281    #action = 'https://newwebpay.interswitchng.com/collections/w/pay'
     282    action = 'https://newwebpay.qa.interswitchng.com/collections/w/pay'
     283    currency = '566'
     284    pay_item_id = PAY_ITEM_ID
     285    merchant_code = MERCHANT_CODE
     286    gateway_amt = 0.0
     287    product_id = PRODUCT_ID
     288
     289class CustomWebCheckoutPageApplicant(WebCheckoutPageApplicant):
     290    """ View which sends a POST request to the Interswitch
     291    WebCheckout payment gateway.
     292    """
     293
     294    action = 'https://newwebpay.interswitchng.com/collections/w/pay'
     295    currency = '566'
     296    pay_item_id = PAY_ITEM_ID
     297    merchant_code = MERCHANT_CODE
     298
     299class CustomWebCheckoutConfirmTransactionStudent(WebCheckoutConfirmTransactionStudent):
     300    """ Request webservice view for the WebCheckout gateway
     301    """
     302    merchant_code = MERCHANT_CODE
     303    gateway_host = 'webpay.interswitchng.com'
     304    gateway_url = '/collections/api/v1/gettransaction.json'
     305    https = True
     306
     307class CustomWebCheckoutConfirmTransactionApplicant(WebCheckoutConfirmTransactionApplicant):
     308    """ Request webservice view for the WebCheckout gateway
     309    """
     310    merchant_code = MERCHANT_CODE
     311    gateway_host = 'webpay.interswitchng.com'
     312    gateway_url = '/collections/api/v1/gettransaction.json'
     313    https = True
     314
     315
  • main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/interswitch/tests.py

    r17703 r17927  
    5050    def setUp(self):
    5151        super(InterswitchTestsStudents, self).setUp()
     52        self.app['configuration']['2004'].interswitch_enabled = True
    5253
    5354    def test_interswitch_form(self):
  • main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/students/tests/test_export.py

    r17292 r17927  
    5151            'emp2_position,emp2_reason,emp2_start,emp_end,emp_position,'
    5252            'emp_reason,emp_start,employer,employer2,'
     53            'final_clearance_date,finally_cleared_by,'
    5354            'financial_clearance_date,financially_cleared_by,'
    5455            'firstname,flash_notice,former_matric,'
     
    6768            'current_level,current_session\r\nmy adm code,,,,'
    6869            '"[(\'printing_craft_practice\', \'A1\')]",my clr code,1981-02-04#,,,'
    69             'anna@sample.com,,,,,,,,,,,,,Anna,,,,,,"[(\'printing_craft_practice\', \'A1\')]"'
     70            'anna@sample.com,,,,,,,,,,,,,,,Anna,,,,,,"[(\'printing_craft_practice\', \'A1\')]"'
    7071            ',,,,,,,,,,,,,,,,Tester,,,234,M.,NG,,,,,,,,,,'
    7172            '"Studentroad 21\nLagos 123456\n",,+234-123-12345#,,,123,,,,,'
Note: See TracChangeset for help on using the changeset viewer.