Changeset 11650 for main/waeup.aaue/trunk/src/waeup
- Timestamp:
- 14 May 2014, 06:46:12 (11 years ago)
- Location:
- main/waeup.aaue/trunk/src/waeup/aaue/etranzact
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/etranzact/browser.py
r11631 r11650 65 65 These are not the data of the payee but of the payer. And it's 66 66 not the id of the payer but of the payment. 67 68 The PAYMENT_TYPE Etranzact is sending contains the amount and is 69 being compared with amount_auth of the payment ticket. 67 70 """ 68 71 grok.name('feerequest') … … 84 87 self.output = ERROR_PART1 + 'Wrong IP address' + ERROR_PART2 85 88 return 86 if PAYMENT_TYPE not in ('SCHOOL-FEE', 'ACCEPTANCE-FEE', 'APPLICATION-FEE'): 89 90 #if PAYMENT_TYPE not in ('SCHOOL-FEE', 'ACCEPTANCE-FEE', 'APPLICATION-FEE'): 91 92 try: 93 payment_type_amount = int(PAYMENT_TYPE) 94 except (ValueError, TypeError): 87 95 self.output = ERROR_PART1 + 'Invalid PAYMENT_TYPE' + ERROR_PART2 88 96 return … … 114 122 self.output = ERROR_PART1 + 'PAYEE_ID already used' + ERROR_PART2 115 123 return 116 if PAYMENT_TYPE == 'SCHOOL-FEE' \ 117 and not results[0].p_category.startswith('schoolfee'): 124 125 #if PAYMENT_TYPE == 'SCHOOL-FEE' \ 126 # and not results[0].p_category.startswith('schoolfee'): 127 # self.output = ERROR_PART1 + 'Wrong PAYMENT_TYPE' + ERROR_PART2 128 # return 129 #if PAYMENT_TYPE == 'ACCEPTANCE-FEE' \ 130 # and not results[0].p_category == 'clearance': 131 # self.output = ERROR_PART1 + 'Wrong PAYMENT_TYPE' + ERROR_PART2 132 # return 133 #if PAYMENT_TYPE == 'APPLICATION-FEE' \ 134 # and not results[0].p_category == 'application': 135 # self.output = ERROR_PART1 + 'Wrong PAYMENT_TYPE' + ERROR_PART2 136 # return 137 138 if payment_type_amount != amount: 118 139 self.output = ERROR_PART1 + 'Wrong PAYMENT_TYPE' + ERROR_PART2 119 140 return 120 if PAYMENT_TYPE == 'ACCEPTANCE-FEE' \ 121 and not results[0].p_category == 'clearance': 122 self.output = ERROR_PART1 + 'Wrong PAYMENT_TYPE' + ERROR_PART2 123 return 124 if PAYMENT_TYPE == 'APPLICATION-FEE' \ 125 and not results[0].p_category == 'application': 126 self.output = ERROR_PART1 + 'Wrong PAYMENT_TYPE' + ERROR_PART2 127 return 141 128 142 try: 129 143 owner = IPayer(results[0]) -
main/waeup.aaue/trunk/src/waeup/aaue/etranzact/tests.py
r11624 r11650 84 84 def test_webservice(self): 85 85 self.browser.open( 86 'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE= SCHOOL-FEE'86 'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=1234' 87 87 % self.p_id) 88 88 self.assertEqual(self.browser.contents, 89 # Version 190 #'FULL_NAME=Anna Tester&'91 #'FACULTY=fac1&'92 #'DEPARTMENT=dep1&'93 #'RETURN_TYPE=%s&'94 #'PROGRAMME_TYPE=CERT1&'95 #'PAYMENT_TYPE=School Fee&'96 #'ACADEMIC_SESSION=2004/2005&'97 #'MATRIC_NO=E1000000&'98 #'FEE_AMOUNT=1234.0&'99 #'TRANSACTION_STATUS=unpaid'100 101 # Version 2102 89 'PayeeName=Anna Tester~' 103 90 'Faculty=fac1~' … … 121 108 self.assertEqual(self.browser.contents, ERROR_PART1 + 'Missing PAYEE_ID' + ERROR_PART2) 122 109 self.browser.open( 123 'http://localhost/app/feerequest?PAYEE_ID=nonsense&PAYMENT_TYPE= SCHOOL-FEE')110 'http://localhost/app/feerequest?PAYEE_ID=nonsense&PAYMENT_TYPE=1234') 124 111 self.assertEqual(self.browser.contents, ERROR_PART1 + 'Invalid PAYEE_ID' + ERROR_PART2) 125 112 self.browser.open( … … 132 119 self.assertEqual(self.browser.contents, ERROR_PART1 + 'Invalid PAYMENT_TYPE' + ERROR_PART2) 133 120 self.browser.open( 134 'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=ACCEPTANCE-FEE' 135 % self.p_id) 136 self.assertEqual(self.browser.contents, ERROR_PART1 + 'Wrong PAYMENT_TYPE' + ERROR_PART2) 137 self.browser.open( 138 'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=APPLICATION-FEE' 121 'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=3456' 139 122 % self.p_id) 140 123 self.assertEqual(self.browser.contents, ERROR_PART1 + 'Wrong PAYMENT_TYPE' + ERROR_PART2) 141 124 self.student['payments'][self.p_id].p_state = 'paid' 142 125 self.browser.open( 143 'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE= SCHOOL-FEE'126 'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=1234' 144 127 % self.p_id) 145 128 self.assertEqual(self.browser.contents, ERROR_PART1 + 'PAYEE_ID already used' + ERROR_PART2)
Note: See TracChangeset for help on using the changeset viewer.