Changeset 10937 for main/waeup.aaue/trunk/src
- Timestamp:
- 16 Jan 2014, 15:46:17 (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
r10932 r10937 53 53 ACCEPTED_IP = None 54 54 55 def update(self, PAYEE_ID=None ):55 def update(self, PAYEE_ID=None, PAYMENT_TYPE=None): 56 56 if PAYEE_ID == None: 57 57 self.output = '-1' … … 64 64 if real_ip and self.ACCEPTED_IP: 65 65 if real_ip not in self.ACCEPTED_IP: 66 self.output = '- 4'66 self.output = '-2' 67 67 return 68 if PAYMENT_TYPE not in ('SCHOOL-FEE', 'ACCEPTANCE-FEE', 'APPLICATION-FEE'): 69 self.output = '-3' 70 return 68 71 69 72 # It seems eTranzact sends a POST request with an empty body but the URL … … 76 79 # PAYEE_ID = self.request['QUERY_STRING'].split('=')[1] 77 80 # except: 78 # self.output = '- 2'81 # self.output = '-4' 79 82 # return 80 83 … … 83 86 if len(results) != 1: 84 87 self.output = '-1' 88 return 89 if PAYMENT_TYPE == 'SCHOOL-FEE' \ 90 and not results[0].p_category.startswith('schoolfee'): 91 self.output = '-5' 92 return 93 if PAYMENT_TYPE == 'ACCEPTANCE-FEE' \ 94 and not results[0].p_category == 'clearance': 95 self.output = '-6' 96 return 97 if PAYMENT_TYPE == 'APPLICATION-FEE' \ 98 and not results[0].p_category == 'application': 99 self.output = '-7' 85 100 return 86 101 try: … … 95 110 level = owner.current_level 96 111 except (TypeError, AttributeError): 97 self.output = '- 3'112 self.output = '-8' 98 113 return 99 114 amount = results[0].amount_auth -
main/waeup.aaue/trunk/src/waeup/aaue/etranzact/tests.py
r10932 r10937 74 74 75 75 def test_webservice(self): 76 self.browser.open('http://localhost/app/feerequest?PAYEE_ID=%s' % self.p_id) 76 self.browser.open( 77 'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=SCHOOL-FEE' 78 % self.p_id) 77 79 self.assertEqual(self.browser.contents, 78 80 # Version 1 … … 105 107 'PhoneNumber=1234' % self.p_id) 106 108 109 self.browser.open('http://localhost/app/feerequest') 110 self.assertEqual(self.browser.contents, '-1') 107 111 self.browser.open('http://localhost/app/feerequest?NONSENSE=nonsense') 108 112 self.assertEqual(self.browser.contents, '-1') 113 self.browser.open( 114 'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=NONSENSE' 115 % self.p_id) 116 self.assertEqual(self.browser.contents, '-3') 117 self.browser.open( 118 'http://localhost/app/feerequest?PAYEE_ID=%s' 119 % self.p_id) 120 self.assertEqual(self.browser.contents, '-3') 121 self.browser.open( 122 'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=ACCEPTANCE-FEE' 123 % self.p_id) 124 self.assertEqual(self.browser.contents, '-6') 125 self.browser.open( 126 'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=APPLICATION-FEE' 127 % self.p_id) 128 self.assertEqual(self.browser.contents, '-7') 129 109 130 110 131 @external_test
Note: See TracChangeset for help on using the changeset viewer.