Changeset 11651 for main/waeup.aaue/trunk/src/waeup
- Timestamp:
- 14 May 2014, 14:39:18 (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
r11650 r11651 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 is69 being compared with amount_auth of the payment ticket.70 67 """ 71 68 grok.name('feerequest') … … 87 84 self.output = ERROR_PART1 + 'Wrong IP address' + ERROR_PART2 88 85 return 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): 86 if PAYMENT_TYPE not in ('SCHOOL-FEE', 'ACCEPTANCE-FEE', 'APPLICATION-FEE'): 95 87 self.output = ERROR_PART1 + 'Invalid PAYMENT_TYPE' + ERROR_PART2 96 88 return … … 122 114 self.output = ERROR_PART1 + 'PAYEE_ID already used' + ERROR_PART2 123 115 return 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: 116 if PAYMENT_TYPE == 'SCHOOL-FEE' \ 117 and not results[0].p_category.startswith('schoolfee'): 139 118 self.output = ERROR_PART1 + 'Wrong PAYMENT_TYPE' + ERROR_PART2 140 119 return 141 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 142 128 try: 143 129 owner = IPayer(results[0]) -
main/waeup.aaue/trunk/src/waeup/aaue/etranzact/tests.py
r11650 r11651 84 84 def test_webservice(self): 85 85 self.browser.open( 86 'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE= 1234'86 'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=SCHOOL-FEE' 87 87 % self.p_id) 88 88 self.assertEqual(self.browser.contents, 89 # Version 1 90 #'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 2 89 102 'PayeeName=Anna Tester~' 90 103 'Faculty=fac1~' … … 108 121 self.assertEqual(self.browser.contents, ERROR_PART1 + 'Missing PAYEE_ID' + ERROR_PART2) 109 122 self.browser.open( 110 'http://localhost/app/feerequest?PAYEE_ID=nonsense&PAYMENT_TYPE= 1234')123 'http://localhost/app/feerequest?PAYEE_ID=nonsense&PAYMENT_TYPE=SCHOOL-FEE') 111 124 self.assertEqual(self.browser.contents, ERROR_PART1 + 'Invalid PAYEE_ID' + ERROR_PART2) 112 125 self.browser.open( … … 119 132 self.assertEqual(self.browser.contents, ERROR_PART1 + 'Invalid PAYMENT_TYPE' + ERROR_PART2) 120 133 self.browser.open( 121 'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=3456' 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' 122 139 % self.p_id) 123 140 self.assertEqual(self.browser.contents, ERROR_PART1 + 'Wrong PAYMENT_TYPE' + ERROR_PART2) 124 141 self.student['payments'][self.p_id].p_state = 'paid' 125 142 self.browser.open( 126 'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE= 1234'143 'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=SCHOOL-FEE' 127 144 % self.p_id) 128 145 self.assertEqual(self.browser.contents, ERROR_PART1 + 'PAYEE_ID already used' + ERROR_PART2)
Note: See TracChangeset for help on using the changeset viewer.