Ignore:
Timestamp:
9 Mar 2016, 10:05:00 (9 years ago)
Author:
Henrik Bettermann
Message:

Implement TSA settlement through First Bank.

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

    r13765 r13771  
    3737PROVIDER_ITEM_NAME = 'BT Education'
    3838INSTITUTION_NAME = 'Uniben'
     39INSTITUTION_ACCT = '2017506430'
     40INSTITUTION_BANK_ID = '8'
    3941CURRENCY = '566'
    4042GATEWAY_AMT = 150.0
     
    7476        xmldict['provider_item_name'] = PROVIDER_ITEM_NAME
    7577        # Institution data
    76         xmldict['institution_acct'] = '000000000000'
    77         xmldict['institution_bank_id'] = '00'
     78        xmldict['institution_acct'] = INSTITUTION_ACCT
     79        xmldict['institution_bank_id'] = INSTITUTION_BANK_ID
    7880        xmldict['institution_amt'] = '0.0'
    7981        provider_amt = 0.0
     
    8486            if student.current_mode.endswith('_ft'):
    8587                self.pay_item_id = '5700'
    86                 if student.current_mode in ('ug_ft','de_ft','ume_ft'):
    87                     xmldict['institution_acct'] = '2017506430'
    88                     xmldict['institution_bank_id'] = '8'
    89                 elif student.current_mode in ('dp_ft','dp_pt','ct_pt','ct_ft'):
    90                     xmldict['institution_acct'] = '0058653774'
    91                     xmldict['institution_bank_id'] = '72'
    92                 elif student.current_mode in ('pg_ft'):
    93                     xmldict['institution_acct'] = '6230033428'
    94                     xmldict['institution_bank_id'] = '51'
    9588            elif student.current_mode.endswith('_pt'):
    9689                self.pay_item_id = '5701'
    97                 if student.current_mode in ('ug_pt','de_pt'):
    98                     xmldict['institution_acct'] = '0122009929'
    99                     xmldict['institution_bank_id'] = '16'
    100                 elif student.current_mode in ('pg_pt', 'special_pg_pt'):
    101                     xmldict['institution_acct'] = '4150033274'
    102                     xmldict['institution_bank_id'] = '51'
    10390            elif student.faccode == 'JUPEB':
    10491                self.pay_item_id = '5718'
    105                 xmldict['institution_acct'] = '0231462068'
    106                 xmldict['institution_bank_id'] = '16'
    10792        elif self.context.p_category == 'clearance':
    10893            self.pay_item_id = '5702'
    10994            provider_amt = 1500.0
    110             if student.faccode == 'FCETA':
    111                 xmldict['institution_acct'] = '5210007943'
    112                 xmldict['institution_bank_id'] = '51'
    113             else:
    114                 xmldict['institution_bank_id'] = '10'
    115                 xmldict['institution_acct'] = '0031716047'
    11695        elif self.context.p_category == 'gown':
    11796            self.pay_item_id = '5704'
    118             xmldict['institution_bank_id'] = '16'
    119             xmldict['institution_acct'] = '0122011401'
    12097        elif self.context.p_category.startswith('bed_allocation'):
    12198            self.pay_item_id = '5716'
    122             students_utils = getUtility(IStudentsUtils)
    123             stage = students_utils.getAccommodationDetails(student)['bt']
    124             stage = stage.split('_')[2]
    125             if stage == 'fr':
    126                 union_dues = 500.0
    127             else:
    128                 union_dues = 300.0
    129             xmldict['institution_bank_id'] = '129'
    130             xmldict['institution_acct'] = '0014419432'
    131             xmldict['union_dues'] = 100 * union_dues
    13299        elif self.context.p_category.startswith('hostel_maintenance'):
    133100            self.pay_item_id = '5705'
    134             xmldict['institution_bank_id'] = '129'
    135             xmldict['institution_acct'] = '0014419432'
    136101
    137102        xmldict['provider_amt'] = 100 * provider_amt
     
    141106            self.context.amount_auth - provider_amt - GATEWAY_AMT)
    142107
    143         if self.context.p_category == 'bed_allocation':
    144             xmldict['institution_amt'] = 100 * (
    145                 self.context.amount_auth - GATEWAY_AMT - union_dues)
     108        if provider_amt == 0:
    146109            xmltext = """<payment_item_detail>
    147110<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
    148111<item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
    149 <item_detail item_id="2" item_name="UNION DUES" item_amt="%(union_dues)d" bank_id="31" acct_num="0005986952" />
    150 </item_details>
    151 </payment_item_detail>""" % xmldict
    152         elif provider_amt == 0:
    153             xmltext = """<payment_item_detail>
    154 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
    155 <item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
    156 </item_details>
    157 </payment_item_detail>""" % xmldict
    158         elif self.context.p_category == 'schoolfee' and \
    159             student.current_mode == 'ug_ft':
    160             xmldict['institution_amt'] = 100 * (
    161                 self.context.amount_auth - provider_amt - GATEWAY_AMT - 3000)
    162             xmltext = """<payment_item_detail>
    163 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
    164 <item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
    165 <item_detail item_id="2" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />
    166 <item_detail item_id="3" item_name="T-SHIP" item_amt="200000" bank_id="72" acct_num="0061647254" />
    167 <item_detail item_id="4" item_name="MTN-NET LIBRARY" item_amt="100000" bank_id="8" acct_num="20177722298" />
    168112</item_details>
    169113</payment_item_detail>""" % xmldict
     
    199143        xmldict = {}
    200144        provider_amt = 400.0
    201         if self.applicant.applicant_id[:3] in ('pga', 'pgd'): # CERHI
    202             xmldict['institution_acct'] = '1014312532'
    203             xmldict['institution_bank_id'] = '117'
    204         elif self.applicant.applicant_id.startswith('pg'):
    205             xmldict['institution_acct'] = '0031716030'
    206             xmldict['institution_bank_id'] = '10'
    207         elif self.applicant.applicant_id.startswith('dp'):
    208             xmldict['institution_acct'] = '9201805071'
    209             xmldict['institution_bank_id'] = '17'
    210         elif self.applicant.applicant_id.startswith('pt'):
    211             xmldict['institution_acct'] = '9201805071'
    212             xmldict['institution_bank_id'] = '17'
    213         elif self.applicant.applicant_id.startswith('pre'):
    214             xmldict['institution_acct'] = '0025186411'
    215             xmldict['institution_bank_id'] = '129'
    216         elif self.applicant.applicant_id.startswith('cbt'):
    217             xmldict['institution_acct'] = '5030058259'
    218             xmldict['institution_bank_id'] = '51'
     145        if self.applicant.applicant_id.startswith('cbt'):
    219146            provider_amt = 200.0
    220         elif self.applicant.applicant_id.startswith('afak'):
    221             xmldict['institution_acct'] = '1014446565'
    222             xmldict['institution_bank_id'] = '117'
    223         else:
    224             xmldict['institution_acct'] = '1014326805'
    225             xmldict['institution_bank_id'] = '117'
     147        xmldict['institution_acct'] = INSTITUTION_ACCT
     148        xmldict['institution_bank_id'] = INSTITUTION_BANK_ID
    226149        xmldict['detail_ref'] = self.context.p_id
    227150        xmldict['provider_amt'] = 100 * provider_amt
     
    229152        xmldict['provider_bank_id'] = PROVIDER_BANK_ID
    230153        xmldict['provider_item_name'] = PROVIDER_ITEM_NAME
    231         xmldict['institution_amt'] = 100 * (self.context.amount_auth - provider_amt - GATEWAY_AMT)
     154        xmldict['institution_amt'] = 100 * (
     155            self.context.amount_auth - provider_amt - GATEWAY_AMT)
    232156        xmldict['institution_item_name'] = self.context.p_category
    233157        xmldict['institution_name'] = INSTITUTION_NAME
  • main/waeup.uniben/trunk/src/waeup/uniben/interswitch/tests.py

    r13251 r13771  
    9595            in self.browser.contents)
    9696        self.assertTrue(
    97             'item_name="School Fee" item_amt="3535000" bank_id="8" acct_num="2017506430"'
     97            'item_name="School Fee" item_amt="3835000" bank_id="8" acct_num="2017506430"'
    9898            in self.browser.contents)
    9999        self.assertTrue(
    100100            'item_name="BT Education" item_amt="150000" bank_id="117" acct_num="1010764827"'
    101             in self.browser.contents)
    102         self.assertTrue(
    103             'item_name="T-SHIP" item_amt="200000" bank_id="72" acct_num="0061647254"'
    104             in self.browser.contents)
    105         self.assertTrue(
    106             'item_name="MTN-NET LIBRARY" item_amt="100000" bank_id="8" acct_num="20177722298"'
    107101            in self.browser.contents)
    108102
     
    144138            in self.browser.contents)
    145139        self.assertTrue(
    146             'item_name="School Fee" item_amt="1835000" bank_id="16" acct_num="0122009929"'
     140            'item_name="School Fee" item_amt="1835000" bank_id="8" acct_num="2017506430"'
    147141            in self.browser.contents)
    148142        self.assertTrue(
     
    202196            in self.browser.contents)
    203197        self.assertTrue(
    204             '<item_detail item_id="1" item_name="Gown Hire Fee" item_amt="8400" bank_id="16" acct_num="0122011401" />'
     198            '<item_detail item_id="1" item_name="Gown Hire Fee" item_amt="8400" bank_id="8" acct_num="2017506430" />'
    205199            in self.browser.contents)
    206200        self.assertFalse(
     
    298292            in self.browser.contents)
    299293        self.assertTrue(
    300             'item_name="School Fee" item_amt="5000" bank_id="16" acct_num="0122009929"'
     294            'item_name="School Fee" item_amt="5000" bank_id="8" acct_num="2017506430"'
    301295            in self.browser.contents)
    302296        self.assertFalse(
Note: See TracChangeset for help on using the changeset viewer.