- Timestamp:
- 23 May 2018, 05:45:13 (7 years ago)
- Location:
- main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/interswitch
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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:...',
Note: See TracChangeset for help on using the changeset viewer.