- Timestamp:
- 5 Oct 2020, 13:19:29 (4 years ago)
- 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 126 126 xmldict['institution_item_name'] = self.context.category 127 127 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) 132 130 if provider_amt == 0: 133 131 xmltext = """<payment_item_detail> -
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/interswitch/tests.py
r16137 r16270 53 53 54 54 def test_interswitch_form(self): 55 self.app['configuration']['2004'].registration_fee = 2000.055 self.app['configuration']['2004'].registration_fee = 7000.0 56 56 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 57 57 self.browser.open(self.payments_path) … … 62 62 self.browser.getControl("Create payment").click() 63 63 self.assertTrue('Payment created' in self.browser.contents) 64 self.browser.open(self.payments_path) 64 65 ctrl = self.browser.getControl(name='val_id') 65 66 self.value = ctrl.options[0] 66 67 self.browser.getLink(self.value).click() 67 68 self.assertTrue( 68 '<span> 2000.0</span>' in self.browser.contents)69 '<span>7000.0</span>' in self.browser.contents) 69 70 self.payment_url = self.browser.url 70 71 self.browser.getLink("Pay via Interswitch", index=0).click() … … 75 76 payment = self.student['payments'][self.value] 76 77 self.assertEqual(payment.amount_auth, 7250) 77 self.assertEqual(payment.net_amt, 2000)78 self.assertEqual(payment.net_amt, 7000) 78 79 self.assertTrue( 79 80 '<input type="hidden" name="amount" value="725000" />' in 80 81 self.browser.contents) 82 # WAeAC charge have been substracted 81 83 self.assertTrue( 82 84 '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 83 88 self.browser.contents) 84 89 … … 99 104 self.browser.contents) 100 105 self.assertEqual(self.student.current_mode, 'ug_ft') 101 # 5000 provider charge and250 gateway charge have been added102 self.assertTrue( 103 '<input type="hidden" name="amount" value=" 625000" />' in104 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) 106 111 self.assertEqual(acc_payment.net_amt, 1000) 107 112 delta = timedelta(days=8)
Note: See TracChangeset for help on using the changeset viewer.