Changeset 15015 for main/kofacustom.edopoly/trunk/src/kofacustom
- Timestamp:
- 23 May 2018, 05:45:13 (7 years ago)
- Location:
- main/kofacustom.edopoly/trunk/src/kofacustom/edopoly
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/browser/pages.py
r15000 r15015 34 34 form_fields = grok.AutoFields(ICustomSessionConfiguration) 35 35 36 class CustomCertificatePage(CertificatePage): 37 """Index page for certificates. 38 """ 39 form_fields = grok.AutoFields(ICertificate).omit( 40 'school_fee_2', 'school_fee_3', 'school_fee_4', 'ratio', 41 'custom_textline_1', 'custom_textline_2', 42 'custom_float_1', 'custom_float_2') 43 44 class CustomCertificateManageFormPage(CertificateManageFormPage): 45 """Manage the properties of a `Certificate` instance. 46 """ 47 form_fields = grok.AutoFields(ICertificate).omit( 48 'school_fee_2', 'school_fee_3', 'school_fee_4', 'ratio', 49 'custom_textline_1', 'custom_textline_2', 50 'custom_float_1', 'custom_float_2') -
main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/interfaces.py
r15013 r15015 87 87 ) 88 88 89 certificate_fee = schema.Float( 90 title = _(u'Certificate Fee'), 91 default = 0.0, 92 required = False, 93 ) 94 89 95 def getSessionString(): 90 96 """Returns the session string from the vocabulary. -
main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/interswitch/browser.py
r15009 r15015 30 30 from kofacustom.edopoly.interfaces import MessageFactory as _ 31 31 32 PRODUCT_ID = ' 6207' # must be provided by Interswitch32 PRODUCT_ID = '7571' # must be provided by Interswitch 33 33 SITE_NAME = 'edopoly-kofa.waeup.org' 34 34 PROVIDER_ACCT = '0773411069' … … 37 37 INSTITUTION_NAME = 'EdoPoly' 38 38 CURRENCY = '566' 39 GATEWAY_AMT = 300.0 40 41 #POST_ACTION = 'https://webpay.interswitchng.com/paydirect/pay' 42 POST_ACTION = 'https://sandbox.interswitchng.com/webpay/pay' 43 #HOST = 'webpay.interswitchng.com' 44 HOST = 'sandbox.interswitchng.com' 45 #URL = '/paydirect/api/v1/gettransaction.json' 46 URL = '/webpay/api/v1/gettransaction.json' 39 GATEWAY_AMT = 250.0 40 MAC = '672ABFB2F3755A7793DE545BDA00F44878DF59140B43A1E7DF16245D299F3108AFF65502F16D95256B3242B43CBC3F512A208EB1BA977080D65328800C49912C' 41 42 POST_ACTION = 'https://webpay.interswitchng.com/paydirect/pay' 43 #POST_ACTION = 'https://sandbox.interswitchng.com/webpay/pay' 44 HOST = 'webpay.interswitchng.com' 45 #HOST = 'sandbox.interswitchng.com' 46 URL = '/paydirect/api/v1/gettransaction.json' 47 #URL = '/webpay/api/v1/gettransaction.json' 47 48 48 49 httplib.HTTPSConnection.debuglevel = 0 … … 58 59 currency = CURRENCY 59 60 product_id = PRODUCT_ID 60 mac = 'CEF793CBBE838AA0CBB29B74D571113B4EA6586D3BA77E7CFA0B95E278364EFC4526ED7BD255A366CDDE11F1F607F0F844B09D93B16F7CFE87563B2272007AB3' # must be provided by Interswitch61 mac = MAC 61 62 62 63 def update(self): … … 73 74 xmldict['provider_bank_id'] = PROVIDER_BANK_ID 74 75 xmldict['provider_item_name'] = PROVIDER_ITEM_NAME 76 provider_amt = 0.0 77 if self.context.p_category == 'ict_entre': 78 provider_amt = 3000.0 79 if self.context.p_category == 'clearance': 80 provider_amt = 1500.0 81 if self.context.p_category in ('transcript', 'certificate'): 82 provider_amt = 2000.0 75 83 # Institution data 76 84 xmldict['institution_acct'] = '1015666713' 77 85 xmldict['institution_bank_id'] = '121' 78 86 xmldict['institution_amt'] = '0.0' 79 provider_amt = 0.080 87 self.pay_item_id = '101' # must be provided by Interswitch 81 88 xmldict['provider_amt'] = 100 * provider_amt … … 120 127 site_name = SITE_NAME 121 128 currency = CURRENCY 122 pay_item_id = ' 0000' # must be provided by Interswitch123 product_id = PRODUCT_ID 124 mac = ''129 pay_item_id = '101' # must be provided by Interswitch 130 product_id = PRODUCT_ID 131 mac = MAC 125 132 126 133 def update(self): … … 131 138 return 132 139 xmldict = {} 133 provider_amt = 400.0134 xmldict['institution_acct'] = ' 00000000000'135 xmldict['institution_bank_id'] = ' 00'140 provider_amt = 1000.0 141 xmldict['institution_acct'] = '1015666713' 142 xmldict['institution_bank_id'] = '121' 136 143 xmldict['detail_ref'] = self.context.p_id 137 144 xmldict['provider_amt'] = 100 * provider_amt … … 171 178 gateway_host = HOST 172 179 gateway_url = URL 173 mac = 'CEF793CBBE838AA0CBB29B74D571113B4EA6586D3BA77E7CFA0B95E278364EFC4526ED7BD255A366CDDE11F1F607F0F844B09D93B16F7CFE87563B2272007AB3'180 mac = MAC 174 181 175 182 class CustomInterswitchPaymentVerifyWebservicePageStudent( … … 181 188 gateway_host = HOST 182 189 gateway_url = URL 190 mac = MAC 183 191 184 192 class CustomInterswitchPaymentRequestWebservicePageApplicant( … … 190 198 gateway_host = HOST 191 199 gateway_url = URL 200 mac = MAC 192 201 193 202 class CustomInterswitchPaymentVerifyWebservicePageApplicant( … … 199 208 gateway_host = HOST 200 209 gateway_url = URL 210 mac = MAC -
main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/interswitch/tests.py
r15000 r15015 53 53 def test_interswitch_form(self): 54 54 # Manager can access InterswitchForm 55 # School Fee 55 56 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 56 57 self.browser.open(self.payments_path) … … 71 72 self.payment_url = self.browser.url 72 73 self.browser.getLink("CollegePAY", index=0).click() 73 self.assertTrue('<input type="hidden" name="pay_item_id" value=" 0000" />' in74 self.assertTrue('<input type="hidden" name="pay_item_id" value="101" />' in 74 75 self.browser.contents) 75 76 self.assertEqual(self.student.current_mode, 'ug_ft') … … 78 79 self.browser.contents) 79 80 self.assertTrue( 80 'item_name="School Fee" item_amt="3985000" bank_id="00" acct_num="00000000"' in 81 'item_name="Tuition Fee" item_amt="3975000" bank_id="121" acct_num="1015666713"' in 82 self.browser.contents) 83 # Clearance Fee 84 self.browser.open(self.payments_path + '/addop') 85 self.browser.getControl(name="form.p_category").value = ['clearance'] 86 self.browser.getControl("Create ticket").click() 87 self.assertMatches('...ticket created...', 88 self.browser.contents) 89 ctrl = self.browser.getControl(name='val_id') 90 self.value = ctrl.options[1] 91 self.browser.getLink(self.value).click() 92 self.assertTrue( 93 '<span>3456.0</span>' in self.browser.contents) 94 self.payment_url = self.browser.url 95 self.browser.getLink("CollegePAY", index=0).click() 96 self.assertTrue('<input type="hidden" name="pay_item_id" value="101" />' in 97 self.browser.contents) 98 self.assertTrue( 99 '<input type="hidden" name="amount" value="345600" />' in 100 self.browser.contents) 101 self.assertTrue( 102 'item_name="Acceptance Fee" item_amt="170600" bank_id="121" acct_num="1015666713"' in 81 103 self.browser.contents) 82 104 … … 92 114 self.browser.open(self.payments_path + '/xyz') 93 115 self.browser.getLink("CollegePAY", index=0).click() 94 self.assertMatches('...<input type="hidden" name="pay_item_id" value=" 0000" />...',116 self.assertMatches('...<input type="hidden" name="pay_item_id" value="101" />...', 95 117 self.browser.contents) 96 118 self.assertMatches('...Total Amount Authorized:...', -
main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/locales/en/LC_MESSAGES/waeup.kofa.po
r15014 r15015 14 14 msgid "Academics" 15 15 msgstr "Schools" 16 17 #: school_fee_1 18 msgid "Initial School Fee" 19 msgstr "Tuition Fee" 20 21 #: school_fee_2 22 msgid "Returning School Fee" 23 msgstr "Tuition Fee 2 (not used)" 24 25 #: school_fee_3 26 msgid "Foreigner Initial School Fee" 27 msgstr "Tuition Fee 3 (not used)" 28 29 #: school_fee_4 30 msgid "Foreigner Returning School Fee" 31 msgstr "Tuition Fee 4 (not used)" -
main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/students/utils.py
r15013 r15015 118 118 return _('Study course data are incomplete.'), None 119 119 if previous_session: 120 # Students can pay for previous sessions in all 121 # workflow states. Fresh students are excluded by the 122 # update method of the PreviousPaymentAddFormPage. 123 if previous_level == 100: 124 amount = getattr(certificate, 'school_fee_1', 0.0) 125 else: 126 amount = getattr(certificate, 'school_fee_2', 0.0) 120 amount = getattr(certificate, 'school_fee_1', 0.0) 127 121 else: 128 if student.state == CLEARED: 129 amount = getattr(certificate, 'school_fee_1', 0.0) 130 elif student.state == RETURNING: 122 amount = getattr(certificate, 'school_fee_1', 0.0) 123 if student.state == RETURNING: 131 124 # In case of returning school fee payment the 132 125 # payment session and level contain the values of … … 139 132 u'Session configuration object is not available.' 140 133 ), None 141 amount = getattr(certificate, 'school_fee_2', 0.0)134 142 135 elif student.is_postgrad and student.state == PAID: 143 136 # Returning postgraduate students also pay for the … … 150 143 u'Session configuration object is not available.' 151 144 ), None 152 amount = getattr(certificate, 'school_fee_2', 0.0)153 145 elif category == 'clearance': 154 146 try: … … 179 171 elif category == 'siwess_combo': 180 172 amount = academic_session.siwess_combo_fee 173 elif category == 'transcript': 174 amount = academic_session.transcript_fee 175 elif category == 'certificate': 176 amount = academic_session.certificate_fee 181 177 if amount in (0.0, None): 182 178 return _('Amount could not be determined.'), None -
main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/utils/utils.py
r15013 r15015 33 33 'ict_entre': 'ICT & Entrepreneur Fee', 34 34 'logbook_combo': 'Logbook Combo Fee', 35 'siwess_combo': 'SIWESS Combo Fee' 35 'siwess_combo': 'SIWESS Combo Fee', 36 'transcript': 'Transcript Fee', 37 'certificate': 'Certificate Fee', 36 38 } 37 39
Note: See TracChangeset for help on using the changeset viewer.