Changeset 9387 for main/waeup.kwarapoly/trunk/src/waeup
- Timestamp:
- 22 Oct 2012, 14:37:00 (12 years ago)
- Location:
- main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/browser.py
r9347 r9387 33 33 from waeup.kwarapoly.interfaces import MessageFactory as _ 34 34 35 PRODUCT_ID = ' 83'35 PRODUCT_ID = '3986' 36 36 SITE_NAME = 'kwarapoly-kofa.waeup.org' 37 PROVIDER_ACCT = ' 0026781725'38 PROVIDER_BANK_ID = ' 31'37 PROVIDER_ACCT = '1010764827' 38 PROVIDER_BANK_ID = '117' 39 39 PROVIDER_ITEM_NAME = 'BT Education' 40 40 INSTITUTION_NAME = 'KwaraPoly' … … 42 42 #QUERY_URL = 'https://webpay.interswitchng.com/paydirect/services/TransactionQueryURL.aspx' 43 43 #QUERY_URL = 'https://testwebpay.interswitchng.com/test_paydirect/services/TransactionQueryURL.aspx' 44 POST_ACTION = 'https://webpay.interswitchng.com/paydirect/webpay/pay.aspx'45 #POST_ACTION = 'https://testwebpay.interswitchng.com/test_paydirect/webpay/pay.aspx'46 47 HOST = 'webpay.interswitchng.com'48 #HOST = 'testwebpay.interswitchng.com'49 URL = '/paydirect/services/TransactionQueryWs.asmx'50 #URL = '/test_paydirect/services/TransactionQueryWs.asmx'44 #POST_ACTION = 'https://webpay.interswitchng.com/paydirect/webpay/pay.aspx' 45 POST_ACTION = 'https://testwebpay.interswitchng.com/test_paydirect/webpay/pay.aspx' 46 47 #HOST = 'webpay.interswitchng.com' 48 HOST = 'testwebpay.interswitchng.com' 49 #URL = '/paydirect/services/TransactionQueryWs.asmx' 50 URL = '/test_paydirect/services/TransactionQueryWs.asmx' 51 51 httplib.HTTPConnection.debuglevel = 0 52 52 … … 178 178 site_name = SITE_NAME 179 179 currency = CURRENCY 180 pay_item_id = ' 8302'180 pay_item_id = '101' 181 181 product_id = PRODUCT_ID 182 182 … … 209 209 xmldict['provider_bank_id'] = PROVIDER_BANK_ID 210 210 xmldict['provider_item_name'] = PROVIDER_ITEM_NAME 211 xmldict['provider_amt'] = 100 * 500 211 xmldict['provider_amt'] = 100 * 1200 212 # Dalash data 213 xmldict['dalash_amt'] = 100 * 1800 212 214 # Institution data 213 studycourse = student['studycourse'] 214 if student.current_mode in ('ug_sw','prence',): 215 xmldict['institution_acct'] = "6216801025" 216 xmldict['institution_bank_id'] = '117' 217 elif student.current_mode in ('ug_ft',) and \ 218 student['studycourse'].current_verdict == 'O': 219 xmldict['institution_acct'] = "6216801025" 220 xmldict['institution_bank_id'] = '117' 221 elif student.current_mode in ('ug_ft',): 222 xmldict['institution_acct'] = "6216801033" 223 xmldict['institution_bank_id'] = '117' 224 elif student.current_mode in ('pd_ft',): 225 xmldict['institution_acct'] = "6216801025" 215 if xmldict['faculty'] in ('CPGS',): 216 xmldict['institution_acct'] = "1771180233" 217 xmldict['institution_bank_id'] = '120' 218 elif xmldict['faculty'] in ('IBAS',): 219 xmldict['institution_acct'] = "0006772436" 220 xmldict['institution_bank_id'] = '121' 221 elif xmldict['faculty'] in ('IETS',): 222 xmldict['institution_acct'] = "0106259811" 223 xmldict['institution_bank_id'] = '10' 224 elif xmldict['faculty'] in ('IFMS',): 225 xmldict['institution_acct'] = "2013910271" 226 xmldict['institution_bank_id'] = '8' 227 elif xmldict['faculty'] in ('ITCH',): 228 xmldict['institution_acct'] = "1010445144" 226 229 xmldict['institution_bank_id'] = '117' 227 230 else: 228 xmldict[' kwarapoly_acct'] = "0000000000000"231 xmldict['institution_acct'] = "0000000000000" 229 232 xmldict['institution_bank_id'] = '0' 230 xmldict['kwarapoly_split'] = 100 * 1400231 233 xmldict['institution_amt'] = 100 * ( 232 self.context.amount_auth - 500 - 150 - 1400)234 self.context.amount_auth - 1200 - 300 - 1800) 233 235 xmldict['institution_item_name'] = self.context.p_category 234 236 xmldict['institution_name'] = INSTITUTION_NAME … … 237 239 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> 238 240 <item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" /> 239 <item_detail item_id="2" item_name=" KwaraPoly Split" item_amt="%(kwarapoly_split)s" bank_id="117" acct_num="6216801058" />241 <item_detail item_id="2" item_name="Dalash" item_amt="%(dalash_amt)s" bank_id="117" acct_num="1013196791" /> 240 242 <item_detail item_id="3" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" /> 241 243 </item_details> … … 288 290 # Institution data 289 291 xmldict['institution_amt'] = 100 * (self.context.amount_auth - 500 - 150) 290 xmldict['institution_acct'] = ' 1012445289'291 xmldict['institution_bank_id'] = ' 117'292 xmldict['institution_acct'] = '0' 293 xmldict['institution_bank_id'] = '0' 292 294 xmldict['institution_item_name'] = self.context.p_category 293 295 xmldict['institution_name'] = INSTITUTION_NAME -
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/tests.py
r9370 r9387 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 import grok 18 19 from hurry.workflow.interfaces import IWorkflowState 20 from zope.component import createObject 21 from zope.event import notify 22 from waeup.kofa.university.faculty import Faculty 23 from waeup.kofa.university.department import Department 19 24 from waeup.kofa.students.tests.test_browser import StudentsFullSetup 20 25 from waeup.kofa.applicants.tests.test_browser import ApplicantsFullSetup … … 46 51 def setUp(self): 47 52 super(InterswitchTestsStudents, self).setUp() 53 54 # Create at least one Kwarapoly faculty 55 self.app['faculties']['CPGS'] = Faculty(code='CPGS') 56 self.app['faculties']['CPGS']['dep1'] = Department(code='dep1') 57 self.certificate2 = createObject('waeup.Certificate') 58 self.certificate2.code = u'CERT2' 59 self.certificate2.application_category = 'basic' 60 self.certificate2.study_mode = 'nd_ft' 61 self.certificate2.start_level = 100 62 self.certificate2.end_level = 300 63 self.app['faculties']['CPGS']['dep1'].certificates.addCertificate( 64 self.certificate2) 65 # Set study course attributes of test student 66 self.student['studycourse'].certificate = self.certificate2 67 self.student['studycourse'].current_session = 2004 68 self.student['studycourse'].entry_session = 2004 69 self.student['studycourse'].current_verdict = 'A' 70 self.student['studycourse'].current_level = 100 71 # Update the catalog 72 notify(grok.ObjectModifiedEvent(self.student)) 73 48 74 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 49 75 self.browser.open(self.payments_path) … … 75 101 self.browser.contents) 76 102 self.assertMatches( 77 '...<span> 12495.0</span>...',103 '...<span>60980.0</span>...', 78 104 self.browser.contents) 79 105 self.payment_url = self.browser.url … … 84 110 self.browser.contents) 85 111 self.assertMatches( 86 '...<input type="hidden" name="amount" value=" 1249500.0" />...',87 self.browser.contents) 88 self.assertMatches( 89 '...item_name="schoolfee" item_amt=" 1044500" bank_id="117" acct_num="6216801033"...',90 self.browser.contents) 91 self.assertMatches( 92 '...item_name=" KwaraPoly Split" item_amt="140000" bank_id="117" acct_num="6216801058"...',93 self.browser.contents) 94 self.assertMatches( 95 '...item_name="BT Education" item_amt=" 50000" bank_id="31" acct_num="0026781725"...',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"...', 116 self.browser.contents) 117 self.assertMatches( 118 '...item_name="Dalash" item_amt="180000" bank_id="117" acct_num="1013196791"...', 119 self.browser.contents) 120 self.assertMatches( 121 '...item_name="BT Education" item_amt="120000" bank_id="117" acct_num="1010764827"...', 96 122 self.browser.contents) 97 123
Note: See TracChangeset for help on using the changeset viewer.