Ignore:
Timestamp:
5 Oct 2020, 13:19:29 (4 years ago)
Author:
Henrik Bettermann
Message:

provider_amt has already to be stored when creating the payment ticket. Otherwise students will go to the bank and pay without this fee.

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

Legend:

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

    r16233 r16270  
    126126        xmldict['institution_item_name'] = self.context.category
    127127        xmldict['institution_name'] = INSTITUTION_NAME
    128         xmldict['institution_amt'] = 100 * self.context.net_amt
    129         if not self.context.provider_amt:
    130             self.context.provider_amt = provider_amt
    131             self.context.amount_auth += provider_amt
     128        xmldict['institution_amt'] = 100 * self.context.net_amt - (
     129            100 * provider_amt)
    132130        if provider_amt == 0:
    133131            xmltext = """<payment_item_detail>
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/interswitch/tests.py

    r16137 r16270  
    5353
    5454    def test_interswitch_form(self):
    55         self.app['configuration']['2004'].registration_fee = 2000.0
     55        self.app['configuration']['2004'].registration_fee = 7000.0
    5656        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
    5757        self.browser.open(self.payments_path)
     
    6262        self.browser.getControl("Create payment").click()
    6363        self.assertTrue('Payment created' in self.browser.contents)
     64        self.browser.open(self.payments_path)
    6465        ctrl = self.browser.getControl(name='val_id')
    6566        self.value = ctrl.options[0]
    6667        self.browser.getLink(self.value).click()
    6768        self.assertTrue(
    68             '<span>2000.0</span>' in self.browser.contents)
     69            '<span>7000.0</span>' in self.browser.contents)
    6970        self.payment_url = self.browser.url
    7071        self.browser.getLink("Pay via Interswitch", index=0).click()
     
    7576        payment = self.student['payments'][self.value]
    7677        self.assertEqual(payment.amount_auth, 7250)
    77         self.assertEqual(payment.net_amt, 2000)
     78        self.assertEqual(payment.net_amt, 7000)
    7879        self.assertTrue(
    7980            '<input type="hidden" name="amount" value="725000" />' in
    8081            self.browser.contents)
     82        # WAeAC charge have been substracted
    8183        self.assertTrue(
    8284            'item_name="Registration Fee" item_amt="200000" bank_id="117" acct_num="1011050158"' in
     85            self.browser.contents)
     86        self.assertTrue(
     87            'item_name="WAeAC" item_amt="500000" bank_id="31" acct_num="0773411069"' in
    8388            self.browser.contents)
    8489
     
    99104                           self.browser.contents)
    100105        self.assertEqual(self.student.current_mode, 'ug_ft')
    101         # 5000 provider charge and 250 gateway charge have been added
    102         self.assertTrue(
    103             '<input type="hidden" name="amount" value="625000" />' in
    104             self.browser.contents)
    105         self.assertEqual(acc_payment.amount_auth, 6250)
     106        # 250 gateway charge have been added
     107        self.assertTrue(
     108            '<input type="hidden" name="amount" value="125000" />' in
     109            self.browser.contents)
     110        self.assertEqual(acc_payment.amount_auth, 1250)
    106111        self.assertEqual(acc_payment.net_amt, 1000)
    107112        delta = timedelta(days=8)
Note: See TracChangeset for help on using the changeset viewer.