Changeset 10954
- Timestamp:
- 21 Jan 2014, 15:17:29 (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
r10937 r10954 55 55 def update(self, PAYEE_ID=None, PAYMENT_TYPE=None): 56 56 if PAYEE_ID == None: 57 self.output = ' -1'57 self.output = 'Missing PAYEE_ID' # '-1' 58 58 return 59 59 real_ip = self.request.get('HTTP_X_FORWARDED_FOR', None) … … 64 64 if real_ip and self.ACCEPTED_IP: 65 65 if real_ip not in self.ACCEPTED_IP: 66 self.output = ' -2'66 self.output = 'Wrong IP address' # '-2' 67 67 return 68 68 if PAYMENT_TYPE not in ('SCHOOL-FEE', 'ACCEPTANCE-FEE', 'APPLICATION-FEE'): 69 self.output = ' -3'69 self.output = 'Invalid PAYMENT_TYPE' # '-3' 70 70 return 71 71 … … 85 85 results = list(cat.searchResults(p_id=(PAYEE_ID, PAYEE_ID))) 86 86 if len(results) != 1: 87 self.output = ' -1'87 self.output = 'Invalid PAYEE_ID' # '-1' 88 88 return 89 89 if PAYMENT_TYPE == 'SCHOOL-FEE' \ 90 90 and not results[0].p_category.startswith('schoolfee'): 91 self.output = ' -5'91 self.output = 'Wrong PAYMENT_TYPE' # '-5' 92 92 return 93 93 if PAYMENT_TYPE == 'ACCEPTANCE-FEE' \ 94 94 and not results[0].p_category == 'clearance': 95 self.output = ' -6'95 self.output = 'Wrong PAYMENT_TYPE' # '-6' 96 96 return 97 97 if PAYMENT_TYPE == 'APPLICATION-FEE' \ 98 98 and not results[0].p_category == 'application': 99 self.output = ' -7'99 self.output = 'Wrong PAYMENT_TYPE' # '-7' 100 100 return 101 101 try: … … 110 110 level = owner.current_level 111 111 except (TypeError, AttributeError): 112 self.output = ' -8'112 self.output = 'Unknown error, please contact Kofa administrator' # '-8' 113 113 return 114 114 amount = results[0].amount_auth -
main/waeup.aaue/trunk/src/waeup/aaue/etranzact/tests.py
r10937 r10954 108 108 109 109 self.browser.open('http://localhost/app/feerequest') 110 self.assertEqual(self.browser.contents, ' -1')110 self.assertEqual(self.browser.contents, 'Missing PAYEE_ID') 111 111 self.browser.open('http://localhost/app/feerequest?NONSENSE=nonsense') 112 self.assertEqual(self.browser.contents, '-1') 112 self.assertEqual(self.browser.contents, 'Missing PAYEE_ID') 113 self.browser.open( 114 'http://localhost/app/feerequest?PAYEE_ID=nonsense&PAYMENT_TYPE=SCHOOL-FEE') 115 self.assertEqual(self.browser.contents, 'Invalid PAYEE_ID') 113 116 self.browser.open( 114 117 'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=NONSENSE' 115 118 % self.p_id) 116 self.assertEqual(self.browser.contents, ' -3')119 self.assertEqual(self.browser.contents, 'Invalid PAYMENT_TYPE') 117 120 self.browser.open( 118 121 'http://localhost/app/feerequest?PAYEE_ID=%s' 119 122 % self.p_id) 120 self.assertEqual(self.browser.contents, ' -3')123 self.assertEqual(self.browser.contents, 'Invalid PAYMENT_TYPE') 121 124 self.browser.open( 122 125 'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=ACCEPTANCE-FEE' 123 126 % self.p_id) 124 self.assertEqual(self.browser.contents, ' -6')127 self.assertEqual(self.browser.contents, 'Wrong PAYMENT_TYPE') 125 128 self.browser.open( 126 129 'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=APPLICATION-FEE' 127 130 % self.p_id) 128 self.assertEqual(self.browser.contents, ' -7')131 self.assertEqual(self.browser.contents, 'Wrong PAYMENT_TYPE') 129 132 130 133
Note: See TracChangeset for help on using the changeset viewer.