Changeset 9616 for main/waeup.kwarapoly


Ignore:
Timestamp:
11 Nov 2012, 16:53:20 (12 years ago)
Author:
Henrik Bettermann
Message:

Prepare InterswitchPageStudent? for maintenance fee payment.

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

Legend:

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

    r9615 r9616  
    194194    site_name = SITE_NAME
    195195    currency = CURRENCY
    196     pay_item_id = '101'
    197196    product_id = PRODUCT_ID
    198197    mac = 'E6BA6CBBA9AF2871EE25C32C8D57C98895B9B001DC5B9CB2C463E2A9BDA44A3F1260C8A364F33789CDF74CB3EE7E6EF5D94F48D3AF7B727E75D97F07618DFA6D'
     
    229228        xmldict['provider_item_name'] = PROVIDER_ITEM_NAME
    230229        xmldict['provider_amt'] = 100 * 1200
    231         # Dalash data
    232         xmldict['dalash_amt'] = 100 * 1800
    233230        # Institution data
    234         if xmldict['faculty'] in ('CPGS',):
    235             xmldict['institution_acct'] = "1771180233"
    236             xmldict['institution_bank_id'] = '120'
    237         elif xmldict['faculty'] in ('IBAS',):
    238             xmldict['institution_acct'] = "0006772436"
    239             xmldict['institution_bank_id'] = '121'
    240         elif xmldict['faculty'] in ('IETS',):
    241             xmldict['institution_acct'] = "0106259811"
    242             xmldict['institution_bank_id'] = '10'
    243         elif xmldict['faculty'] in ('IFMS',):
    244             xmldict['institution_acct'] = "2013910271"
    245             xmldict['institution_bank_id'] = '8'
    246         elif xmldict['faculty'] in ('ITCH',):
    247             #acct. number changed from Zenith to FBN by gbenga Nov. 11, 2012
    248             xmldict['institution_acct'] = "2013910271"
    249             xmldict['institution_bank_id'] = '8'
    250         else:
    251             xmldict['institution_acct'] = "0000000000000"
    252             xmldict['institution_bank_id'] = '0'
    253         xmldict['institution_amt'] = 100 * (
    254             self.context.amount_auth - 1200 - 300 - 1800)
    255         xmldict['institution_item_name'] = self.context.p_category
     231        xmldict['institution_acct'] = "0000000000000"
     232        xmldict['institution_bank_id'] = '0'
     233        xmldict['institution_item_name'] = self.category
    256234        xmldict['institution_name'] = INSTITUTION_NAME
     235        xmldict['institution_amt'] = 100 * self.context.amount_auth
     236        xmldict['dalash_amt'] = 0
     237        self.pay_item_id = '000'
     238        if self.context.p_category == 'schoolfee':
     239            self.pay_item_id = '101'
     240            # Dalash data
     241            xmldict['dalash_amt'] = 100 * 1800
     242            if xmldict['faculty'] in ('CPGS',):
     243                xmldict['institution_acct'] = "1771180233"
     244                xmldict['institution_bank_id'] = '120'
     245            elif xmldict['faculty'] in ('IBAS',):
     246                xmldict['institution_acct'] = "0006772436"
     247                xmldict['institution_bank_id'] = '121'
     248            elif xmldict['faculty'] in ('IETS',):
     249                xmldict['institution_acct'] = "0106259811"
     250                xmldict['institution_bank_id'] = '10'
     251            elif xmldict['faculty'] in ('IFMS',):
     252                xmldict['institution_acct'] = "2013910271"
     253                xmldict['institution_bank_id'] = '8'
     254            elif xmldict['faculty'] in ('ITCH',):
     255                #acct. number changed from Zenith to FBN by gbenga Nov. 11, 2012
     256                xmldict['institution_acct'] = "2013910271"
     257                xmldict['institution_bank_id'] = '8'
     258            xmldict['institution_amt'] = 100 * (
     259                self.context.amount_auth - 1200 - 300 - 1800)
    257260
    258261        hashargs = (
  • main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/tests.py

    r9528 r9616  
    112112            self.browser.contents)
    113113        self.assertMatches(
    114             '...item_name="schoolfee" item_amt="3380000" bank_id="120" acct_num="1771180233"...',
     114            '...item_name="School Fee" item_amt="3380000" bank_id="120" acct_num="1771180233"...',
    115115            self.browser.contents)
    116116        self.assertMatches(
     
    120120            '...item_name="BT Education" item_amt="120000" bank_id="117" acct_num="1010764827"...',
    121121            self.browser.contents)
     122
     123        # Let's do the same for maintenance fee payment
     124
     125        self.browser.open(self.payments_path)
     126        self.browser.open(self.payments_path + '/addop')
     127        self.browser.getControl(
     128            name="form.p_category").value = ['hostel_maintenance']
     129        self.browser.getControl("Create ticket").click()
     130        self.assertMatches('...You have not yet booked accommodation...',
     131                           self.browser.contents)
     132        # Students have to book bed first
     133        self.browser.open(self.acco_path)
     134        IWorkflowState(self.student).setState('admitted')
     135        self.browser.getLink("Book accommodation").click()
     136        self.assertFalse('Activation Code:' in self.browser.contents)
     137        self.browser.getControl("Create bed ticket").click()
     138        # Bed is randomly selected but, since there is only
     139        # one bed for this student, we know that ...
     140        self.assertMatches('...Hall 1, Block A, Room 101, Bed A...',
     141                           self.browser.contents)
     142        self.assertMatches('...ticket created...',
     143                           self.browser.contents)
     144        self.browser.open(self.payments_path + '/addop')
     145        self.browser.getControl(
     146            name="form.p_category").value = ['hostel_maintenance']
     147        self.browser.getControl("Create ticket").click()
     148        self.assertMatches('...ticket created...',
     149                           self.browser.contents)
     150        ctrl = self.browser.getControl(name='val_id')
     151        value = ctrl.options[1]
     152        self.browser.getLink(value).click()
     153        self.assertMatches('...Amount Authorized...',
     154                           self.browser.contents)
     155
     156        # So far maintenance fee is not yet properly configured!!!
     157
     158        # Maint fee is taken from the session configuration object
     159        self.assertMatches(
     160            '...<span>987.0</span>...',
     161            self.browser.contents)
     162        self.payment_url = self.browser.url
     163        # Manager can access InterswitchForm
     164        self.browser.getLink("CollegePAY", index=0).click()
     165        # The total amount to be processed by Interswitch
     166        # has been reduced by the Interswitch fee of 150 Nairas
     167        self.assertMatches('...Total Amount Authorized:...',
     168                           self.browser.contents)
     169        self.assertMatches(
     170            '...<input type="hidden" name="amount" value="98700.0" />...',
     171            self.browser.contents)
     172        self.assertMatches(
     173            '...item_name="Hostel Maintenance Fee" item_amt="98700" bank_id="0" acct_num="0000000000000"...',
     174            self.browser.contents)
     175        # BT does nor charge a fee for maintenance fee
     176        #self.assertFalse("BT Education" in self.browser.contents)
    122177
    123178#    @external_test
Note: See TracChangeset for help on using the changeset viewer.