Ignore:
Timestamp:
22 Oct 2012, 11:56:06 (12 years ago)
Author:
Henrik Bettermann
Message:

Configure clearance fee bank details.

Location:
main/waeup.uniben/trunk/src/waeup/uniben/interswitch
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.uniben/trunk/src/waeup/uniben/interswitch/browser.py

    r9081 r9384  
    229229        xmldict['provider_bank_id'] = PROVIDER_BANK_ID
    230230        xmldict['provider_item_name'] = PROVIDER_ITEM_NAME
    231         if student.current_mode.endswith('_ft') \
    232             and student.state == RETURNING:
    233             provider_amt = 600
    234         else:
    235             provider_amt = 1500
    236         xmldict['provider_amt'] = 100 * provider_amt
    237231        # Institution data
    238         studycourse = student['studycourse']
    239232        xmldict['institution_acct'] = ''
    240233        xmldict['institution_bank_id'] = ''
    241         if student.current_mode.endswith('_ft'):
    242             #post-grad full-time students of all faculties
    243             if student.is_postgrad:
    244                 xmldict['institution_acct'] = '1012842833'
    245                 xmldict['institution_bank_id'] = '117'
    246             #all other part-time students depending on faculty
    247             elif student.faccode in ('SSC','LAW','MED'):
    248                 xmldict['institution_acct'] = '0005986938'
    249                 xmldict['institution_bank_id'] = '31'
    250             elif student.faccode in ('ENG','PSC','PHA'):
    251                 xmldict['institution_acct'] = '0014413973'
    252                 xmldict['institution_bank_id'] = '129'
    253             elif student.faccode in ('LSC','DEN','AGR'):
    254                 xmldict['institution_acct'] = '1012801319'
    255                 xmldict['institution_bank_id'] = '117'
    256             elif student.faccode in ('ART','EDU','MGS','BMS'):
    257                 xmldict['institution_acct'] = '6220027556'
    258                 xmldict['institution_bank_id'] = '51'
    259         elif student.current_mode.endswith('_pt'):
    260             #post-grad part-time students of all faculties
    261             if student.is_postgrad:
    262                 xmldict['institution_acct'] = '0023708207'
    263                 xmldict['institution_bank_id'] = '72'
    264             #all other part-time students depending on faculty
    265             elif student.faccode in ('ENG','LAW','MGS'):
    266                 xmldict['institution_acct'] = '2019006824'
    267                 xmldict['institution_bank_id'] = '8'
    268             elif student.faccode in ('IPA','PHA','SSC','AGR','EDU'):
    269                 xmldict['institution_acct'] = '0122012109'
    270                 xmldict['institution_bank_id'] = '16'
    271         xmldict['institution_amt'] = 100 * (self.context.amount_auth - provider_amt - 150)
    272         xmldict['institution_item_name'] = self.context.p_category
     234        xmldict['institution_amt'] = '0.0'
     235        if self.context.p_category == 'schoolfee':
     236            if student.current_mode.endswith('_ft') \
     237                and student.state == RETURNING:
     238                provider_amt = 600
     239            else:
     240                provider_amt = 1500
     241            #studycourse = student['studycourse']
     242            if student.current_mode.endswith('_ft'):
     243                #post-grad full-time students of all faculties
     244                if student.is_postgrad:
     245                    xmldict['institution_acct'] = '1012842833'
     246                    xmldict['institution_bank_id'] = '117'
     247                #all other part-time students depending on faculty
     248                elif student.faccode in ('SSC','LAW','MED'):
     249                    xmldict['institution_acct'] = '0005986938'
     250                    xmldict['institution_bank_id'] = '31'
     251                elif student.faccode in ('ENG','PSC','PHA'):
     252                    xmldict['institution_acct'] = '0014413973'
     253                    xmldict['institution_bank_id'] = '129'
     254                elif student.faccode in ('LSC','DEN','AGR'):
     255                    xmldict['institution_acct'] = '1012801319'
     256                    xmldict['institution_bank_id'] = '117'
     257                elif student.faccode in ('ART','EDU','MGS','BMS'):
     258                    xmldict['institution_acct'] = '6220027556'
     259                    xmldict['institution_bank_id'] = '51'
     260            elif student.current_mode.endswith('_pt'):
     261                #post-grad part-time students of all faculties
     262                if student.is_postgrad:
     263                    xmldict['institution_acct'] = '0023708207'
     264                    xmldict['institution_bank_id'] = '72'
     265                #all other part-time students depending on faculty
     266                elif student.faccode in ('ENG','LAW','MGS'):
     267                    xmldict['institution_acct'] = '2019006824'
     268                    xmldict['institution_bank_id'] = '8'
     269                elif student.faccode in ('IPA','PHA','SSC','AGR','EDU'):
     270                    xmldict['institution_acct'] = '0122012109'
     271                    xmldict['institution_bank_id'] = '16'
     272        elif self.context.p_category == 'clearance':
     273            provider_amt = 1500
     274            xmldict['institution_bank_id'] = '7'
     275            xmldict['institution_acct'] = '1003475516'
     276
     277        xmldict['provider_amt'] = 100 * provider_amt
     278        xmldict['institution_item_name'] = self.category
    273279        xmldict['institution_name'] = INSTITUTION_NAME
     280        xmldict['institution_amt'] = 100 * (
     281            self.context.amount_auth - provider_amt - 150)
    274282        # Interswitch amount is not part of the xml data
    275283        xmltext = """<payment_item_detail>
  • main/waeup.uniben/trunk/src/waeup/uniben/interswitch/tests.py

    r9006 r9384  
    5151        self.student.nationality = u'NG'
    5252        self.browser.open(self.payments_path + '/addop')
     53        self.browser.getControl(name="form.p_category").value = ['schoolfee']
    5354        self.browser.getControl("Create ticket").click()
    5455        self.assertMatches('...ticket created...',
     
    5758        value = ctrl.options[0]
    5859        self.browser.getLink(value).click()
    59         self.assertMatches('...Amount Authorized...',
    60                            self.browser.contents)
    61         self.assertMatches(
    62             '...<span>40000.0</span>...',
    63             self.browser.contents)
    64         self.payment_url = self.browser.url
    6560
    6661
     
    7873    def test_interswitch_form(self):
    7974
     75        # School fee ticket already created in setUp method
     76        self.assertMatches('...Amount Authorized...',
     77                           self.browser.contents)
     78        self.assertMatches(
     79            '...<span>40000.0</span>...',
     80            self.browser.contents)
     81        self.payment_url = self.browser.url
    8082        # Manager can access InterswitchForm
    8183        self.browser.getLink("CollegePAY", index=0).click()
     
    8486        # The total amount to be processed by Interswitch
    8587        # has been reduced by the Interswitch fee of 150 Nairas
     88        self.assertMatches('...Total Amount Authorized:...',
     89                           self.browser.contents)
    8690        self.assertMatches(
    8791            '...<input type="hidden" name="amount" value="4000000.0" />...',
    8892            self.browser.contents)
     93        self.assertMatches(
     94            '...item_name="School Fee" item_amt="3835000" bank_id="" acct_num=""...',
     95            self.browser.contents)
     96        self.assertMatches(
     97            '...item_name="BT Education" item_amt="150000" bank_id="117" acct_num="1010764827"...',
     98            self.browser.contents)
     99
     100        # Create clearance fee ticket
     101        self.browser.open(self.payments_path + '/addop')
     102        self.browser.getControl(name="form.p_category").value = ['clearance']
     103        self.browser.getControl("Create ticket").click()
     104        self.assertMatches('...ticket created...',
     105                           self.browser.contents)
     106        ctrl = self.browser.getControl(name='val_id')
     107        value = ctrl.options[1]
     108        self.browser.getLink(value).click()
     109        self.assertMatches('...Amount Authorized...',
     110                           self.browser.contents)
     111        self.assertMatches(
     112            '...<span>45000.0</span>...',
     113            self.browser.contents)
     114        # Manager can access InterswitchForm
     115        self.browser.getLink("CollegePAY", index=0).click()
     116        self.assertMatches('...Total Amount Authorized:...',
     117                           self.browser.contents)
     118        # The total amount to be processed by Interswitch
     119        # has been reduced by the Interswitch fee of 150 Nairas
     120        self.assertMatches('...Total Amount Authorized:...',
     121                           self.browser.contents)
     122        self.assertMatches(
     123            '...<input type="hidden" name="amount" value="4500000.0" />...',
     124            self.browser.contents)
     125        self.assertMatches(
     126            '...item_name="Acceptance Fee" item_amt="4335000" bank_id="7" acct_num="1003475516"...',
     127            self.browser.contents)
     128        self.assertMatches(
     129            '...item_name="BT Education" item_amt="150000" bank_id="117" acct_num="1010764827"...',
     130            self.browser.contents)
     131
    89132
    90133#    @external_test
Note: See TracChangeset for help on using the changeset viewer.