Changeset 12975 for main/waeup.aaue/trunk/src/waeup/aaue/interswitch
- Timestamp:
- 21 May 2015, 17:05:42 (10 years ago)
- Location:
- main/waeup.aaue/trunk/src/waeup/aaue/interswitch
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/interswitch/browser.py
r12730 r12975 21 21 from zope.interface import Interface 22 22 from zope.component import queryAdapter 23 from waeup.kofa.interfaces import CLEARED 23 24 from kofacustom.nigeria.interswitch.browser import ( 24 25 InterswitchPaymentRequestWebservicePageStudent, … … 68 69 def update(self): 69 70 70 super(CustomInterswitchPageApplicant, self).update() 71 error = self.init_update() 72 if error: 73 self.flash(error, type='danger') 74 self.redirect(self.url(self.context, '@@index')) 75 return 71 76 xmldict = {} 72 77 provider_amt = 1000.0 … … 116 121 117 122 def update(self): 118 #self.flash('Payment method not yet configured.', type='danger') 119 #self.redirect(self.url(self.context, '@@index')) 120 #return 121 super(CustomInterswitchPageStudent, self).update() 123 error = self.init_update() 124 if error: 125 self.flash(error, type='danger') 126 self.redirect(self.url(self.context, '@@index')) 127 return 122 128 student = self.student 129 130 # To guarantee that cleared students pay both acceptance fee 131 # and school fees, the page can only be accessed 132 # for school fee payments if acceptance/clearance fee has 133 # been successfully queried/paid beforehand. This 134 # requirement applies to students in state 'cleared' and 135 # entry_session greater than 2013 only. 136 if self.context.p_category == 'schoolfee' and \ 137 student.state == CLEARED and \ 138 student.entry_session > 2012: 139 acceptance_fee_paid = False 140 for ticket in student['payments'].values(): 141 if ticket.p_state == 'paid' and \ 142 ticket.p_category == 'clearance': 143 acceptance_fee_paid = True 144 break 145 if not acceptance_fee_paid: 146 self.flash( 147 _('Please pay acceptance fee first.'), type="danger") 148 self.redirect(self.url(self.context, '@@index')) 149 return 150 123 151 xmldict = self.xmldict 124 152 xmltext = "" -
main/waeup.aaue/trunk/src/waeup/aaue/interswitch/tests.py
r12730 r12975 107 107 108 108 def test_interswitch_form_school_fees(self): 109 self.student['studycourse'].entry_session = 2013 109 110 self.app['configuration']['2004'].school_fee_1 = 51750.0 110 111 # Manager can access InterswitchForm … … 128 129 self.payment_url = self.browser.url 129 130 self.browser.getLink("CollegePAY", index=0).click() 131 self.assertTrue( 132 'Please pay acceptance fee first' in self.browser.contents) 133 acc_payment = createObject('waeup.StudentOnlinePayment') 134 acc_payment.p_state = 'paid' 135 acc_payment.p_category = 'clearance' 136 self.student['payments']['xyz'] = acc_payment 137 self.browser.getLink("CollegePAY", index=0).click() 130 138 self.assertMatches('...<input type="hidden" name="pay_item_id" value="105" />...', 131 139 self.browser.contents) … … 139 147 '...item_name="School Fee" item_amt="4600000" bank_id="7" acct_num="1014847058"...', 140 148 self.browser.contents) 149 141 150 142 151 def test_interswitch_form_acceptance_fees(self):
Note: See TracChangeset for help on using the changeset viewer.