Changeset 9956 for main/waeup.fceokene/trunk/src/waeup/fceokene/interswitch
- Timestamp:
- 15 Feb 2013, 11:49:44 (12 years ago)
- Location:
- main/waeup.fceokene/trunk/src/waeup/fceokene/interswitch
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.fceokene/trunk/src/waeup/fceokene/interswitch/browser.py
r9951 r9956 126 126 xmldict['institution_acct'] = "1012044132" 127 127 xmldict['institution_bank_id'] = '117' 128 elif self.context.p_category == 'clearance': 129 fceokene_split_amt = 0.0 130 provider_amt = 0.0 131 self.pay_item_id = '8304' 132 xmldict['institution_amt'] = 100 * ( 133 self.context.amount_auth - GATEWAY_AMT) 134 xmldict['institution_acct'] = "2003670143" 135 xmldict['institution_bank_id'] = '8' 136 128 137 # Interswitch amount is not part of the xml data 129 130 138 if self.context.p_category == 'schoolfee': 131 139 xmltext = """<payment_item_detail> … … 137 145 </payment_item_detail>""" % xmldict 138 146 139 el if 'maintenance' in self.context.p_category:147 else: 140 148 xmltext = """<payment_item_detail> 141 149 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> -
main/waeup.fceokene/trunk/src/waeup/fceokene/interswitch/tests.py
r9951 r9956 63 63 self.assertMatches('...Amount Authorized...', 64 64 self.browser.contents) 65 self.assertMatches( 66 '...<span>12495.0</span>...', 67 self.browser.contents) 65 self.assertTrue( 66 '<span>12495.0</span>' in self.browser.contents) 68 67 self.payment_url = self.browser.url 69 68 … … 93 92 self.assertMatches('...Total Amount Authorized:...', 94 93 self.browser.contents) 95 self.assert Matches(96 ' ...<input type="hidden" name="amount" value="1249500.0" />...',97 self.browser.contents)98 self.assert Matches(99 ' ...item_name="School Fee" item_amt="934800" bank_id="117" acct_num="1012044015"...',100 self.browser.contents)101 self.assert Matches(102 ' ...item_name="FCEOkene Split" item_amt="140000" bank_id="117" acct_num="1012044039"...',103 self.browser.contents)104 self.assert Matches(105 ' ...item_name="BT Education" item_amt="160000" bank_id="31" acct_num="0026781725"...',106 self.browser.contents)94 self.assertTrue( 95 '<input type="hidden" name="amount" value="1249500.0" />' 96 in self.browser.contents) 97 self.assertTrue( 98 'item_name="School Fee" item_amt="934500" bank_id="117" acct_num="1012044015"' 99 in self.browser.contents) 100 self.assertTrue( 101 'item_name="FCEOkene Split" item_amt="140000" bank_id="117" acct_num="1012044039"' 102 in self.browser.contents) 103 self.assertTrue( 104 'item_name="BT Education" item_amt="160000" bank_id="31" acct_num="0026781725"' 105 in self.browser.contents) 107 106 108 107 # Let's do the same for maintenance fee payment … … 138 137 self.assertMatches('...Amount Authorized...', 139 138 self.browser.contents) 140 self.assertMatches( 141 '...<span>4150.0</span>...', 142 self.browser.contents) 139 self.assertTrue( 140 '<span>4150.0</span>' in self.browser.contents) 143 141 self.payment_url = self.browser.url 144 142 self.assertEqual(self.student['payments'][value].provider_amt, 0.0) … … 155 153 self.assertMatches('...Total Amount Authorized:...', 156 154 self.browser.contents) 157 self.assertMatches( 158 '...<input type="hidden" name="amount" value="400000.0" />...', 155 self.assertTrue( 156 '<input type="hidden" name="amount" value="415000.0" />' 157 in self.browser.contents) 158 self.assertTrue( 159 'item_name="Hostel Maintenance Fee" item_amt="400000" bank_id="117" acct_num="1012044132"' 160 in self.browser.contents) 161 # BT does nor charge a fee for maintenance fee 162 self.assertFalse("BT Education" in self.browser.contents) 163 164 # Let's do the same for acceptance fee 165 166 self.browser.open(self.payments_path) 167 self.browser.open(self.payments_path + '/addop') 168 self.browser.getControl( 169 name="form.p_category").value = ['clearance'] 170 self.browser.getControl("Create ticket").click() 171 self.assertMatches('...ticket created...', 172 self.browser.contents) 173 ctrl = self.browser.getControl(name='val_id') 174 value = ctrl.options[2] 175 self.browser.getLink(value).click() 176 self.assertMatches('...Amount Authorized...', 177 self.browser.contents) 178 self.assertTrue( 179 '<span>3456.0</span>' in self.browser.contents) 180 self.payment_url = self.browser.url 181 self.assertEqual(self.student['payments'][value].provider_amt, 0.0) 182 self.assertEqual(self.student['payments'][value].gateway_amt, 0.0) 183 self.assertEqual(self.student['payments'][value].thirdparty_amt, 0.0) 184 # Manager can access InterswitchForm 185 self.browser.getLink("CollegePAY", index=0).click() 186 # Split amounts have been set 187 self.assertEqual(self.student['payments'][value].provider_amt, 0.0) 188 self.assertEqual(self.student['payments'][value].gateway_amt, 150.0) 189 self.assertEqual(self.student['payments'][value].thirdparty_amt, 0.0) 190 # The total amount to be processed by Interswitch 191 # has been reduced by the Interswitch fee of 150 Nairas 192 self.assertMatches('...Total Amount Authorized:...', 193 self.browser.contents) 194 self.assertTrue( 195 '<input type="hidden" name="amount" value="345600.0" />' in 159 196 self.browser.contents) 160 self.assert Matches(161 ' ...item_name="Hostel Maintenance Fee" item_amt="385000" bank_id="117" acct_num="1012044132"...',162 self.browser.contents)197 self.assertTrue( 198 'item_name="Acceptance Fee" item_amt="330600" bank_id="8" acct_num="2003670143"' 199 in self.browser.contents) 163 200 # BT does nor charge a fee for maintenance fee 164 201 self.assertFalse("BT Education" in self.browser.contents) … … 289 326 self.assertMatches('...Total Amount Authorized:...', 290 327 self.browser.contents) 291 self.assert Matches(292 ' ...<input type="hidden" name="amount" value="100000.0" />...',293 self.browser.contents)328 self.assertTrue( 329 '<input type="hidden" name="amount" value="100000.0" />' 330 in self.browser.contents) 294 331 295 332 @external_test
Note: See TracChangeset for help on using the changeset viewer.