Changeset 7130


Ignore:
Timestamp:
17 Nov 2011, 16:37:10 (13 years ago)
Author:
Henrik Bettermann
Message:

Remove if statement

if amount + surcharge != resp_approved_amount ...

which lead to wrong warnings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_epayment/interswitch_cb.py

    r6984 r7130  
    4343
    4444referer = request.get('HTTP_REFERER','none')
    45 real_ip = request.get('HTTP_X_REAL_IP',"none") 
     45real_ip = request.get('HTTP_X_REAL_IP',"none")
    4646logger.info('%s, callback referer = %s, IP = %s' % (student_id,referer,real_ip))
    4747
     
    8686    wftool.doActionFor(context,'open')
    8787pay_doc = context.getContent()
    88 resp = pd['resp_code'] 
    89 
    90 if  resp == '00':
    91     try:
    92         amount = int(getattr(pay_doc,'amount',0))
    93         try:
    94             surcharge = int(getattr(pay_doc,'surcharge',0))
    95         except:
    96             surcharge = 0
    97         resp_approved_amount = int(pd['resp_approved_amount'])
    98         #set_trace()
    99         if not ontest and amount + surcharge != resp_approved_amount:
    100             logger.info('Warning: %s, approved amount %s and authorized amount %s are different for payment %s of %s' % (member,resp_approved_amount,amount+surcharge,context.getId(),student_id))
    101             pd['status'] = 'failed'
    102             pd['resp_desc'] = 'Warning: approved amount in callback does not match!'
    103             resp = ''
    104         else:
    105             pass
    106     except:
    107         logger.info('%s: approved amount could not be verified for payment %s of %s' % (member,context.getId(),student_id))
    108         pd['status'] = 'failed'
    109         pd['resp_desc'] = 'Warning: approved amount could not be verified!'
    110         resp = ''   
     88resp = pd['resp_code']
     89
     90#if  resp == '00':
     91#    try:
     92#        amount = int(getattr(pay_doc,'amount',0))
     93#        try:
     94#            surcharge = int(getattr(pay_doc,'surcharge',0))
     95#        except:
     96#            surcharge = 0
     97#        resp_approved_amount = int(pd['resp_approved_amount'])
     98#        #set_trace()
     99#        if not ontest and amount + surcharge != resp_approved_amount:
     100#            logger.info('Warning: %s, approved amount %s and authorized amount %s are different for payment %s of %s' % (member,resp_approved_amount,amount+surcharge,context.getId(),student_id))
     101#            pd['status'] = 'failed'
     102#            pd['resp_desc'] = 'Warning: approved amount in callback does not match!'
     103#            resp = ''
     104#        else:
     105#            pass
     106#    except:
     107#        logger.info('%s: approved amount could not be verified for payment %s of %s' % (member,context.getId(),student_id))
     108#        pd['status'] = 'failed'
     109#        pd['resp_desc'] = 'Warning: approved amount could not be verified!'
     110#        resp = ''
    111111
    112112pay_doc.edit(mapping = pd)
     
    122122next_previous_verdict = next_info['next_previous_verdict']
    123123if  resp == '00':
    124     if pay_doc.category == 'schoolfee': 
     124    if pay_doc.category == 'schoolfee':
    125125        if context.getStudentReviewState() == "school_fee_paid":
    126126            logger.info('%s paid school_fee in state school_fee_paid' % (student_id))
     
    144144
    145145    elif pay_doc.category == 'hostel_maintenance':
    146        
     146
    147147        ## callback function for accommodation_catalog method
    148148        data={}
     
    152152        data['acco_maint_pay_id'] = context.getId()
    153153        data['reservation_status'] = 'maintenance_fee_paid'
    154         context.accommodation_catalog.modifyRecord(**data)       
    155        
     154        context.accommodation_catalog.modifyRecord(**data)
     155
    156156        ## callback function for accommodation object method (deactivated since March 2011)
    157157        #acco_info = context.getAccommodationInfo()
     
    168168        #except:
    169169        #    logger.info('%s no workflow action pay_maintenance_fee' % student_id)
    170            
     170
    171171    elif pay_doc.category == 'acceptance':
    172172        if context.getStudentReviewState() in ('admitted', 'objection_raised'):
     
    199199
    200200return request.RESPONSE.redirect("%s/waeup_document_view" % context.absolute_url())
    201 
Note: See TracChangeset for help on using the changeset viewer.