Changeset 9392 for main/waeup.kwarapoly
- Timestamp:
- 23 Oct 2012, 08:24:31 (12 years ago)
- Location:
- main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/browser.py
r9387 r9392 19 19 import httplib 20 20 import urllib 21 import hashlib 21 22 from xml.dom.minidom import parseString 22 23 import grok … … 42 43 #QUERY_URL = 'https://webpay.interswitchng.com/paydirect/services/TransactionQueryURL.aspx' 43 44 #QUERY_URL = 'https://testwebpay.interswitchng.com/test_paydirect/services/TransactionQueryURL.aspx' 45 44 46 #POST_ACTION = 'https://webpay.interswitchng.com/paydirect/webpay/pay.aspx' 45 47 POST_ACTION = 'https://testwebpay.interswitchng.com/test_paydirect/webpay/pay.aspx' … … 47 49 #HOST = 'webpay.interswitchng.com' 48 50 HOST = 'testwebpay.interswitchng.com' 51 49 52 #URL = '/paydirect/services/TransactionQueryWs.asmx' 50 53 URL = '/test_paydirect/services/TransactionQueryWs.asmx' … … 180 183 pay_item_id = '101' 181 184 product_id = PRODUCT_ID 185 mac = '737396C271FB8E2BA1A612A942267553E16373658A5F83D90DAFFBB806C16E9E6284006C06CEFFB55768004179D7BC01CD237CCE6314B938A5A5D9F49369DE5A' 182 186 183 187 def update(self): … … 235 239 xmldict['institution_item_name'] = self.context.p_category 236 240 xmldict['institution_name'] = INSTITUTION_NAME 241 242 hashargs = ( 243 self.context.p_id + 244 PRODUCT_ID + 245 self.pay_item_id + 246 str(int(self.amount_auth)) + 247 self.site_redirect_url + 248 self.mac) 249 self.hashvalue = hashlib.sha512(hashargs).hexdigest() 250 237 251 # Interswitch amount is not part of the xml data 238 252 xmltext = """<payment_item_detail> … … 259 273 site_name = SITE_NAME 260 274 currency = CURRENCY 261 pay_item_id = ' 8303'275 pay_item_id = '' 262 276 product_id = PRODUCT_ID 263 277 -
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/browser_templates/student_goto_interswitch.pt
r8441 r9392 59 59 <input type="hidden" name="currency" tal:attributes="value view/currency" /> 60 60 <input type="hidden" name="pay_item_id" tal:attributes="value view/pay_item_id" /> 61 <input type="hidden" name="hash" tal:attributes="value view/hashvalue" /> 61 62 <input type="hidden" name="site_redirect_url" tal:attributes="value view/site_redirect_url" /> 62 63 <input type="hidden" name="site_name" tal:attributes="value view/site_name" /> -
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/tests.py
r9387 r9392 69 69 self.student['studycourse'].current_verdict = 'A' 70 70 self.student['studycourse'].current_level = 100 71 # Set local lga 72 self.student.lga = u'kwara_asa' 71 73 # Update the catalog 72 74 notify(grok.ObjectModifiedEvent(self.student)) … … 101 103 self.browser.contents) 102 104 self.assertMatches( 103 '...<span> 60980.0</span>...',105 '...<span>37100.0</span>...', 104 106 self.browser.contents) 105 107 self.payment_url = self.browser.url … … 110 112 self.browser.contents) 111 113 self.assertMatches( 112 '...<input type="hidden" name="amount" value=" 6098000.0" />...',113 self.browser.contents) 114 self.assertMatches( 115 '...item_name="schoolfee" item_amt=" 5768000" bank_id="120" acct_num="1771180233"...',114 '...<input type="hidden" name="amount" value="3710000.0" />...', 115 self.browser.contents) 116 self.assertMatches( 117 '...item_name="schoolfee" item_amt="3380000" bank_id="120" acct_num="1771180233"...', 116 118 self.browser.contents) 117 119 self.assertMatches(
Note: See TracChangeset for help on using the changeset viewer.