Changeset 3963


Ignore:
Timestamp:
15 Feb 2009, 13:43:41 (16 years ago)
Author:
Henrik Bettermann
Message:

resolve #607

File:
1 edited

Legend:

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

    r3886 r3963  
    6868#pd['resp_code'] = '00'
    6969#pd['resp_card_num'] = '0000'
    70 #pd['resp_approved_amount'] = '10000'
     70#pd['resp_approved_amount'] = '4680000'
    7171
    7272if pd['resp_code'] == '00' and len(pd['resp_approved_amount']) > 4:
     
    8484    wftool.doActionFor(context,'open')
    8585pay_doc = context.getContent()
    86 pay_doc.edit(mapping = pd)
    8786resp = pd['resp_code'] 
    8887
     88try:
     89    amount = int(getattr(pay_doc,'amount',0))
     90    surcharge = int(getattr(pay_doc,'surcharge',0))
     91    resp_approved_amount = int(pd['resp_approved_amount'])
     92    #set_trace()
     93    if amount + surcharge != resp_approved_amount:
     94        logger.info('Warning: %s, approved amount %s and autorized amount %s are different for payment %s of %s' % (member,resp_approved_amount,amount+surcharge,context.getId(),student_id))
     95        pd['status'] = 'failed'
     96        pd['resp_desc'] = 'Warning: approved amount in callback does not match!'
     97        resp = ''
     98    else:
     99        pass
     100except:
     101    logger.info('%s: approved amount could not be verified for payment %s of %s' % (member,context.getId(),student_id))
     102    pd['status'] = 'failed'
     103    pd['resp_desc'] = 'Warning: approved amount could not be verified!'
     104    resp = ''   
     105
     106pay_doc.edit(mapping = pd)
    89107s_brain = context.students_catalog(id=student_id)[0]
    90108session = s_brain.session
Note: See TracChangeset for help on using the changeset viewer.