Ignore:
Timestamp:
24 Oct 2017, 08:43:15 (7 years ago)
Author:
Henrik Bettermann
Message:

Configure school fee and acceptance fee payments.

Location:
main/kofacustom.dspg/trunk/src/kofacustom/dspg/interswitch
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.dspg/trunk/src/kofacustom/dspg/interswitch/browser.py

    r14869 r14875  
    9999
    100100
    101 # Not yet readily configured. MAC is missing. Bank account numbers are
     101# Not yet readily configured. Bank account numbers are
    102102# contradictory. pay_item_ids are not yet assigned.
    103103
     
    111111    currency = CURRENCY
    112112    product_id = PRODUCT_ID
    113     mac = ''  # must be provided by Interswitch
     113    mac = 'D43ED93B7A307B152C7111D04E1F384428057CD1E75428D3A4C5631C28ACB9C8C822A88CA76DEDC5F9A520CF4BFDB2824FF8B207AAFC667DF3CBB13685B66627'
     114    pay_item_id = '000'
    114115
    115116    def update(self):
     
    127128        xmldict['provider_item_name'] = PROVIDER_ITEM_NAME
    128129        # Institution data
    129         xmldict['institution_acct'] = '0010761873'
    130         xmldict['institution_bank_id'] = '11'
     130        xmldict['institution_acct'] = '00000000'
     131        xmldict['institution_bank_id'] = '00'
    131132        xmldict['institution_amt'] = '0.0'
    132         provider_amt = 500.0
    133 
     133        provider_amt = 0.0
    134134        if self.context.p_category.startswith('schoolfee'):
    135135            self.pay_item_id = '102'
     136            provider_amt = 2800.0
     137            if self.student.current_mode.endswith('pt') or \
     138                self.student.current_mode.endswith('we'):
     139                xmldict['institution_acct'] = '1012808851 '
     140                xmldict['institution_bank_id'] = '117'
     141            elif self.student.current_mode in ('nd_ft', 'hnd_ft'):
     142                xmldict['institution_acct'] = '0026235493'
     143                xmldict['institution_bank_id'] = '31'
    136144        elif self.context.p_category == 'clearance':
    137145            self.pay_item_id = '103'
    138         elif self.context.p_category == 'bed_allocation':
    139             self.pay_item_id = '104'
    140         elif self.context.p_category == 'hostel_maintenance':
    141             self.pay_item_id = '105'
    142         elif self.context.p_category == 'transfer':
    143             self.pay_item_id = '106'
    144         elif self.context.p_category == 'gown':
    145             self.pay_item_id = '107'
    146         elif self.context.p_category == 'transcript':
    147             self.pay_item_id = '108'
    148         elif self.context.p_category == 'late_registration':
    149             self.pay_item_id = '109'
     146            provider_amt = 500.0
     147            if self.student.current_mode.endswith('pt') or \
     148                self.student.current_mode.endswith('we'):
     149                xmldict['institution_acct'] = '1012808851 '
     150                xmldict['institution_bank_id'] = '117'
     151            elif self.student.current_mode == 'nd_ft':
     152                xmldict['institution_acct'] = '2004402644'
     153                xmldict['institution_bank_id'] = '8'
    150154        elif self.context.p_category in SPECIAL_PAYMENT_PARAMS.keys():
    151155            self.pay_item_id = SPECIAL_PAYMENT_PARAMS[self.context.p_category][0]
     
    262266    gateway_host = HOST
    263267    gateway_url = URL
     268    mac = 'D43ED93B7A307B152C7111D04E1F384428057CD1E75428D3A4C5631C28ACB9C8C822A88CA76DEDC5F9A520CF4BFDB2824FF8B207AAFC667DF3CBB13685B66627'
    264269
    265270class CustomInterswitchPaymentVerifyWebservicePageStudent(
     
    271276    gateway_host = HOST
    272277    gateway_url = URL
     278    mac = 'D43ED93B7A307B152C7111D04E1F384428057CD1E75428D3A4C5631C28ACB9C8C822A88CA76DEDC5F9A520CF4BFDB2824FF8B207AAFC667DF3CBB13685B66627'
    273279
    274280class CustomInterswitchPaymentRequestWebservicePageApplicant(
  • main/kofacustom.dspg/trunk/src/kofacustom/dspg/interswitch/tests.py

    r14862 r14875  
    5959        IWorkflowState(self.student).setState('cleared')
    6060        self.student.nationality = u'NG'
     61        # ND FT Non-Deltan Fresh Student School Fee
     62        self.certificate.study_mode = 'nd_ft'
     63        self.certificate.school_fee_3 = 30000.0
    6164        self.browser.open(self.payments_path + '/addop')
    6265        self.browser.getControl(name="form.p_category").value = ['schoolfee']
     
    7073                           self.browser.contents)
    7174        self.assertMatches(
    72             '...<span>40000.0</span>...',
    73             self.browser.contents)
    74         self.payment_url = self.browser.url
    75         self.browser.getLink("CollegePAY", index=0).click()
    76         self.assertMatches('...<input type="hidden" name="pay_item_id" value="102" />...',
    77                            self.browser.contents)
    78         self.assertMatches('...Total Amount Authorized:...',
    79                            self.browser.contents)
    80         self.assertEqual(self.student.current_mode, 'ug_ft')
    81         self.assertMatches(
    82             '...<input type="hidden" name="amount" value="4000000" />...',
    83             self.browser.contents)
    84         self.assertMatches(
    85             '...item_name="School Fee" item_amt="4000000" bank_id="11" acct_num="0010761873"...',
     75            '...<span>30000.0</span>...',
     76            self.browser.contents)
     77        self.payment_url = self.browser.url
     78        self.browser.getLink("CollegePAY", index=0).click()
     79        self.assertTrue('<input type="hidden" name="pay_item_id" value="102" />'
     80            in self.browser.contents)
     81        self.assertTrue(
     82            '<input type="hidden" name="amount" value="3000000" />' in
     83            self.browser.contents)
     84        self.assertTrue(
     85            'item_name="School Fee" item_amt="2695000" bank_id="31" acct_num="0026235493"' in
     86            self.browser.contents)
     87        # ND FT Non-Deltan Fresh Student Acceptance Fee
     88        self.app['configuration']['2004'].clearance_fee = 12345.0
     89        self.browser.open(self.payments_path + '/addop')
     90        self.browser.getControl(name="form.p_category").value = ['clearance']
     91        self.browser.getControl("Create ticket").click()
     92        self.assertMatches('...ticket created...',
     93                           self.browser.contents)
     94        ctrl = self.browser.getControl(name='val_id')
     95        self.value = ctrl.options[1]
     96        self.browser.getLink(self.value).click()
     97        self.assertMatches('...Amount Authorized...',
     98                           self.browser.contents)
     99        self.assertMatches(
     100            '...<span>12345.0</span>...',
     101            self.browser.contents)
     102        self.payment_url = self.browser.url
     103        self.browser.getLink("CollegePAY", index=0).click()
     104        self.assertTrue('<input type="hidden" name="pay_item_id" value="103" />' in
     105                           self.browser.contents)
     106        self.assertTrue(
     107            '<input type="hidden" name="amount" value="1234500" />' in
     108            self.browser.contents)
     109        self.assertTrue(
     110            'item_name="Acceptance" item_amt="1159500" bank_id="8" acct_num="2004402644"' in
    86111            self.browser.contents)
    87112
Note: See TracChangeset for help on using the changeset viewer.