Ignore:
Timestamp:
11 Nov 2015, 13:40:53 (9 years ago)
Author:
Henrik Bettermann
Message:

Determine gateway amount for amounts <= 2000 Naira.

Fix note on payment slip.

Location:
main/waeup.aaue/trunk/src/waeup/aaue
Files:
4 edited

Legend:

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

    r13414 r13437  
    5050
    5151def gateway_net_amt(fee):
    52     if fee > GATEWAY_AMT:
     52    if fee > 2000:
    5353        return fee - GATEWAY_AMT
    54     return 0.0
     54    return round(fee * 0.985, 2)
    5555
    5656def contr_agreement(student):
     
    380380        self.xml_data = """<input type="hidden" name="xml_data" value='%s'  />""" % xmltext
    381381        self.context.provider_amt = provider_amt
    382         self.context.gateway_amt = GATEWAY_AMT
     382        self.context.gateway_amt = self.amount_auth - gateway_net_amt(
     383            self.amount_auth)
    383384        hashargs = (
    384385            self.context.p_id +
  • main/waeup.aaue/trunk/src/waeup/aaue/interswitch/tests.py

    r13421 r13437  
    121121        self.browser.getLink(self.value).click()
    122122        self.assertTrue('Amount Authorized' in self.browser.contents)
    123         # 50250 + 1000 + 500 - 500
    124         self.assertTrue('<span>51250.0</span>' in self.browser.contents)
     123        # 50250 + 0.985 * (1000 + 500)
     124        self.assertTrue('<span>51727.5</span>' in self.browser.contents)
    125125        self.payment_url = self.browser.url
    126126        self.browser.getLink("CollegePAY", index=0).click()
     
    137137        self.assertEqual(self.student.current_mode, 'ug_pt')
    138138        self.assertTrue(
    139             '<input type="hidden" name="amount" value="5125000" />'
     139            '<input type="hidden" name="amount" value="5172750" />'
    140140            in self.browser.contents)
    141141        self.assertTrue(
     
    204204        self.browser.getLink(self.value).click()
    205205        self.assertTrue('Amount Authorized' in self.browser.contents)
    206         # 40250 + 2000 + 800 -500
    207         self.assertTrue('<span>42550.0</span>' in self.browser.contents)
     206        # 40250 + 0.985 * (2000 + 800)
     207        self.assertTrue('<span>43008.0</span>' in self.browser.contents)
    208208        self.payment_url = self.browser.url
    209209        self.browser.getLink("CollegePAY", index=0).click()
     
    212212        self.assertTrue('Total Amount Authorized:' in self.browser.contents)
    213213        self.assertTrue(
    214             '<input type="hidden" name="amount" value="4255000" />'
     214            '<input type="hidden" name="amount" value="4300800" />'
    215215            in self.browser.contents)
    216216        self.assertTrue(
     
    276276            in self.browser.contents)
    277277        self.assertTrue(
    278             'item_name="Concessional Fee" item_amt="131700" '
     278            'item_name="Concessional Fee" item_amt="154349" '
    279279            'bank_id="117" acct_num="1010835352"'
    280280            in self.browser.contents)
  • main/waeup.aaue/trunk/src/waeup/aaue/students/browser.py

    r13425 r13437  
    146146            welfare_fee = gateway_net_amt(academic_session.welfare_fee)
    147147            union_fee = gateway_net_amt(academic_session.union_fee)
    148             text += ('School Fee'
    149                      ', %s Naira Students\' Union Dues'
    150                      ', %s Naira Student Welfare Assurance Fee'
     148            text += ('School Fee, '
     149                     '%s Naira Students\' Union Dues, '
     150                     '%s Naira Student Welfare Assurance Fee and '
    151151                     % (union_fee, welfare_fee))
    152152        elif self.context.p_category in (
     
    154154            matric_gown_fee = gateway_net_amt(academic_session.matric_gown_fee)
    155155            lapel_fee = gateway_net_amt(academic_session.lapel_fee)
    156             text += ('Acceptance Fee'
    157                      ', %s Naira Matriculation Gown Fee'
    158                      ', %s Naira Lapel/File Fee'
     156            text += ('Acceptance Fee, '
     157                     '%s Naira Matriculation Gown Fee, '
     158                     '%s Naira Lapel/File Fee and '
    159159                     % (matric_gown_fee, lapel_fee))
    160         return text + ' and 250.0 Naira Transaction Charge.'
     160        return text + '250.0 Naira Transaction Charge.'
    161161
    162162class CustomStudyLevelDisplayFormPage(StudyLevelDisplayFormPage):
  • main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py

    r13421 r13437  
    300300        self.student['studycourse'].entry_session = 2013
    301301        self.student['studycourse'].certificate.school_fee_1 = 50250.0
    302         self.app['configuration']['2004'].union_fee = 1000.0
    303         self.app['configuration']['2004'].welfare_fee = 500.0
     302        self.app['configuration']['2004'].union_fee = 1015.23
     303        self.app['configuration']['2004'].welfare_fee = 507.61
    304304        self.student.nationality = u'NG'
    305305        # Login
     
    319319        self.browser.getLink(value).click()
    320320        self.assertTrue('Amount Authorized' in self.browser.contents)
    321         self.assertEqual(self.student['payments'][value].amount_auth, 51250.0)
     321        self.assertEqual(self.student['payments'][value].amount_auth, 51750.0)
    322322        self.browser.open(self.browser.url + '/payment_slip.pdf')
    323323        self.assertEqual(self.browser.headers['Status'], '200 Ok')
Note: See TracChangeset for help on using the changeset viewer.