Ignore:
Timestamp:
30 Mar 2014, 05:52:51 (11 years ago)
Author:
Henrik Bettermann
Message:

Webservice returns error message if payment ticket is paid (ticket #88).

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

    r11291 r11554  
    105105            self.output = ERROR_PART1 + 'Invalid PAYEE_ID' + ERROR_PART2
    106106            return
     107        amount = results[0].amount_auth
     108        payment_type = results[0].category
     109        programme_type = results[0].p_item
     110        academic_session = academic_sessions_vocab.getTerm(
     111            results[0].p_session).title
     112        status = results[0].p_state
     113        if status == 'paid':
     114            self.output = ERROR_PART1 + 'PAYEE_ID already used' + ERROR_PART2
     115            return
    107116        if PAYMENT_TYPE == 'SCHOOL-FEE' \
    108117            and not results[0].p_category.startswith('schoolfee'):
     
    130139            self.output = ERROR_PART1 +  'Unknown error' + ERROR_PART2
    131140            return
    132         amount = results[0].amount_auth
    133         payment_type = results[0].category
    134         programme_type = results[0].p_item
    135 
    136         academic_session = academic_sessions_vocab.getTerm(
    137             results[0].p_session).title
    138         status = results[0].p_state
    139141        self.output = (
    140142            # Version 1
  • main/waeup.aaue/trunk/src/waeup/aaue/etranzact/tests.py

    r11291 r11554  
    131131            % self.p_id)
    132132        self.assertEqual(self.browser.contents, ERROR_PART1 + 'Wrong PAYMENT_TYPE' + ERROR_PART2)
     133        self.student['payments'][self.p_id].p_state = 'paid'
     134        self.browser.open(
     135            'http://localhost/app/feerequest?PAYEE_ID=%s&PAYMENT_TYPE=SCHOOL-FEE'
     136            % self.p_id)
     137        self.assertEqual(self.browser.contents, ERROR_PART1 + 'PAYEE_ID already used' + ERROR_PART2)
    133138
    134139
Note: See TracChangeset for help on using the changeset viewer.