Ignore:
Timestamp:
8 Oct 2015, 10:33:42 (9 years ago)
Author:
Henrik Bettermann
Message:

Use item id just provided by Interswitch.

File:
1 edited

Legend:

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

    r13250 r13301  
    1818import httplib
    1919import grok
     20from zope.component import getUtility
     21from waeup.kofa.students.interfaces import IStudentsUtils
    2022from kofacustom.nigeria.interswitch.browser import (
    2123    InterswitchPaymentRequestWebservicePageApplicant,
     
    110112            xmldict['institution_bank_id'] = '16'
    111113            xmldict['institution_acct'] = '0122011401'
     114        elif self.context.p_category.startswith('bed_allocation'):
     115            self.pay_item_id = '5716'
     116            students_utils = getUtility(IStudentsUtils)
     117            stage = students_utils.getAccommodationDetails(student)['bt']
     118            stage = stage.split('_')[2]
     119            if stage == 'fr':
     120                union_dues = 500.0
     121            else:
     122                union_dues = 300.0
     123            xmldict['institution_bank_id'] = '129'
     124            xmldict['institution_acct'] = '0014419432'
     125            xmldict['union_dues'] = 100 * union_dues
    112126        elif self.context.p_category.startswith('hostel_maintenance'):
    113127            self.pay_item_id = '5705'
     
    120134        xmldict['institution_amt'] = 100 * (
    121135            self.context.amount_auth - provider_amt - GATEWAY_AMT)
    122         # Interswitch amount is not part of the xml data
    123         if provider_amt == 0:
     136
     137        if self.context.p_category == 'bed_allocation':
     138            xmldict['institution_amt'] = 100 * (
     139                self.context.amount_auth - GATEWAY_AMT - union_dues)
     140            xmltext = """<payment_item_detail>
     141<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
     142<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" />
     143<item_detail item_id="2" item_name="UNION DUES" item_amt="%(union_dues)d" bank_id="31" acct_num="0005986952" />
     144</item_details>
     145</payment_item_detail>""" % xmldict
     146        elif provider_amt == 0:
    124147            xmltext = """<payment_item_detail>
    125148<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
Note: See TracChangeset for help on using the changeset viewer.