Ignore:
Timestamp:
16 Mar 2012, 07:53:00 (13 years ago)
Author:
Henrik Bettermann
Message:

Add amount checking.

Location:
main/waeup.custom/trunk/src/waeup/custom/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.custom/trunk/src/waeup/custom/students/interswitch.py

    r7894 r7896  
    151151            return
    152152
    153         # Add amount checking
    154 
     153        if query.get('apprAmt', None) != str(self.context.amount_auth):
     154            self.flash(_('Wrong amount'))
     155            write_log_message(self,'wrong amount: %s' % self.context.p_id)
     156            self.context.r_card_num = query.get('cardNum', None)
     157            self.context.r_code = query.get('resp', None)
     158            self.context.p_state = 'failed'
     159            return
    155160
    156161        # Add webservice validation
  • main/waeup.custom/trunk/src/waeup/custom/students/tests/test_interswitch.py

    r7895 r7896  
    7474                           self.browser.contents)
    7575        self.browser.open(self.callback_url(payment_url, '00', '300'))
     76        self.assertMatches('...Wrong amount...',
     77                          self.browser.contents)
     78        self.browser.open(self.callback_url(payment_url, '00', '40000'))
    7679        self.assertMatches('...Valid callback received...',
    7780                          self.browser.contents)
Note: See TracChangeset for help on using the changeset viewer.