Ignore:
Timestamp:
17 Apr 2023, 07:12:42 (18 months ago)
Author:
Henrik Bettermann
Message:

New instalment ratio

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

Legend:

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

    r17345 r17380  
    1919import hashlib
    2020import grok
     21import decimal
    2122from kofacustom.nigeria.interswitch.browser import (
    2223    module_activated,
     
    9798        xmldict['institution_item_name'] = self.context.category
    9899        xmldict['institution_name'] = INSTITUTION_NAME
    99         xmldict['institution_amt'] = 100 * self.context.net_amt
     100        xmldict['institution_amt'] = 100*int(decimal.Decimal(str(self.context.net_amt)))
    100101        if not self.context.provider_amt:
    101102            self.context.provider_amt = provider_amt
     
    116117        self.xml_data = """<input type="hidden" name="xml_data" value='%s'  />""" % xmltext
    117118        self.context.provider_amt = provider_amt
    118         self.amount_auth = int(100 * self.context.amount_auth)
     119        self.amount_auth = 100*int(decimal.Decimal(str(self.context.amount_auth)))
    119120        hashargs = (
    120121            self.context.p_id +
    121122            PRODUCT_ID +
    122123            self.pay_item_id +
    123             str(int(self.amount_auth)) +
     124            str(self.amount_auth) +
    124125            self.site_redirect_url +
    125126            self.mac)
  • main/kofacustom.edocons/trunk/src/kofacustom/edocons/interswitch/tests.py

    r17031 r17380  
    9494                           self.browser.contents)
    9595        self.assertTrue(
    96             '<span>26400.0</span>' in self.browser.contents)
     96            '<span>27800.0</span>' in self.browser.contents)
    9797        self.payment_url = self.browser.url
    9898        self.browser.getLink("Pay via Interswitch CollegePAY", index=0).click()
     
    101101        self.assertEqual(self.student.current_mode, 'ug_ft')
    102102        self.assertTrue(
    103             '<input type="hidden" name="amount" value="2670000" />' in
    104             self.browser.contents)
    105         self.assertTrue(
    106             'item_name="School Fee (66% - 1st instalment)" item_amt="2640000" bank_id="31" acct_num="1489560452"' in
     103            '<input type="hidden" name="amount" value="2810000" />' in
     104            self.browser.contents)
     105        self.assertTrue(
     106            'item_name="School Fee (69.5% - 1st instalment)" item_amt="2780000" bank_id="31" acct_num="1489560452"' in
    107107            self.browser.contents)
    108108
Note: See TracChangeset for help on using the changeset viewer.