Changeset 8754 for main/waeup.aaue/trunk/src/waeup
- Timestamp:
- 18 Jun 2012, 17:02:17 (12 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
r8746 r8754 43 43 44 44 def update(self, PAYEE_ID=None): 45 # It seems eTranzact sends a POST request with an empty body but the URL46 # contains a query string. So it's actually a GET request pretended47 # to be a POST request. Although this does not comply with the48 # RFC 2616 HTTP guidelines we try to fetch the id from the QUERY_STRING49 # value of the request.50 45 real_ip = self.request.get('HTTP_X_FORWARDED_FOR', None) 51 46 if real_ip and ACCEPTED_IP: … … 53 48 self.output = '-4' 54 49 return 55 if PAYEE_ID is None: 56 try: 57 PAYEE_ID = self.request['QUERY_STRING'].split('=')[1] 58 except: 59 self.output = '-2' 60 return 50 51 # It seems eTranzact sends a POST request with an empty body but the URL 52 # contains a query string. So it's actually a GET request pretended 53 # to be a POST request. Although this does not comply with the 54 # RFC 2616 HTTP guidelines we may try to fetch the id from the QUERY_STRING 55 # value of the request. 56 57 #if PAYEE_ID is None: 58 # try: 59 # PAYEE_ID = self.request['QUERY_STRING'].split('=')[1] 60 # except: 61 # self.output = '-2' 62 # return 63 61 64 cat = getUtility(ICatalog, name='payments_catalog') 62 65 results = list(cat.searchResults(p_id=(PAYEE_ID, PAYEE_ID))) -
main/waeup.aaue/trunk/src/waeup/aaue/etranzact/tests.py
r8733 r8754 50 50 # Managers can add online payment tickets 51 51 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 52 self.app['configuration']['2004'].school_fee_base = 1234.0 52 53 self.browser.open(self.payments_path) 53 54 IWorkflowState(self.student).setState('cleared') … … 56 57 self.assertMatches('...ticket created...', 57 58 self.browser.contents) 59 58 60 ctrl = self.browser.getControl(name='val_id') 59 61 value = ctrl.options[0] … … 78 80 'RETURN_TYPE=%s&' 79 81 'PROGRAMME_TYPE=CERT1&' 80 'PAYMENT_TYPE=School Fee &'82 'PAYMENT_TYPE=School Fee 1st instalment&' 81 83 'ACADEMIC_SESSION=2004/2005&' 82 84 'MATRIC_NO=E1000000&' 83 'FEE_AMOUNT= 40000.0&'85 'FEE_AMOUNT=1234.0&' 84 86 'TRANSACTION_STATUS=unpaid' % self.p_id) 85 87
Note: See TracChangeset for help on using the changeset viewer.