Changeset 1949 for WAeUP_SRP/trunk


Ignore:
Timestamp:
23 Jun 2007, 04:25:10 (18 years ago)
Author:
Henrik Bettermann
Message:
  • logging messages changed
  • First check if student review state is correct
File:
1 edited

Legend:

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

    r1947 r1949  
    7272    if response_code == "00":
    7373        pd = {}
     74        review_state = context.getStudentReviewState(student_id)
     75        if review_state != "cleared_and_validated":
     76            logger.info('%s review_state = %s' % (student_id,review_state))
     77            continue       
    7478        review_state = wftool.getInfoFor(payment_obj,'review_state',None)
    7579        if payment_doc.resp_code == "":
    7680            if review_state != "opened":
    77                 logger.info('payment object of %s closed' % (student_id))
     81                logger.info("Payment object of %s is closed and won't be reopend" % (student_id))
    7882                continue
     83            logger.info('%s approves epayment for %s by import' % (member,student_id)))   
    7984        else:
    80             logger.info('payment object of %s old resp_code: %s' % (student_id,
    81                                                                   payment_doc.resp_code,
    82                                                                  ))
    8385            if review_state == "closed":
    84                 logger.info('payment object of %s closed will be reopened' % (student_id))
     86                logger.info('%s approves epayment for %s by import. Payment object was already closed, old resp_code: %s' % (member,student_id,payment_doc.resp_code))
    8587                wftool.doActionFor(payment_obj,'open')
    86         review_state = context.getStudentReviewState(student_id)
    87         if review_state != "cleared_and_validated":
    88             logger.info('%s review_state = %s' % (student_id,review_state))
    89             continue
     88            # cannot happen but anyway ...   
     89            else:
     90                logger.info('%s approves epayment for %s by import. Payment object is overwritten, old resp_code: %s' % (member,student_id,payment_doc.resp_code))
    9091        pd['resp_code'] = 'IP'
    9192        pd['resp_desc'] = 'Payment approved by import, %s' % (DateTime.DateTime())
     
    9394        if payment_doc.type_description.startswith('School Fee'):
    9495            wftool.doActionFor(student_obj,'pay_school_fee')
    95         logger.info('%s approves epayment for %s by import' % (member,student_id))
    9696        wftool.doActionFor(payment_obj,'close')
    9797        approved += 1
Note: See TracChangeset for help on using the changeset viewer.