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
Files:
5 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
  • main/kofacustom.dspg/trunk/src/kofacustom/dspg/locales/en/LC_MESSAGES/waeup.kofa.po

    r14865 r14875  
    1717msgid "Special Application"
    1818msgstr "Remedial Payment"
     19
     20msgid "Initial School Fee"
     21msgstr "Initial School Fee (Deltan)"
     22
     23msgid "Returning School Fee"
     24msgstr "Returning School Fee (Deltan)"
     25
     26msgid "Foreigner Initial School Fee"
     27msgstr "Initial School Fee (Non-Deltan)"
     28
     29msgid "Foreigner Returning School Fee"
     30msgstr "Returning School Fee (Non-Deltan)"
  • main/kofacustom.dspg/trunk/src/kofacustom/dspg/students/utils.py

    r14861 r14875  
    2323from kofacustom.dspg.interfaces import MessageFactory as _
    2424
     25
     26def local(student):
     27    lga = getattr(student, 'lga')
     28    if lga and lga.startswith('delta'):
     29        return True
     30    return False
     31
    2532class CustomStudentsUtils(NigeriaStudentsUtils):
    2633    """A collection of customized methods.
    27 
    2834    """
    2935
     
    7177                # update method of the PreviousPaymentAddFormPage.
    7278                if previous_level == 100:
    73                     amount = getattr(certificate, 'school_fee_1', 0.0)
     79                    if local(student):
     80                        amount = getattr(certificate, 'school_fee_1', 0.0)
     81                    else:
     82                        amount = getattr(certificate, 'school_fee_3', 0.0)
    7483                else:
    75                     amount = getattr(certificate, 'school_fee_2', 0.0)
     84                    if local(student):
     85                        amount = getattr(certificate, 'school_fee_2', 0.0)
     86                    else:
     87                        amount = getattr(certificate, 'school_fee_4', 0.0)
    7688            else:
    7789                if student.state == CLEARED:
    78                     amount = getattr(certificate, 'school_fee_1', 0.0)
     90                    if local(student):
     91                        amount = getattr(certificate, 'school_fee_1', 0.0)
     92                    else:
     93                        amount = getattr(certificate, 'school_fee_3', 0.0)
    7994                elif student.state == RETURNING:
    8095                    # In case of returning school fee payment the
     
    88103                            u'Session configuration object is not available.'
    89104                            ), None
    90                     amount = getattr(certificate, 'school_fee_2', 0.0)
     105                    if local(student):
     106                        amount = getattr(certificate, 'school_fee_2', 0.0)
     107                    else:
     108                        amount = getattr(certificate, 'school_fee_4', 0.0)
    91109                elif student.is_postgrad and student.state == PAID:
    92110                    # Returning postgraduate students also pay for the
     
    99117                            u'Session configuration object is not available.'
    100118                            ), None
    101                     amount = getattr(certificate, 'school_fee_2', 0.0)
     119                    if local(student):
     120                        amount = getattr(certificate, 'school_fee_2', 0.0)
     121                    else:
     122                        amount = getattr(certificate, 'school_fee_4', 0.0)
    102123        elif category == 'clearance':
    103124            try:
     
    106127                return _('Study course data are incomplete.'), None
    107128            amount = academic_session.clearance_fee
     129            if student.current_mode == 'nd_ft' and local(student):
     130                amount /= 2
     131            if student.current_mode == 'hnd_ft':
     132                amount = 0.0
    108133        elif category == 'bed_allocation':
    109134            p_item = self.getAccommodationDetails(student)['bt']
Note: See TracChangeset for help on using the changeset viewer.