Ignore:
Timestamp:
6 Oct 2017, 09:19:26 (7 years ago)
Author:
Henrik Bettermann
Message:

Prepare student payments. Not yet readily configured. MAC is missing. Bank account numbers contradictory. pay_item_ids are not yet assigned.

Location:
main/kofacustom.dspg/trunk/src/kofacustom/dspg/interswitch
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.dspg/trunk/src/kofacustom/dspg/interswitch/browser.py

    r14859 r14862  
    8686    }
    8787
     88
     89# Not yet readily configured. MAC is missing. Bank account numbers are
     90# contradictory. pay_item_ids are not yet assigned.
     91
    8892class CustomInterswitchPageStudent(InterswitchPageStudent):
    8993    """ View which sends a POST request to the Interswitch
     
    111115        xmldict['provider_item_name'] = PROVIDER_ITEM_NAME
    112116        # Institution data
    113         xmldict['institution_acct'] = '00000000'
    114         xmldict['institution_bank_id'] = '00'
     117        xmldict['institution_acct'] = '0010761873'
     118        xmldict['institution_bank_id'] = '11'
    115119        xmldict['institution_amt'] = '0.0'
    116120        provider_amt = 500.0
    117         self.pay_item_id = '0000' # must be provided by Interswitch
     121
     122        if self.context.p_category.startswith('schoolfee'):
     123            self.pay_item_id = '102'
     124        elif self.context.p_category == 'clearance':
     125            self.pay_item_id = '103'
     126        elif self.context.p_category == 'bed_allocation':
     127            self.pay_item_id = '104'
     128        elif self.context.p_category == 'hostel_maintenance':
     129            self.pay_item_id = '105'
     130        elif self.context.p_category == 'transfer':
     131            self.pay_item_id = '106'
     132        elif self.context.p_category == 'gown':
     133            self.pay_item_id = '107'
     134        elif self.context.p_category == 'transcript':
     135            self.pay_item_id = '108'
     136        elif self.context.p_category == 'late_registration':
     137            self.pay_item_id = '109'
     138        elif self.context.p_category in SPECIAL_PAYMENT_PARAMS.keys():
     139            self.pay_item_id = SPECIAL_PAYMENT_PARAMS[self.context.p_category][0]
     140            provider_amt = SPECIAL_PAYMENT_PARAMS[self.context.p_category][1]
     141            xmldict['institution_acct'] = SPECIAL_PAYMENT_PARAMS[self.context.p_category][2]
     142            xmldict['institution_bank_id'] = SPECIAL_PAYMENT_PARAMS[self.context.p_category][3]
    118143        xmldict['provider_amt'] = 100 * provider_amt
    119144        xmldict['institution_item_name'] = self.context.category
  • main/kofacustom.dspg/trunk/src/kofacustom/dspg/interswitch/tests.py

    r14732 r14862  
    7474        self.payment_url = self.browser.url
    7575        self.browser.getLink("CollegePAY", index=0).click()
    76         self.assertMatches('...<input type="hidden" name="pay_item_id" value="0000" />...',
     76        self.assertMatches('...<input type="hidden" name="pay_item_id" value="102" />...',
    7777                           self.browser.contents)
    7878        self.assertMatches('...Total Amount Authorized:...',
     
    8383            self.browser.contents)
    8484        self.assertMatches(
    85             '...item_name="School Fee" item_amt="4000000" bank_id="00" acct_num="00000000"...',
     85            '...item_name="School Fee" item_amt="4000000" bank_id="11" acct_num="0010761873"...',
    8686            self.browser.contents)
    8787
     
    9797        self.browser.open(self.payments_path + '/xyz')
    9898        self.browser.getLink("CollegePAY", index=0).click()
    99         self.assertMatches('...<input type="hidden" name="pay_item_id" value="0000" />...',
     99        self.assertMatches('...<input type="hidden" name="pay_item_id" value="103" />...',
    100100                           self.browser.contents)
    101101        self.assertMatches('...Total Amount Authorized:...',
Note: See TracChangeset for help on using the changeset viewer.