Changeset 16270
- Timestamp:
- 5 Oct 2020, 13:19:29 (4 years ago)
- Location:
- main/kofacustom.iuokada/trunk/src/kofacustom/iuokada
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/etranzact/browser.py
r16261 r16270 159 159 # Already now it becomes an Etranzact payment. We set the net amount 160 160 # and add the gateway amount. 161 provider_amt = 0.0 162 if self.context.p_category in ( 163 'registration', 'required_combi', 'pg_other'): 164 provider_amt = 5000.0 165 if not self.context.r_company: 166 self.context.net_amt = self.context.amount_auth 167 self.context.amount_auth += self.gateway_amt 168 self.context.amount_auth += provider_amt 169 self.context.gateway_amt = self.gateway_amt 170 self.context.provider_amt = provider_amt 161 if not self.context.r_company: 162 self.context.net_amt = self.context.amount_auth 163 self.context.amount_auth += self.gateway_amt 164 self.context.gateway_amt = self.gateway_amt 171 165 self.context.r_company = u'etranzact' 172 166 self.amount = "%.1f" % self.context.amount_auth … … 222 216 # Already now it becomes an Etranzact payment. We set the net amount 223 217 # and add the gateway amount. 224 provider_amt = 0.0 225 if self.context.p_category in ( 226 'registration', 'required_combi', 'pg_other'): 227 provider_amt = 5000.0 228 if not self.context.r_company: 229 self.context.net_amt = self.context.amount_auth 230 self.context.amount_auth += self.gateway_amt 231 self.context.amount_auth += provider_amt 232 self.context.gateway_amt = self.gateway_amt 233 self.context.provider_amt = provider_amt 218 if not self.context.r_company: 219 self.context.net_amt = self.context.amount_auth 220 self.context.amount_auth += self.gateway_amt 221 self.context.gateway_amt = self.gateway_amt 234 222 self.context.r_company = u'etranzact' 235 223 return … … 248 236 # Already now it becomes an Etranzact payment. We set the net amount 249 237 # and add the gateway amount. 250 provider_amt = 0.0 251 if not self.context.r_company: 252 self.context.net_amt = self.context.amount_auth 253 self.context.amount_auth += self.gateway_amt 254 self.context.amount_auth += provider_amt 255 self.context.gateway_amt = self.gateway_amt 256 self.context.provider_amt = provider_amt 238 if not self.context.r_company: 239 self.context.net_amt = self.context.amount_auth 240 self.context.amount_auth += self.gateway_amt 241 self.context.gateway_amt = self.gateway_amt 257 242 self.context.r_company = u'etranzact' 258 243 return -
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) -
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/utils.py
r16257 r16270 247 247 payment = createObject(u'waeup.StudentOnlinePayment') 248 248 timestamp = ("%d" % int(time()*10000))[1:] 249 if category in ( 250 'registration', 'required_combi', 'pg_other'): 251 payment.provider_amt = 5000.0 252 if category in ( 253 'schoolfee', 'schoolfee40') and student.is_jupeb: 254 payment.provider_amt = 5000.0 249 255 payment.p_id = "p%s" % timestamp 250 256 payment.p_category = category
Note: See TracChangeset for help on using the changeset viewer.