Ignore:
Timestamp:
21 Jan 2014, 15:17:29 (11 years ago)
Author:
Henrik Bettermann
Message:

Return cleartext error messages.

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  
    5555    def update(self, PAYEE_ID=None, PAYMENT_TYPE=None):
    5656        if PAYEE_ID == None:
    57             self.output = '-1'
     57            self.output = 'Missing PAYEE_ID' # '-1'
    5858            return
    5959        real_ip = self.request.get('HTTP_X_FORWARDED_FOR', None)
     
    6464        if real_ip  and self.ACCEPTED_IP:
    6565            if real_ip not in  self.ACCEPTED_IP:
    66                 self.output = '-2'
     66                self.output = 'Wrong IP address' # '-2'
    6767                return
    6868        if PAYMENT_TYPE not in ('SCHOOL-FEE', 'ACCEPTANCE-FEE', 'APPLICATION-FEE'):
    69             self.output = '-3'
     69            self.output = 'Invalid PAYMENT_TYPE' # '-3'
    7070            return
    7171
     
    8585        results = list(cat.searchResults(p_id=(PAYEE_ID, PAYEE_ID)))
    8686        if len(results) != 1:
    87             self.output = '-1'
     87            self.output = 'Invalid PAYEE_ID' # '-1'
    8888            return
    8989        if PAYMENT_TYPE == 'SCHOOL-FEE' \
    9090            and not results[0].p_category.startswith('schoolfee'):
    91             self.output = '-5'
     91            self.output = 'Wrong PAYMENT_TYPE' # '-5'
    9292            return
    9393        if PAYMENT_TYPE == 'ACCEPTANCE-FEE' \
    9494            and not results[0].p_category == 'clearance':
    95             self.output = '-6'
     95            self.output = 'Wrong PAYMENT_TYPE' # '-6'
    9696            return
    9797        if PAYMENT_TYPE == 'APPLICATION-FEE' \
    9898            and not results[0].p_category == 'application':
    99             self.output = '-7'
     99            self.output = 'Wrong PAYMENT_TYPE' # '-7'
    100100            return
    101101        try:
     
    110110            level = owner.current_level
    111111        except (TypeError, AttributeError):
    112             self.output = '-8'
     112            self.output = 'Unknown error, please contact Kofa administrator' # '-8'
    113113            return
    114114        amount = results[0].amount_auth
  • main/waeup.aaue/trunk/src/waeup/aaue/etranzact/tests.py

    r10937 r10954  
    108108
    109109        self.browser.open('http://localhost/app/feerequest')
    110         self.assertEqual(self.browser.contents, '-1')
     110        self.assertEqual(self.browser.contents, 'Missing PAYEE_ID')
    111111        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')
    113116        self.browser.open(
    114117            'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=NONSENSE'
    115118            % self.p_id)
    116         self.assertEqual(self.browser.contents, '-3')
     119        self.assertEqual(self.browser.contents, 'Invalid PAYMENT_TYPE')
    117120        self.browser.open(
    118121            'http://localhost/app/feerequest?PAYEE_ID=%s'
    119122            % self.p_id)
    120         self.assertEqual(self.browser.contents, '-3')
     123        self.assertEqual(self.browser.contents, 'Invalid PAYMENT_TYPE')
    121124        self.browser.open(
    122125            'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=ACCEPTANCE-FEE'
    123126            % self.p_id)
    124         self.assertEqual(self.browser.contents, '-6')
     127        self.assertEqual(self.browser.contents, 'Wrong PAYMENT_TYPE')
    125128        self.browser.open(
    126129            'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=APPLICATION-FEE'
    127130            % self.p_id)
    128         self.assertEqual(self.browser.contents, '-7')
     131        self.assertEqual(self.browser.contents, 'Wrong PAYMENT_TYPE')
    129132
    130133
Note: See TracChangeset for help on using the changeset viewer.